Search in sources :

Example 1 with LdapShareLocator

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

the class LdapProvisioning method deleteShareLocator.

@Override
public void deleteShareLocator(String id) throws ServiceException {
    LdapShareLocator shloc = (LdapShareLocator) get(Key.ShareLocatorBy.id, id);
    if (shloc == null)
        throw AccountServiceException.NO_SUCH_SHARE_LOCATOR(id);
    ZLdapContext zlc = null;
    try {
        zlc = LdapClient.getContext(LdapServerType.MASTER, LdapUsage.DELETE_SHARELOCATOR);
        zlc.deleteEntry(shloc.getDN());
        shareLocatorCache.remove(shloc);
    } catch (ServiceException e) {
        throw ServiceException.FAILURE("unable to delete share locator: " + id, e);
    } finally {
        LdapClient.closeContext(zlc);
    }
}
Also used : ZLdapContext(com.zimbra.cs.ldap.ZLdapContext) AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) LdapShareLocator(com.zimbra.cs.account.ldap.entry.LdapShareLocator)

Aggregations

ServiceException (com.zimbra.common.service.ServiceException)1 AccountServiceException (com.zimbra.cs.account.AccountServiceException)1 AuthFailedServiceException (com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException)1 LdapShareLocator (com.zimbra.cs.account.ldap.entry.LdapShareLocator)1 ZLdapContext (com.zimbra.cs.ldap.ZLdapContext)1