use of org.gluu.persist.exception.mapping.BaseMappingException in project oxTrust by GluuFederation.
the class ConfigurationFactory method loadConfigurationFromLdap.
public LdapOxTrustConfiguration loadConfigurationFromLdap(String... returnAttributes) {
final LdapEntryManager ldapEntryManager = ldapEntryManagerInstance.get();
final String configurationDn = getConfigurationDn();
try {
final LdapOxTrustConfiguration conf = ldapEntryManager.find(LdapOxTrustConfiguration.class, configurationDn, returnAttributes);
return conf;
} catch (BaseMappingException ex) {
log.error("Failed to load configuration from LDAP", ex);
}
return null;
}
use of org.gluu.persist.exception.mapping.BaseMappingException in project oxTrust by GluuFederation.
the class CacheRefreshTimer method updateTargetEntriesViaVDS.
private List<String> updateTargetEntriesViaVDS(CacheRefreshConfiguration cacheRefreshConfiguration, LdapServerConnection targetServerConnection, Set<String> changedInums) {
List<String> result = new ArrayList<String>();
LdapEntryManager targetLdapEntryManager = targetServerConnection.getLdapEntryManager();
Filter filter = cacheRefreshService.createObjectClassPresenceFilter();
for (String changedInum : changedInums) {
String baseDn = "action=synchronizecache," + personService.getDnForPerson(changedInum);
try {
targetLdapEntryManager.findEntries(baseDn, GluuDummyEntry.class, filter, SearchScope.SUB, null, 0, cacheRefreshConfiguration.getLdapSearchSizeLimit());
result.add(changedInum);
log.debug("Updated entry with inum {}", changedInum);
} catch (BaseMappingException ex) {
log.error("Failed to update entry with inum '{}' using baseDN {}", changedInum, baseDn, ex);
}
}
return result;
}
use of org.gluu.persist.exception.mapping.BaseMappingException in project oxTrust by GluuFederation.
the class OrganizationService method getOxAuthSetting.
public LdapOxAuthConfiguration getOxAuthSetting(String configurationDn) {
// String configurationDn = configurationFactory.getConfigurationDn();
LdapOxAuthConfiguration ldapOxAuthConfiguration = null;
try {
configurationDn = configurationDn.replace("ou=oxtrust", "ou=oxauth");
ldapOxAuthConfiguration = ldapEntryManager.find(LdapOxAuthConfiguration.class, configurationDn);
return ldapOxAuthConfiguration;
} catch (BaseMappingException ex) {
log.error("Failed to load configuration from LDAP");
}
return null;
}
use of org.gluu.persist.exception.mapping.BaseMappingException 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