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;
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")
// 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
return new DashboardUserManager(userfile);
}
+ @Bean
+ // The bean (method) name must be globally unique
+ public AppStatsManager statsManager() throws IOException {
+ return new AppStatsManager(statsfile);
+ }
+
}