Search in sources :

Example 1 with LdapGlobalGrant

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

the class LdapProvisioning method getGlobalGrant.

@Override
public synchronized GlobalGrant getGlobalGrant() throws ServiceException {
    if (cachedGlobalGrant == null) {
        String globalGrantDn = mDIT.globalGrantDN();
        try {
            ZAttributes attrs = helper.getAttributes(LdapUsage.GET_GLOBALGRANT, globalGrantDn);
            LdapGlobalGrant globalGrant = new LdapGlobalGrant(globalGrantDn, attrs, this);
            if (useCache) {
                cachedGlobalGrant = globalGrant;
            } else {
                return globalGrant;
            }
        } catch (ServiceException e) {
            throw ServiceException.FAILURE("unable to get globalgrant", e);
        }
    }
    return cachedGlobalGrant;
}
Also used : LdapGlobalGrant(com.zimbra.cs.account.ldap.entry.LdapGlobalGrant) 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 LdapGlobalGrant (com.zimbra.cs.account.ldap.entry.LdapGlobalGrant)1 ZAttributes (com.zimbra.cs.ldap.ZAttributes)1