use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdap method getDirectChildrenDNs.
private static List<String> getDirectChildrenDNs(ZLdapContext zlc, String dn) throws Exception {
final List<String> childrenDNs = new ArrayList<String>();
ZLdapFilter filter = ZLdapFilterFactory.getInstance().anyEntry();
ZSearchControls searchControls = ZSearchControls.createSearchControls(ZSearchScope.SEARCH_SCOPE_ONELEVEL, ZSearchControls.SIZE_UNLIMITED, new String[] { "objectClass" });
ZSearchResultEnumeration sr = zlc.searchDir(dn, filter, searchControls);
while (sr.hasMore()) {
ZSearchResultEntry entry = sr.next();
childrenDNs.add(entry.getDN());
}
sr.close();
return childrenDNs;
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method allNonSystemAccounts.
@Test
public void allNonSystemAccounts() throws Exception {
String filter = LegacyLdapFilter.allNonSystemAccounts();
// (&(objectclass=zimbraAccount)(!(objectclass=zimbraCalendarResource))(!(zimbraIsSystemResource=TRUE)))
ZLdapFilter zLdapFilter = filterDactory.allNonSystemAccounts();
String zFilter = zLdapFilter.toFilterString();
// (&(&(objectclass=zimbraAccount)(!(objectclass=zimbraCalendarResource)))(!(zimbraIsSystemResource=TRUE)))
// assertEquals(filter, zFilter); the diff is OK
verifyStatString(FilterId.ALL_NON_SYSTEM_ACCOUNTS, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method fromFilterString.
@Test
public void fromFilterString() throws Exception {
String FILTER_STR = "(blah=123)";
ZLdapFilter zLdapFilter = filterDactory.fromFilterString(FilterId.AUTO_PROVISION_SEARCH, FILTER_STR);
verify(FilterId.AUTO_PROVISION_SEARCH, FILTER_STR, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method allMimeEntries.
@Test
public void allMimeEntries() throws Exception {
String filter = LegacyLdapFilter.allMimeEntries();
ZLdapFilter zLdapFilter = filterDactory.allMimeEntries();
verify(FilterId.ALL_MIME_ENTRIES, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method allAliases.
@Test
public void allAliases() throws Exception {
String filter = LegacyLdapFilter.allAliases();
ZLdapFilter zLdapFilter = filterDactory.allAliases();
verify(FilterId.ALL_ALIASES, filter, zLdapFilter);
}
Aggregations