use of org.xdi.config.oxtrust.LdapOxTrustConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationService method saveOxTrustImportPersonConfiguration.
public boolean saveOxTrustImportPersonConfiguration(ImportPersonConfig oxTrustImportPersonConfiguration) {
LdapOxTrustConfiguration ldapOxTrustConfiguration = getOxTrustConfiguration();
ldapOxTrustConfiguration.setImportPersonConfig(oxTrustImportPersonConfiguration);
ldapOxTrustConfiguration.setRevision(ldapOxTrustConfiguration.getRevision() + 1);
ldapEntryManager.merge(ldapOxTrustConfiguration);
return true;
}
use of org.xdi.config.oxtrust.LdapOxTrustConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationService method saveOxTrustCacheRefreshConfiguration.
public boolean saveOxTrustCacheRefreshConfiguration(CacheRefreshConfiguration oxTrustCacheRefreshConfiguration) {
LdapOxTrustConfiguration ldapOxTrustConfiguration = getOxTrustConfiguration();
ldapOxTrustConfiguration.setCacheRefresh(oxTrustCacheRefreshConfiguration);
ldapOxTrustConfiguration.setRevision(ldapOxTrustConfiguration.getRevision() + 1);
ldapEntryManager.merge(ldapOxTrustConfiguration);
return true;
}
use of org.xdi.config.oxtrust.LdapOxTrustConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationService method getOxTrustConfiguration.
private LdapOxTrustConfiguration getOxTrustConfiguration() {
String configurationDn = configurationFactory.getConfigurationDn();
LdapOxTrustConfiguration ldapOxTrustConfiguration = loadOxTrustConfig(configurationDn);
return ldapOxTrustConfiguration;
}
use of org.xdi.config.oxtrust.LdapOxTrustConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationService method saveOxTrustappConfiguration.
public boolean saveOxTrustappConfiguration(AppConfiguration oxTrustappConfiguration) {
LdapOxTrustConfiguration ldapOxTrustConfiguration = getOxTrustConfiguration();
ldapOxTrustConfiguration.setApplication(oxTrustappConfiguration);
ldapOxTrustConfiguration.setRevision(ldapOxTrustConfiguration.getRevision() + 1);
ldapEntryManager.merge(ldapOxTrustConfiguration);
return true;
}
use of org.xdi.config.oxtrust.LdapOxTrustConfiguration in project oxTrust by GluuFederation.
the class ConfigurationFactory method reloadConfiguration.
private void reloadConfiguration() {
// Reload LDAP configuration if needed
String ldapFileName = determineLdapConfigurationFileName();
File ldapFile = new File(ldapFileName);
if (ldapFile.exists()) {
final long lastModified = ldapFile.lastModified();
if (!StringHelper.equalsIgnoreCase(this.prevLdapFileName, ldapFileName) || (lastModified > ldapFileLastModifiedTime)) {
// reload configuration only if it was modified
// Reload configuration only if it was modified
this.prevLdapFileName = loadLdapConfiguration(ldapFileName);
event.select(LdapConfigurationReload.Literal.INSTANCE).fire(LDAP_CONFIGUARION_RELOAD_EVENT_TYPE);
}
}
// Reload LDAP central configuration if needed
File ldapCentralFile = new File(LDAP_CENTRAL_PROPERTIES_FILE);
if (ldapCentralFile.exists()) {
final long lastModified = ldapCentralFile.lastModified();
if (lastModified > ldapCentralFileLastModifiedTime) {
// Reload configuration only if it was modified
loadLdapCentralConfiguration();
event.select(LdapCentralConfigurationReload.Literal.INSTANCE).fire(LDAP_CENTRAL_CONFIGUARION_RELOAD_EVENT_TYPE);
}
} else if (this.ldapCentralConfiguration != null) {
// Allow to remove not mandatory configuration file
this.ldapCentralConfiguration = null;
event.select(LdapCentralConfigurationReload.Literal.INSTANCE).fire(LDAP_CENTRAL_CONFIGUARION_RELOAD_EVENT_TYPE);
}
if (!loadedFromLdap) {
return;
}
final LdapOxTrustConfiguration conf = loadConfigurationFromLdap("oxRevision");
if (conf == null) {
return;
}
if (conf.getRevision() <= this.loadedRevision) {
return;
}
createFromLdap(false);
}
Aggregations