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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations