Search in sources :

Example 31 with LdapProfile

use of password.pwm.config.profile.LdapProfile in project pwm by pwm-project.

the class UserInfoReader method getUserEmailAddress2.

@Override
public String getUserEmailAddress2() throws PwmUnrecoverableException {
    final LdapProfile ldapProfile = getUserIdentity().getLdapProfile(pwmApplication.getConfig());
    final String ldapEmailAttribute = ldapProfile.readSettingAsString(PwmSetting.EMAIL_USER_MAIL_ATTRIBUTE_2);
    return readStringAttribute(ldapEmailAttribute);
}
Also used : LdapProfile(password.pwm.config.profile.LdapProfile)

Example 32 with LdapProfile

use of password.pwm.config.profile.LdapProfile in project pwm by pwm-project.

the class UserInfoReader method getUserSmsNumber3.

@Override
public String getUserSmsNumber3() throws PwmUnrecoverableException {
    final LdapProfile ldapProfile = getUserIdentity().getLdapProfile(pwmApplication.getConfig());
    final String ldapSmsAttribute = ldapProfile.readSettingAsString(PwmSetting.SMS_USER_PHONE_ATTRIBUTE_3);
    return readStringAttribute(ldapSmsAttribute);
}
Also used : LdapProfile(password.pwm.config.profile.LdapProfile)

Example 33 with LdapProfile

use of password.pwm.config.profile.LdapProfile in project pwm by pwm-project.

the class UserInfoReader method getUserEmailAddress.

@Override
public String getUserEmailAddress() throws PwmUnrecoverableException {
    final LdapProfile ldapProfile = getUserIdentity().getLdapProfile(pwmApplication.getConfig());
    final String ldapEmailAttribute = ldapProfile.readSettingAsString(PwmSetting.EMAIL_USER_MAIL_ATTRIBUTE);
    return readStringAttribute(ldapEmailAttribute);
}
Also used : LdapProfile(password.pwm.config.profile.LdapProfile)

Example 34 with LdapProfile

use of password.pwm.config.profile.LdapProfile in project pwm by pwm-project.

the class LdapConnectionService method getProxyChaiProvider.

public ChaiProvider getProxyChaiProvider(final LdapProfile ldapProfile) throws PwmUnrecoverableException {
    final LdapProfile effectiveProfile = ldapProfile == null ? pwmApplication.getConfig().getDefaultLdapProfile() : ldapProfile;
    if (threadLocalProvider.get() != null && threadLocalProvider.get().containsKey(effectiveProfile)) {
        return threadLocalProvider.get().get(effectiveProfile);
    }
    final ChaiProvider chaiProvider = getNewProxyChaiProvider(effectiveProfile);
    if (threadLocalProvider.get() == null) {
        threadLocalProvider.set(new ConcurrentHashMap<>());
    }
    threadLocalProvider.get().put(effectiveProfile, chaiProvider);
    return chaiProvider;
}
Also used : ChaiProvider(com.novell.ldapchai.provider.ChaiProvider) LdapProfile(password.pwm.config.profile.LdapProfile)

Example 35 with LdapProfile

use of password.pwm.config.profile.LdapProfile in project pwm by pwm-project.

the class LdapConnectionService method init.

public void init(final PwmApplication pwmApplication) throws PwmException {
    this.pwmApplication = pwmApplication;
    chaiProviderFactory = ChaiProviderFactory.newProviderFactory();
    // read the lastLoginTime
    this.lastLdapErrors.putAll(readLastLdapFailure(pwmApplication));
    final int connectionsPerProfile = maxSlotsPerProfile(pwmApplication);
    LOGGER.trace("allocating " + connectionsPerProfile + " ldap proxy connections per profile");
    slotIncrementer = new AtomicLoopIntIncrementer(connectionsPerProfile);
    for (final LdapProfile ldapProfile : pwmApplication.getConfig().getLdapProfiles().values()) {
        proxyChaiProviders.put(ldapProfile, new ConcurrentHashMap<>());
    }
    status = STATUS.OPEN;
}
Also used : AtomicLoopIntIncrementer(password.pwm.util.java.AtomicLoopIntIncrementer) LdapProfile(password.pwm.config.profile.LdapProfile)

Aggregations

LdapProfile (password.pwm.config.profile.LdapProfile)54 ArrayList (java.util.ArrayList)16 PwmUnrecoverableException (password.pwm.error.PwmUnrecoverableException)16 ErrorInformation (password.pwm.error.ErrorInformation)15 ChaiOperationException (com.novell.ldapchai.exception.ChaiOperationException)12 Map (java.util.Map)11 ChaiUnavailableException (com.novell.ldapchai.exception.ChaiUnavailableException)10 ChaiUser (com.novell.ldapchai.ChaiUser)9 Configuration (password.pwm.config.Configuration)9 PwmOperationalException (password.pwm.error.PwmOperationalException)9 ChaiProvider (com.novell.ldapchai.provider.ChaiProvider)8 LinkedHashMap (java.util.LinkedHashMap)8 List (java.util.List)7 FormConfiguration (password.pwm.config.value.data.FormConfiguration)7 UserIdentity (password.pwm.bean.UserIdentity)6 ChaiException (com.novell.ldapchai.exception.ChaiException)5 ChaiConfiguration (com.novell.ldapchai.provider.ChaiConfiguration)5 IOException (java.io.IOException)5 HashSet (java.util.HashSet)5 TreeMap (java.util.TreeMap)5