Search in sources :

Example 36 with ZLdapFilter

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

the class TestLdapZLdapFilter method dynamicGroupById.

@Test
public void dynamicGroupById() throws Exception {
    String ID = genUUID();
    String filter = LegacyLdapFilter.dynamicGroupById(ID);
    ZLdapFilter zLdapFilter = filterDactory.dynamicGroupById(ID);
    verify(FilterId.DYNAMIC_GROUP_BY_ID, filter, zLdapFilter);
}
Also used : ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter)

Example 37 with ZLdapFilter

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

the class TestLdapZLdapFilter method CMBSearchAccountsOnly.

@Test
public void CMBSearchAccountsOnly() throws Exception {
    /*
        orig filter before refactoring
        String legacyFilter =
            "(&(|(!(zimbraExcludeFromCMBSearch=*))(zimbraExcludeFromCMBSearch=FALSE))(&(objectClass=zimbraAccount)(!(objectClass=zimbraCalendarResource))))";
        */
    // moved objectClass to the front
    String legacyFilter = "(&(&(objectClass=zimbraAccount)(!(objectClass=zimbraCalendarResource)))(|(!(zimbraExcludeFromCMBSearch=*))(zimbraExcludeFromCMBSearch=FALSE)))";
    String filter = LegacyLdapFilter.CMBSearchAccountsOnly();
    ZLdapFilter zLdapFilter = filterDactory.CMBSearchAccountsOnly();
    assertEquals(legacyFilter, filter);
    verify(FilterId.CMB_SEARCH_ACCOUNTS_ONLY, filter, zLdapFilter);
}
Also used : ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter)

Example 38 with ZLdapFilter

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

the class TestLdapZLdapFilter method calendarResourceByForeignPrincipal.

@Test
public void calendarResourceByForeignPrincipal() throws Exception {
    String FOREIGN_PRINCIPAL = getTestName();
    String filter = LegacyLdapFilter.calendarResourceByForeignPrincipal(FOREIGN_PRINCIPAL);
    ZLdapFilter zLdapFilter = filterDactory.calendarResourceByForeignPrincipal(FOREIGN_PRINCIPAL);
    verify(FilterId.CALENDAR_RESOURCE_BY_FOREIGN_PRINCIPAL, filter, zLdapFilter);
}
Also used : ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter)

Example 39 with ZLdapFilter

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

the class TestLdapZLdapFilter method accountById.

@Test
public void accountById() throws Exception {
    String ID = genUUID();
    String filter = LegacyLdapFilter.accountById(ID);
    ZLdapFilter zLdapFilter = filterDactory.accountById(ID);
    verify(FilterId.ACCOUNT_BY_ID, filter, zLdapFilter);
}
Also used : ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter)

Example 40 with ZLdapFilter

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

the class TestLdapZLdapFilter method signatureById.

@Test
public void signatureById() throws Exception {
    String ID = genUUID();
    String filter = LegacyLdapFilter.signatureById(ID);
    ZLdapFilter zLdapFilter = filterDactory.signatureById(ID);
    verify(FilterId.SIGNATURE_BY_ID, filter, zLdapFilter);
}
Also used : ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter)

Aggregations

ZLdapFilter (com.zimbra.cs.ldap.ZLdapFilter)121 ZSearchResultEntry (com.zimbra.cs.ldap.ZSearchResultEntry)15 ZSearchResultEnumeration (com.zimbra.cs.ldap.ZSearchResultEnumeration)11 ZLdapContext (com.zimbra.cs.ldap.ZLdapContext)8 ZSearchControls (com.zimbra.cs.ldap.ZSearchControls)8 ArrayList (java.util.ArrayList)8 ServiceException (com.zimbra.common.service.ServiceException)7 Server (com.zimbra.cs.account.Server)7 LdapDIT (com.zimbra.cs.account.ldap.LdapDIT)7 Account (com.zimbra.cs.account.Account)6 AccountServiceException (com.zimbra.cs.account.AccountServiceException)6 AuthFailedServiceException (com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException)6 LdapSizeLimitExceededException (com.zimbra.cs.ldap.LdapException.LdapSizeLimitExceededException)6 NamedEntry (com.zimbra.cs.account.NamedEntry)5 SearchAccountsOptions (com.zimbra.cs.account.SearchAccountsOptions)5 BySearchResultEntrySearcher (com.zimbra.cs.account.ldap.BySearchResultEntrySearcher)5 SearchLdapOptions (com.zimbra.cs.ldap.SearchLdapOptions)5 ProvTest (com.zimbra.qa.unittest.prov.ProvTest)5 LDAPException (com.unboundid.ldap.sdk.LDAPException)3 SearchRequest (com.unboundid.ldap.sdk.SearchRequest)3