Search in sources :

Example 11 with LdapEntryManager

use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxTrust by GluuFederation.

the class CacheRefreshTimer method loadInumServerEntries.

private List<GluuInumMap> loadInumServerEntries(CacheRefreshConfiguration cacheRefreshConfiguration, LdapServerConnection inumDbServerConnection) {
    LdapEntryManager inumDbldapEntryManager = inumDbServerConnection.getLdapEntryManager();
    String inumbaseDn = inumDbServerConnection.getBaseDns()[0];
    Filter filterObjectClass = Filter.createEqualityFilter(OxTrustConstants.objectClass, OxTrustConstants.objectClassInumMap);
    Filter filterStatus = Filter.createNOTFilter(Filter.createEqualityFilter(OxTrustConstants.gluuStatus, GluuStatus.INACTIVE.getValue()));
    Filter filter = Filter.createANDFilter(filterObjectClass, filterStatus);
    return inumDbldapEntryManager.findEntries(inumbaseDn, GluuInumMap.class, filter, null, cacheRefreshConfiguration.getLdapSearchSizeLimit());
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) Filter(com.unboundid.ldap.sdk.Filter)

Example 12 with LdapEntryManager

use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxTrust by GluuFederation.

the class AppInitializer method getLdapEntryManager.

@Produces
@ApplicationScoped
@Named(LDAP_ENTRY_MANAGER_NAME)
public LdapEntryManager getLdapEntryManager() {
    LdapEntryManager ldapEntryManager = new LdapEntryManager(new OperationsFacade(this.connectionProvider));
    log.info("Created {}: {}", new Object[] { LDAP_ENTRY_MANAGER_NAME, ldapEntryManager.getLdapOperationService() });
    return ldapEntryManager;
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) OperationsFacade(org.gluu.site.ldap.OperationsFacade) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 13 with LdapEntryManager

use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxTrust 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);
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager)

Example 14 with LdapEntryManager

use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxTrust by GluuFederation.

the class AppInitializer method recreateCentralLdapEntryManager.

public void recreateCentralLdapEntryManager(@Observes @LdapCentralConfigurationReload String event) {
    // Get existing application scoped instance
    LdapEntryManager oldCentralLdapEntryManager = CdiUtil.getContextBean(beanManager, LdapEntryManager.class, LDAP_CENTRAL_ENTRY_MANAGER_NAME);
    // Recreate components
    createCentralConnectionProvider();
    // Close existing connections
    closeLdapEntryManager(oldCentralLdapEntryManager);
    // Force to create new bean
    LdapEntryManager ldapCentralEntryManager = ldapCentralEntryManagerInstance.get();
    ldapEntryManagerInstance.destroy(ldapCentralEntryManager);
    log.info("Recreated instance {}: {}", LDAP_CENTRAL_ENTRY_MANAGER_NAME, ldapCentralEntryManager);
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager)

Example 15 with LdapEntryManager

use of org.gluu.site.ldap.persistence.LdapEntryManager in project oxTrust by GluuFederation.

the class AppInitializer method applicationInitialized.

/**
	 * Initialize components and schedule DS connection time checker
	 */
public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
    log.debug("Creating application components");
    showBuildInfo();
    // Initialize local LDAP connection provider
    createConnectionProvider();
    configurationFactory.create();
    LdapEntryManager localLdapEntryManager = ldapEntryManagerInstance.get();
    // Initialize central LDAP connection provider
    createCentralConnectionProvider();
    initializeLdifArchiver(localLdapEntryManager);
    // Initialize template engine
    templateService.initTemplateEngine();
    // Initialize SubversionService
    subversionService.initSubversionService();
    // Initialize python interpreter
    pythonService.initPythonInterpreter(configurationFactory.getLdapConfiguration().getString("pythonModulesDir", null));
    // Initialize Shibboleth
    shibbolethInitializer.createShibbolethConfiguration();
    // Initialize script manager
    List<CustomScriptType> supportedCustomScriptTypes = Arrays.asList(CustomScriptType.CACHE_REFRESH, CustomScriptType.UPDATE_USER, CustomScriptType.USER_REGISTRATION, CustomScriptType.ID_GENERATOR, CustomScriptType.SCIM);
    // Start timer
    quartzSchedulerManager.start();
    // Schedule timer tasks
    metricService.initTimer();
    configurationFactory.initTimer();
    ldapStatusTimer.initTimer();
    metadataValidationTimer.initTimer();
    entityIDMonitoringService.initTimer();
    cacheRefreshTimer.initTimer();
    customScriptManager.initTimer(supportedCustomScriptTypes);
    statusCheckerDaily.initTimer();
    statusCheckerTimer.initTimer();
    svnSyncTimer.initTimer();
    logFileSizeChecker.initTimer();
    loggerService.updateLoggerConfigLocation();
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) CustomScriptType(org.xdi.model.custom.script.CustomScriptType)

Aggregations

LdapEntryManager (org.gluu.site.ldap.persistence.LdapEntryManager)33 OperationsFacade (org.gluu.site.ldap.OperationsFacade)8 Filter (com.unboundid.ldap.sdk.Filter)6 ArrayList (java.util.ArrayList)6 GluuSimplePerson (org.gluu.oxtrust.ldap.cache.model.GluuSimplePerson)5 ApplicationScoped (javax.enterprise.context.ApplicationScoped)4 Produces (javax.enterprise.inject.Produces)4 Named (javax.inject.Named)4 LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)4 GluuLdapConfiguration (org.xdi.model.ldap.GluuLdapConfiguration)4 Properties (java.util.Properties)3 GluuInumMap (org.gluu.oxtrust.ldap.cache.model.GluuInumMap)3 LDAPConnectionProvider (org.gluu.site.ldap.LDAPConnectionProvider)3 Date (java.util.Date)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 LinkedHashSet (java.util.LinkedHashSet)2 List (java.util.List)2 CacheCompoundKey (org.gluu.oxtrust.ldap.cache.model.CacheCompoundKey)2 CustomAttribute (org.xdi.ldap.model.CustomAttribute)2