use of org.xdi.config.oxtrust.AppConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationAction method getProtectedOxTrustappConfiguration.
private String getProtectedOxTrustappConfiguration(AppConfiguration oxTrustappConfiguration) {
try {
AppConfiguration resultOxTrustappConfiguration = (AppConfiguration) BeanUtils.cloneBean(oxTrustappConfiguration);
resultOxTrustappConfiguration.setSvnConfigurationStorePassword(HIDDEN_PASSWORD_TEXT);
resultOxTrustappConfiguration.setKeystorePassword(HIDDEN_PASSWORD_TEXT);
resultOxTrustappConfiguration.setIdpSecurityKeyPassword(HIDDEN_PASSWORD_TEXT);
resultOxTrustappConfiguration.setIdpBindPassword(HIDDEN_PASSWORD_TEXT);
resultOxTrustappConfiguration.setCaCertsPassphrase(HIDDEN_PASSWORD_TEXT);
resultOxTrustappConfiguration.setOxAuthClientPassword(HIDDEN_PASSWORD_TEXT);
return jsonService.objectToJson(resultOxTrustappConfiguration);
} catch (Exception ex) {
log.error("Failed to prepare JSON from appConfiguration: '{}'", oxTrustappConfiguration, ex);
}
return null;
}
use of org.xdi.config.oxtrust.AppConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationAction method convertToOxTrustappConfiguration.
private AppConfiguration convertToOxTrustappConfiguration(String oxTrustappConfigurationJson) {
try {
AppConfiguration resultOxTrustappConfiguration = jsonService.jsonToObject(oxTrustappConfigurationJson, AppConfiguration.class);
processPasswordProperty(this.oxTrustappConfiguration, resultOxTrustappConfiguration, "svnConfigurationStorePassword");
processPasswordProperty(this.oxTrustappConfiguration, resultOxTrustappConfiguration, "keystorePassword");
processPasswordProperty(this.oxTrustappConfiguration, resultOxTrustappConfiguration, "idpSecurityKeyPassword");
processPasswordProperty(this.oxTrustappConfiguration, resultOxTrustappConfiguration, "idpBindPassword");
processPasswordProperty(this.oxTrustappConfiguration, resultOxTrustappConfiguration, "caCertsPassphrase");
processPasswordProperty(this.oxTrustappConfiguration, resultOxTrustappConfiguration, "oxAuthClientPassword");
// jsonConfigurationService.processScimTestModeIsTrue(this.oxTrustappConfiguration, resultOxTrustappConfiguration);
return resultOxTrustappConfiguration;
} catch (Exception ex) {
log.error("Failed to prepare appConfiguration from JSON: '{}'", oxTrustappConfigurationJson, ex);
}
return null;
}
use of org.xdi.config.oxtrust.AppConfiguration 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 (BaseMappingException 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 (BaseMappingException 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 (BaseMappingException ex) {
log.error("Failed to update appliance at central server", ex);
return;
}
}
log.debug("Appliance status update finished");
}
Aggregations