X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fconfig%2FAdminConfiguration.java;h=41dd92703786ae448dd7a6b366fd4f3b64285978;hb=848677173191182d46aa22ab83bee0de84999a81;hp=696d74f656adc11a5cfbdb196995c3c26df8aca1;hpb=64a5e9470799236f0af4ce2df98f77c94eb1bed3;p=portal%2Fric-dashboard.git diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AdminConfiguration.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AdminConfiguration.java index 696d74f6..41dd9270 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AdminConfiguration.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AdminConfiguration.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.lang.invoke.MethodHandles; import org.oransc.ric.portal.dashboard.DashboardUserManager; +import org.oransc.ric.portal.dashboard.AppStatsManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -32,7 +33,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; /** - * Creates an instance of the user manager. + * Creates an instance of the user manager and app stats manager. */ @Configuration @Profile("!test") @@ -42,11 +43,15 @@ public class AdminConfiguration { // Populated by the autowired constructor private final String userfile; + private final String statsfile; @Autowired - public AdminConfiguration(@Value("${userfile}") final String userfile) { + public AdminConfiguration(@Value("${userfile}") final String userfile, + @Value("${statsfile}") final String statsfile) { logger.debug("ctor userfile '{}'", userfile); + logger.debug("ctor statsfile '{}'", statsfile); this.userfile = userfile; + this.statsfile = statsfile; } @Bean @@ -55,4 +60,10 @@ public class AdminConfiguration { return new DashboardUserManager(userfile); } + @Bean + // The bean (method) name must be globally unique + public AppStatsManager statsManager() throws IOException { + return new AppStatsManager(statsfile); + } + }