use of com.zimbra.cs.account.ldap.LdapDIT in project zm-mailbox by Zimbra.
the class TestLdapHelper method searchForEntryNotFound.
@Test
public void searchForEntryNotFound() throws Exception {
LdapDIT dit = prov.getDIT();
String base = dit.configBranchBaseDN();
ZLdapFilter filter = filterFactory.fromFilterString(FilterId.UNITTEST, "(cn=bogus)");
ZSearchResultEntry sr = ldapHelper.searchForEntry(base, filter, null, false);
assertNull(sr);
}
use of com.zimbra.cs.account.ldap.LdapDIT in project zm-mailbox by Zimbra.
the class TestLdap method deleteAllNonDefaultCoses.
private static void deleteAllNonDefaultCoses() throws Exception {
LdapDIT dit = ((LdapProv) Provisioning.getInstance()).getDIT();
String cosBaseDN = dit.cosBaseDN();
Set<String> defaultCosDN = new HashSet<String>();
defaultCosDN.add(dit.cosNametoDN(Provisioning.DEFAULT_COS_NAME));
defaultCosDN.add(dit.cosNametoDN(Provisioning.DEFAULT_EXTERNAL_COS_NAME));
deleteAllChildrenUnderDN(cosBaseDN, defaultCosDN);
}
use of com.zimbra.cs.account.ldap.LdapDIT in project zm-mailbox by Zimbra.
the class Cleanup method deleteAllNonDefaultCoses.
private static void deleteAllNonDefaultCoses() throws Exception {
LdapDIT dit = ((LdapProv) Provisioning.getInstance()).getDIT();
String cosBaseDN = dit.cosBaseDN();
Set<String> defaultCosDN = new HashSet<String>();
defaultCosDN.add(dit.cosNametoDN(Provisioning.DEFAULT_COS_NAME));
defaultCosDN.add(dit.cosNametoDN(Provisioning.DEFAULT_EXTERNAL_COS_NAME));
deleteAllChildrenUnderDN(cosBaseDN, defaultCosDN);
}
use of com.zimbra.cs.account.ldap.LdapDIT in project zm-mailbox by Zimbra.
the class Cleanup method deleteAllNonDefaultServers.
private static void deleteAllNonDefaultServers() throws Exception {
LdapProv ldapProv = LdapProv.getInst();
LdapDIT dit = ldapProv.getDIT();
String serverBaseDN = dit.serverBaseDN();
Set<String> defaultServerDN = new HashSet<String>();
defaultServerDN.add(dit.serverNameToDN(ldapProv.getLocalServer().getName()));
deleteAllChildrenUnderDN(serverBaseDN, defaultServerDN);
}
use of com.zimbra.cs.account.ldap.LdapDIT in project zm-mailbox by Zimbra.
the class CollectAllEffectiveRights method getAllCalendarResources.
private Set<String> getAllCalendarResources() throws ServiceException {
LdapDIT ldapDIT = mProv.getDIT();
String base = ldapDIT.mailBranchBaseDN();
ZLdapFilter filter = ZLdapFilterFactory.getInstance().allCalendarResources();
// hack, see LDAPDIT.dnToEmail, for now we get naming rdn for both default and possible custom DIT
String[] returnAttrs = new String[] { Provisioning.A_cn, Provisioning.A_uid };
Visitor visitor = new Visitor(mProv);
mProv.searchLdapOnMaster(base, filter, returnAttrs, visitor);
return visitor.getResult();
}
Aggregations