Search in sources :

Example 1 with LdapConfig

use of com.zimbra.cs.account.ldap.entry.LdapConfig in project zm-mailbox by Zimbra.

the class LdapProvisioning method getConfig.

@Override
public synchronized Config getConfig() throws ServiceException {
    if (cachedGlobalConfig == null) {
        String configDn = mDIT.configDN();
        try {
            ZAttributes attrs = helper.getAttributes(LdapUsage.GET_GLOBALCONFIG, configDn);
            LdapConfig config = new LdapConfig(configDn, attrs, this);
            if (useCache) {
                cachedGlobalConfig = config;
            } else {
                return config;
            }
        } catch (ServiceException e) {
            throw ServiceException.FAILURE("unable to get config", e);
        }
    }
    return cachedGlobalConfig;
}
Also used : LdapConfig(com.zimbra.cs.account.ldap.entry.LdapConfig) ExternalLdapConfig(com.zimbra.cs.ldap.LdapServerConfig.ExternalLdapConfig) AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) ZAttributes(com.zimbra.cs.ldap.ZAttributes)

Aggregations

ServiceException (com.zimbra.common.service.ServiceException)1 AccountServiceException (com.zimbra.cs.account.AccountServiceException)1 AuthFailedServiceException (com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException)1 LdapConfig (com.zimbra.cs.account.ldap.entry.LdapConfig)1 ExternalLdapConfig (com.zimbra.cs.ldap.LdapServerConfig.ExternalLdapConfig)1 ZAttributes (com.zimbra.cs.ldap.ZAttributes)1