Improved code.
This commit is contained in:
parent
defa20b003
commit
2ee42fd197
2 changed files with 12 additions and 13 deletions
|
@ -101,15 +101,14 @@ public class Federation extends PathPropertyList
|
|||
*
|
||||
* @return the active services
|
||||
*/
|
||||
public Services getActiveServices()
|
||||
public long getActiveServiceCount()
|
||||
{
|
||||
Services result;
|
||||
|
||||
result = new Services();
|
||||
long result;
|
||||
|
||||
result = 0;
|
||||
for (Organization organization : getActiveOrganizations())
|
||||
{
|
||||
result.addAll(organization.getActiveServices());
|
||||
result += organization.getActiveServiceCount();
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -121,14 +120,15 @@ public class Federation extends PathPropertyList
|
|||
*
|
||||
* @return the active services
|
||||
*/
|
||||
public long getActiveServiceCount()
|
||||
public Services getActiveServices()
|
||||
{
|
||||
long result;
|
||||
Services result;
|
||||
|
||||
result = new Services();
|
||||
|
||||
result = 0;
|
||||
for (Organization organization : getActiveOrganizations())
|
||||
{
|
||||
result += organization.getActiveServiceCount();
|
||||
result.addAll(organization.getActiveServices());
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -510,7 +510,7 @@ public class Federation extends PathPropertyList
|
|||
|
||||
result = new Softwares();
|
||||
|
||||
for (Service service : getServicesAll())
|
||||
for (Service service : getServices())
|
||||
{
|
||||
if (StringUtils.isNotBlank(service.getSoftwareName()))
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2021 Christian Pierre MOMON <christian@momon.org>
|
||||
* Copyright (C) 2020-2022 Christian Pierre MOMON <christian@momon.org>
|
||||
*
|
||||
* This file is part of StatoolInfos, simple service statistics tool.
|
||||
*
|
||||
|
@ -1271,8 +1271,7 @@ public class ChartHtmlizer
|
|||
{
|
||||
String result;
|
||||
|
||||
result = htmlizeServiceCountYearChart(federation.getServicesAll(),
|
||||
StatoolInfosUtils.parseDate(federation.getStartDate()).getYear());
|
||||
result = htmlizeServiceCountYearChart(federation.getServices(), StatoolInfosUtils.parseDate(federation.getStartDate()).getYear());
|
||||
|
||||
//
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue