use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class CacheRefreshTimer method updateStatus.
private void updateStatus(GluuConfiguration currentConfiguration, long lastRun) {
GluuConfiguration configuration = configurationService.getConfiguration();
Date currentDateTime = new Date();
configuration.setVdsCacheRefreshLastUpdate(currentDateTime);
configuration.setVdsCacheRefreshLastUpdateCount(currentConfiguration.getVdsCacheRefreshLastUpdateCount());
configuration.setVdsCacheRefreshProblemCount(currentConfiguration.getVdsCacheRefreshProblemCount());
configurationService.updateConfiguration(configuration);
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class CacheRefreshTimer method processInt.
public void processInt() {
CacheRefreshConfiguration cacheRefreshConfiguration = configurationFactory.getCacheRefreshConfiguration();
try {
GluuConfiguration currentConfiguration = configurationService.getConfiguration();
if (!isStartCacheRefresh(cacheRefreshConfiguration, currentConfiguration)) {
log.debug("Starting conditions aren't reached");
return;
}
processImpl(cacheRefreshConfiguration, currentConfiguration);
updateStatus(currentConfiguration, System.currentTimeMillis());
this.lastFinishedTime = System.currentTimeMillis();
} catch (Throwable ex) {
log.error("Exception happened while executing cache refresh synchronization", ex);
}
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@RequestScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuConfiguration configuration = configurationService.getConfiguration();
SmtpConfiguration smtpConfiguration = configuration.getSmtpConfiguration();
if (smtpConfiguration == null) {
return new SmtpConfiguration();
}
configurationService.decryptSmtpPassword(smtpConfiguration);
return smtpConfiguration;
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class StatusCheckerTimer method processInt.
/**
* Gather periodically site and server status
*
* @param when
* Date
* @param interval
* Interval
*/
private void processInt() {
log.debug("Starting update of configuration status");
AppConfiguration appConfiguration = configurationFactory.getAppConfiguration();
if (!appConfiguration.isUpdateStatus()) {
log.debug("isUpdateStatus");
return;
}
ConfigurationStatus configurationStatus = new ConfigurationStatus();
OxtrustStat oxtrustStatObject = new OxtrustStat();
oxtrustStatObject.setGroupCount(String.valueOf(groupService.countGroups()));
oxtrustStatObject.setPersonCount(String.valueOf(personService.countPersons()));
log.debug("Setting FactorAttributes");
FacterData facterData = getFacterData();
configurationStatus.setHostname(facterData.getHostname());
oxtrustStatObject.setIpAddress(facterData.getIpaddress());
oxtrustStatObject.setLoadAvg(facterData.getLoadAverage());
oxtrustStatObject.setSystemUptime(facterData.getUptime());
oxtrustStatObject.setFreeDiskSpace(facterData.getFreeDiskSpace());
oxtrustStatObject.setFreeMemory(facterData.getMemoryfree());
setHttpdAttributes(configurationStatus);
try {
setCertificateExpiryAttributes(configurationStatus);
} catch (Exception ex) {
log.error("Failed to check certificate expiration", ex);
}
GluuConfiguration configuration = configurationService.getConfiguration();
GluuOxTrustStat gluuOxTrustStat = configurationService.getOxtrustStat();
try {
BeanUtils.copyProperties(configuration, configurationStatus);
BeanUtils.copyProperties(gluuOxTrustStat, oxtrustStatObject);
} catch (Exception ex) {
log.error("Failed to copy status attributes", ex);
}
Date currentDateTime = new Date();
configuration.setLastUpdate(currentDateTime);
configurationService.updateConfiguration(configuration);
configurationService.updateOxtrustStat(gluuOxTrustStat);
log.debug("Configuration status update finished");
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class ConfigurationService method getConfiguration.
/**
* Get configuration
*
* @return Configuration
* @throws Exception
*/
public GluuConfiguration getConfiguration(String[] returnAttributes) {
GluuConfiguration result = null;
result = persistenceEntryManager.find(getDnForConfiguration(), GluuConfiguration.class, returnAttributes);
return result;
}
Aggregations