Search in sources :

Example 6 with LdapEntryNotFoundException

use of com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException in project zm-mailbox by Zimbra.

the class LdapProvisioning method getCosByName.

private Cos getCosByName(String name, ZLdapContext initZlc) throws ServiceException {
    LdapCos cos = cosCache.getByName(name);
    if (cos != null)
        return cos;
    try {
        String dn = mDIT.cosNametoDN(name);
        ZAttributes attrs = helper.getAttributes(initZlc, LdapServerType.REPLICA, LdapUsage.GET_COS, dn, null);
        cos = new LdapCos(dn, attrs, this);
        cosCache.put(cos);
        return cos;
    } catch (LdapEntryNotFoundException e) {
        return null;
    } catch (ServiceException e) {
        throw ServiceException.FAILURE("unable to lookup COS by name: " + name + " message: " + e.getMessage(), e);
    }
}
Also used : AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) LdapEntryNotFoundException(com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException) ZAttributes(com.zimbra.cs.ldap.ZAttributes) LdapCos(com.zimbra.cs.account.ldap.entry.LdapCos)

Example 7 with LdapEntryNotFoundException

use of com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException in project zm-mailbox by Zimbra.

the class LdapProvisioning method getAlwaysOnClusterByName.

private AlwaysOnCluster getAlwaysOnClusterByName(String name, boolean nocache) throws ServiceException {
    if (!nocache) {
        AlwaysOnCluster c = alwaysOnClusterCache.getByName(name);
        if (c != null)
            return c;
    }
    try {
        String dn = mDIT.alwaysOnClusterNameToDN(name);
        ZAttributes attrs = helper.getAttributes(LdapUsage.GET_ALWAYSONCLUSTER, dn);
        LdapAlwaysOnCluster c = new LdapAlwaysOnCluster(dn, attrs, null, this);
        alwaysOnClusterCache.put(c);
        return c;
    } catch (LdapEntryNotFoundException e) {
        return null;
    } catch (ServiceException e) {
        throw ServiceException.FAILURE("unable to lookup alwaysOnCluster by name: " + name + " message: " + e.getMessage(), e);
    }
}
Also used : LdapAlwaysOnCluster(com.zimbra.cs.account.ldap.entry.LdapAlwaysOnCluster) LdapAlwaysOnCluster(com.zimbra.cs.account.ldap.entry.LdapAlwaysOnCluster) AlwaysOnCluster(com.zimbra.cs.account.AlwaysOnCluster) AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) LdapEntryNotFoundException(com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException) ZAttributes(com.zimbra.cs.ldap.ZAttributes)

Example 8 with LdapEntryNotFoundException

use of com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException in project zm-mailbox by Zimbra.

the class LdapProvisioning method getXMPPComponentByName.

private XMPPComponent getXMPPComponentByName(String name, boolean nocache) throws ServiceException {
    if (!nocache) {
        XMPPComponent x = xmppComponentCache.getByName(name);
        if (x != null)
            return x;
    }
    try {
        String dn = mDIT.xmppcomponentNameToDN(name);
        ZAttributes attrs = helper.getAttributes(LdapUsage.GET_XMPPCOMPONENT, dn);
        XMPPComponent x = new LdapXMPPComponent(dn, attrs, this);
        xmppComponentCache.put(x);
        return x;
    } catch (LdapEntryNotFoundException e) {
        return null;
    } catch (ServiceException e) {
        throw ServiceException.FAILURE("unable to lookup xmpp component by name: " + name + " message: " + e.getMessage(), e);
    }
}
Also used : AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) LdapEntryNotFoundException(com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException) ZAttributes(com.zimbra.cs.ldap.ZAttributes) LdapXMPPComponent(com.zimbra.cs.account.ldap.entry.LdapXMPPComponent) XMPPComponent(com.zimbra.cs.account.XMPPComponent) LdapXMPPComponent(com.zimbra.cs.account.ldap.entry.LdapXMPPComponent)

Example 9 with LdapEntryNotFoundException

use of com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException in project zm-mailbox by Zimbra.

the class LdapProvisioning method getZimlet.

private Zimlet getZimlet(String name, ZLdapContext initZlc, boolean useZimletCache) throws ServiceException {
    LdapZimlet zimlet = null;
    if (useZimletCache) {
        zimlet = zimletCache.getByName(name);
    }
    if (zimlet != null) {
        return zimlet;
    }
    try {
        String dn = mDIT.zimletNameToDN(name);
        ZAttributes attrs = helper.getAttributes(initZlc, LdapServerType.REPLICA, LdapUsage.GET_ZIMLET, dn, null);
        zimlet = new LdapZimlet(dn, attrs, this);
        if (useZimletCache) {
            ZimletUtil.reloadZimlet(name);
            // put LdapZimlet into the cache after successful ZimletUtil.reloadZimlet()
            zimletCache.put(zimlet);
        }
        return zimlet;
    } catch (LdapEntryNotFoundException e) {
        return null;
    } catch (ServiceException ne) {
        throw ServiceException.FAILURE("unable to get zimlet: " + name, ne);
    } catch (ZimletException ze) {
        throw ServiceException.FAILURE("unable to load zimlet: " + name, ze);
    }
}
Also used : AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) LdapEntryNotFoundException(com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException) LdapZimlet(com.zimbra.cs.account.ldap.entry.LdapZimlet) ZAttributes(com.zimbra.cs.ldap.ZAttributes) ZimletException(com.zimbra.cs.zimlet.ZimletException)

Aggregations

LdapEntryNotFoundException (com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException)9 ServiceException (com.zimbra.common.service.ServiceException)8 ZAttributes (com.zimbra.cs.ldap.ZAttributes)8 AccountServiceException (com.zimbra.cs.account.AccountServiceException)7 AuthFailedServiceException (com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException)7 ZimletException (com.zimbra.cs.zimlet.ZimletException)2 AlwaysOnCluster (com.zimbra.cs.account.AlwaysOnCluster)1 Server (com.zimbra.cs.account.Server)1 UCService (com.zimbra.cs.account.UCService)1 XMPPComponent (com.zimbra.cs.account.XMPPComponent)1 LdapAlwaysOnCluster (com.zimbra.cs.account.ldap.entry.LdapAlwaysOnCluster)1 LdapCos (com.zimbra.cs.account.ldap.entry.LdapCos)1 LdapDomain (com.zimbra.cs.account.ldap.entry.LdapDomain)1 LdapServer (com.zimbra.cs.account.ldap.entry.LdapServer)1 LdapUCService (com.zimbra.cs.account.ldap.entry.LdapUCService)1 LdapXMPPComponent (com.zimbra.cs.account.ldap.entry.LdapXMPPComponent)1 LdapZimlet (com.zimbra.cs.account.ldap.entry.LdapZimlet)1 IAttributes (com.zimbra.cs.ldap.IAttributes)1 LdapException (com.zimbra.cs.ldap.LdapException)1 LdapContextNotEmptyException (com.zimbra.cs.ldap.LdapException.LdapContextNotEmptyException)1