use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxAuth by GluuFederation.
the class AppInitializer method reloadConfiguration.
private void reloadConfiguration() {
LdapEntryManager localLdapEntryManager = ldapEntryManagerInstance.get();
log.trace("Attempting to use {}: {}", LDAP_ENTRY_MANAGER_NAME, localLdapEntryManager.getLdapOperationService());
List<GluuLdapConfiguration> newLdapAuthConfigs = loadLdapAuthConfigs(localLdapEntryManager);
if (!this.ldapAuthConfigs.equals(newLdapAuthConfigs)) {
recreateLdapAuthEntryManagers(newLdapAuthConfigs);
event.select(ReloadAuthScript.Literal.INSTANCE).fire(ExternalAuthenticationService.MODIFIED_INTERNAL_TYPES_EVENT_TYPE);
setDefaultAuthenticationMethod(localLdapEntryManager);
}
}
use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxAuth by GluuFederation.
the class AppInitializer method createLdapAuthEntryManager.
@Produces
@ApplicationScoped
@Named(LDAP_AUTH_ENTRY_MANAGER_NAME)
public List<LdapEntryManager> createLdapAuthEntryManager() {
List<LdapEntryManager> ldapAuthEntryManagers = new ArrayList<LdapEntryManager>();
if (this.ldapAuthConfigs.size() == 0) {
return ldapAuthEntryManagers;
}
for (int i = 0; i < this.ldapAuthConfigs.size(); i++) {
LdapEntryManager ldapAuthEntryManager = new LdapEntryManager(new OperationsFacade(this.authConnectionProviders.get(i), this.authBindConnectionProviders.get(i)));
log.debug("Created {}#{}: {}", new Object[] { LDAP_AUTH_ENTRY_MANAGER_NAME, i, ldapAuthEntryManager });
ldapAuthEntryManagers.add(ldapAuthEntryManager);
}
return ldapAuthEntryManagers;
}
use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxAuth by GluuFederation.
the class AppInitializer method recreateLdapEntryManager.
public void recreateLdapEntryManager(@Observes @LdapConfigurationReload String event) {
// Get existing application scoped instance
LdapEntryManager oldLdapEntryManager = CdiUtil.getContextBean(beanManager, LdapEntryManager.class, LDAP_ENTRY_MANAGER_NAME);
// Recreate components
createConnectionProvider();
// Close existing connections
closeLdapEntryManager(oldLdapEntryManager);
// Force to create new bean
LdapEntryManager ldapEntryManager = ldapEntryManagerInstance.get();
ldapEntryManagerInstance.destroy(ldapEntryManager);
log.info("Recreated instance {}: {}", LDAP_ENTRY_MANAGER_NAME, ldapEntryManager);
}
Aggregations