use of io.jans.as.model.common.ComponentType in project jans by JanssenProject.
the class StatService method init.
public boolean init() {
try {
final Set<ComponentType> enabledComponents = appConfiguration.getEnabledComponentTypes();
if (!enabledComponents.isEmpty() && !enabledComponents.contains(ComponentType.STAT)) {
log.trace("Stat service is not enabled.");
return false;
}
log.info("Initializing Stat Service");
initNodeId();
if (StringUtils.isBlank(nodeId)) {
log.error("Failed to initialize stat service. statNodeId is not set in configuration.");
return false;
}
if (StringUtils.isBlank(getBaseDn())) {
log.error("Failed to initialize stat service. 'stat' base dn is not set in configuration.");
return false;
}
final Date now = new Date();
prepareMonthlyBranch(now);
log.trace("Monthly branch created: {}", monthlyDn);
setupCurrentEntry(now);
log.info("Initialized Stat Service");
initialized = true;
return true;
} catch (Exception e) {
log.error("Failed to initialize Stat Service.", e);
return false;
}
}
Aggregations