Search in sources :

Example 1 with OperationsFacade

use of org.gluu.site.ldap.OperationsFacade in project oxAuth by GluuFederation.

the class AppInitializer method createLdapAuthEntryManager.

/*
	 * Utility method which can be used in custom scripts
	 */
public LdapEntryManager createLdapAuthEntryManager(GluuLdapConfiguration ldapAuthConfig) {
    LdapConnectionProviders ldapConnectionProviders = createAuthConnectionProviders(ldapAuthConfig);
    LdapEntryManager ldapAuthEntryManager = new LdapEntryManager(new OperationsFacade(ldapConnectionProviders.getConnectionProvider(), ldapConnectionProviders.getConnectionBindProvider()));
    log.debug("Created custom authentication LdapEntryManager: {}", ldapAuthEntryManager);
    return ldapAuthEntryManager;
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) OperationsFacade(org.gluu.site.ldap.OperationsFacade)

Example 2 with OperationsFacade

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

the class Configuration method createLdapEntryManager.

private LdapEntryManager createLdapEntryManager() {
    Properties connectionProperties = (Properties) this.ldapConfiguration.getProperties();
    Properties decryptedConnectionProperties = PropertiesDecrypter.decryptProperties(connectionProperties, this.cryptoConfigurationSalt);
    LDAPConnectionProvider connectionProvider = new LDAPConnectionProvider(decryptedConnectionProperties);
    LdapEntryManager ldapEntryManager = new LdapEntryManager(new OperationsFacade(connectionProvider, null));
    logger.debug("Created LdapEntryManager: {}", ldapEntryManager);
    return ldapEntryManager;
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) OperationsFacade(org.gluu.site.ldap.OperationsFacade) Properties(java.util.Properties) LDAPConnectionProvider(org.gluu.site.ldap.LDAPConnectionProvider)

Example 3 with OperationsFacade

use of org.gluu.site.ldap.OperationsFacade 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 4 with OperationsFacade

use of org.gluu.site.ldap.OperationsFacade in project oxAuth by GluuFederation.

the class Manual method init.

@BeforeClass
public void init() {
    final FileConfiguration fileConfiguration = new FileConfiguration(LDAP_FILE_PATH);
    final Properties props = PropertiesDecrypter.decryptProperties(fileConfiguration.getProperties(), "passoword");
    final LDAPConnectionProvider connectionProvider = new LDAPConnectionProvider(props);
    MANAGER = new LdapEntryManager(new OperationsFacade(connectionProvider));
}
Also used : FileConfiguration(org.xdi.util.properties.FileConfiguration) LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) OperationsFacade(org.gluu.site.ldap.OperationsFacade) Properties(java.util.Properties) LDAPConnectionProvider(org.gluu.site.ldap.LDAPConnectionProvider) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with OperationsFacade

use of org.gluu.site.ldap.OperationsFacade in project oxCore by GluuFederation.

the class LdapSampleEntryManager method createLdapEntryManager.

public LdapEntryManager createLdapEntryManager() {
    Properties connectionProperties = getSampleConnectionProperties();
    LDAPConnectionProvider connectionProvider = createConnectionProvider(connectionProperties);
    Properties bindConnectionProperties = prepareBindConnectionProperties(connectionProperties);
    LDAPConnectionProvider bindConnectionProvider = createBindConnectionProvider(bindConnectionProperties, connectionProperties);
    LdapEntryManager ldapEntryManager = new LdapEntryManager(new OperationsFacade(connectionProvider, bindConnectionProvider));
    log.debug("Created LdapEntryManager: " + ldapEntryManager);
    return ldapEntryManager;
}
Also used : LdapEntryManager(org.gluu.site.ldap.persistence.LdapEntryManager) OperationsFacade(org.gluu.site.ldap.OperationsFacade) Properties(java.util.Properties) LDAPConnectionProvider(org.gluu.site.ldap.LDAPConnectionProvider)

Aggregations

OperationsFacade (org.gluu.site.ldap.OperationsFacade)8 LdapEntryManager (org.gluu.site.ldap.persistence.LdapEntryManager)8 ApplicationScoped (javax.enterprise.context.ApplicationScoped)4 Produces (javax.enterprise.inject.Produces)4 Named (javax.inject.Named)4 Properties (java.util.Properties)3 LDAPConnectionProvider (org.gluu.site.ldap.LDAPConnectionProvider)3 ArrayList (java.util.ArrayList)1 CentralLdap (org.gluu.oxtrust.service.cdi.event.CentralLdap)1 BeforeClass (org.testng.annotations.BeforeClass)1 FileConfiguration (org.xdi.util.properties.FileConfiguration)1