use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@ApplicationScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuAppliance appliance = applianceService.getAppliance();
SmtpConfiguration smtpConfiguration = appliance.getSmtpConfiguration();
if (smtpConfiguration == null) {
return null;
}
String password = smtpConfiguration.getPassword();
if (StringHelper.isNotEmpty(password)) {
try {
smtpConfiguration.setPasswordDecrypted(encryptionService.decrypt(password));
} catch (EncryptionException ex) {
log.error("Failed to decript SMTP user password", ex);
}
}
return smtpConfiguration;
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class PassportUmaProtectionService method isPassportEnabled.
private boolean isPassportEnabled() {
GluuAppliance appliance = applianceService.getAppliance();
GluuBoolean passportEnbaled = appliance.getPassportEnabled();
return GluuBoolean.ENABLED.equals(passportEnbaled) || GluuBoolean.TRUE.equals(passportEnbaled);
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class LoggerService method setExternalLoggerConfig.
private boolean setExternalLoggerConfig() {
GluuAppliance updateAppliance = applianceService.getAppliance();
if (StringUtils.isEmpty(updateAppliance.getOxLogConfigLocation())) {
return false;
}
File log4jFile = new File(updateAppliance.getOxLogConfigLocation());
if (!log4jFile.exists())
return false;
LoggerContext loggerContext = LoggerContext.getContext(false);
loggerContext.setConfigLocation(log4jFile.toURI());
loggerContext.reconfigure();
return true;
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class JsonConfigurationService method saveOxMemCacheConfiguration.
public boolean saveOxMemCacheConfiguration(CacheConfiguration cachedConfiguration) {
GluuAppliance gluuAppliance = applianceService.getAppliance();
gluuAppliance.setCacheConfiguration(cachedConfiguration);
applianceService.updateAppliance(gluuAppliance);
return true;
}
use of org.gluu.oxtrust.model.GluuAppliance 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 appliance status");
AppConfiguration appConfiguration = configurationFactory.getAppConfiguration();
if (!appConfiguration.isUpdateApplianceStatus()) {
return;
}
GluuAppliance appliance;
try {
appliance = applianceService.getAppliance();
} catch (LdapMappingException ex) {
log.error("Failed to load current appliance", ex);
return;
}
// Execute facter and update appliance attributes
setFactorAttributes(appliance);
// Execute df and update appliance attributes
setDfAttributes(appliance);
// Set HTTPD attributes
setHttpdAttributes(appliance);
try {
setCertificateExpiryAttributes(appliance);
} catch (Exception ex) {
log.error("Failed to check certificate expiration", ex);
}
// setVDSAttributes(appliance);
Date currentDateTime = new Date();
appliance.setLastUpdate(currentDateTime);
try {
applianceService.updateAppliance(appliance);
} catch (LdapMappingException ex) {
log.error("Failed to update current appliance", ex);
return;
}
if (centralLdapService.isUseCentralServer()) {
try {
GluuAppliance tmpAppliance = new GluuAppliance();
tmpAppliance.setDn(appliance.getDn());
boolean existAppliance = centralLdapService.containsAppliance(tmpAppliance);
if (existAppliance) {
centralLdapService.updateAppliance(appliance);
} else {
centralLdapService.addAppliance(appliance);
}
} catch (LdapMappingException ex) {
log.error("Failed to update appliance at central server", ex);
return;
}
}
log.debug("Appliance status update finished");
}
Aggregations