Search in sources :

Example 36 with PersistenceEntryManager

use of org.gluu.persist.PersistenceEntryManager in project oxAuth by GluuFederation.

the class AppInitializer method createPersistenceEntryManager.

@Produces
@ApplicationScoped
@Named(ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME)
public PersistenceEntryManager createPersistenceEntryManager() {
    Properties connectionProperties = preparePersistanceProperties();
    PersistenceEntryManager persistenceEntryManager = applicationFactory.getPersistenceEntryManagerFactory().createEntryManager(connectionProperties);
    log.info("Created {}: {} with operation service: {}", new Object[] { ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME, persistenceEntryManager, persistenceEntryManager.getOperationService() });
    externalPersistenceExtensionService.executePersistenceExtensionAfterCreate(connectionProperties, persistenceEntryManager);
    return persistenceEntryManager;
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) Properties(java.util.Properties) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 37 with PersistenceEntryManager

use of org.gluu.persist.PersistenceEntryManager in project oxAuth by GluuFederation.

the class AppInitializer method applicationInitialized.

public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
    log.debug("Initializing application services");
    configurationFactory.create();
    PersistenceEntryManager localPersistenceEntryManager = persistenceEntryManagerInstance.get();
    log.trace("Attempting to use {}: {}", ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME, localPersistenceEntryManager.getOperationService());
    GluuConfiguration newConfiguration = loadConfiguration(localPersistenceEntryManager, "oxIDPAuthentication", "oxAuthenticationMode");
    this.persistenceAuthConfigs = loadPersistenceAuthConfigs(newConfiguration);
    // Initialize python interpreter
    pythonService.initPythonInterpreter(configurationFactory.getBaseConfiguration().getString("pythonModulesDir", null));
    // Initialize script manager
    List<CustomScriptType> supportedCustomScriptTypes = Lists.newArrayList(CustomScriptType.values());
    supportedCustomScriptTypes.remove(CustomScriptType.CACHE_REFRESH);
    supportedCustomScriptTypes.remove(CustomScriptType.UPDATE_USER);
    supportedCustomScriptTypes.remove(CustomScriptType.USER_REGISTRATION);
    supportedCustomScriptTypes.remove(CustomScriptType.SCIM);
    supportedCustomScriptTypes.remove(CustomScriptType.IDP);
    statService.init();
    // Start timer
    initSchedulerService();
    // Schedule timer tasks
    metricService.initTimer();
    configurationFactory.initTimer();
    loggerService.initTimer();
    ldapStatusTimer.initTimer();
    cleanerTimer.initTimer();
    customScriptManager.initTimer(supportedCustomScriptTypes);
    keyGeneratorTimer.initTimer();
    statTimer.initTimer();
    expirationNotificatorTimer.initTimer();
    initTimer();
    initCibaRequestsProcessor();
    // Set default authentication method after
    setDefaultAuthenticationMethod(newConfiguration);
    // Notify plugins about finish application initialization
    eventApplicationInitialized.select(ApplicationInitialized.Literal.APPLICATION).fire(new ApplicationInitializedEvent());
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) ApplicationInitializedEvent(org.gluu.service.cdi.event.ApplicationInitializedEvent) CustomScriptType(org.gluu.model.custom.script.CustomScriptType) GluuConfiguration(org.oxauth.persistence.model.configuration.GluuConfiguration)

Example 38 with PersistenceEntryManager

use of org.gluu.persist.PersistenceEntryManager in project oxAuth by GluuFederation.

the class LdapStatusTimer method processInt.

private void processInt() {
    logConnectionProviderStatistic(ldapEntryManager, "connectionProvider", "bindConnectionProvider");
    for (int i = 0; i < ldapAuthEntryManagers.size(); i++) {
        PersistenceEntryManager ldapAuthEntryManager = ldapAuthEntryManagers.get(i);
        logConnectionProviderStatistic(ldapAuthEntryManager, "authConnectionProvider#" + i, "bindAuthConnectionProvider#" + i);
    }
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager)

Aggregations

PersistenceEntryManager (org.gluu.persist.PersistenceEntryManager)38 Properties (java.util.Properties)8 SchemaEntry (org.gluu.model.SchemaEntry)7 ArrayList (java.util.ArrayList)6 ApplicationScoped (javax.enterprise.context.ApplicationScoped)5 Produces (javax.enterprise.inject.Produces)5 Named (javax.inject.Named)5 GluuSimplePerson (org.gluu.oxtrust.ldap.cache.model.GluuSimplePerson)5 BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)5 PersistenceEntryManagerFactory (org.gluu.persist.PersistenceEntryManagerFactory)4 Filter (org.gluu.search.filter.Filter)4 GluuLdapConfiguration (org.gluu.model.ldap.GluuLdapConfiguration)3 GluuInumMap (org.gluu.oxtrust.ldap.cache.model.GluuInumMap)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 LinkedHashSet (java.util.LinkedHashSet)2 List (java.util.List)2 CustomScriptType (org.gluu.model.custom.script.CustomScriptType)2 CacheCompoundKey (org.gluu.oxtrust.ldap.cache.model.CacheCompoundKey)2 ApplicationInitializedEvent (org.gluu.service.cdi.event.ApplicationInitializedEvent)2