Search in sources :

Example 1 with SortBySeniorityIndexThenName

use of com.zimbra.cs.service.util.SortBySeniorityIndexThenName in project zm-mailbox by Zimbra.

the class LdapProvisioning method getHABDynamicGroupMemberDetails.

/**
 * get members of dynamic group and member details
 * @param group
 * @return
 */
public List<HABGroupMember> getHABDynamicGroupMemberDetails(Group group) {
    final List<HABGroupMember> members = Lists.newArrayList();
    ZLdapContext zlc = null;
    try {
        zlc = LdapClient.getContext(LdapServerType.REPLICA, LdapUsage.GET_GROUP_MEMBER);
        String[] memberDNs = group.getMultiAttr(Provisioning.A_member);
        String[] memberAttrMap = getConfig().getMultiAttr(Provisioning.A_zimbraHABMemberLdapAttrMap);
        Map<String, String> habMemberAttrMap = Arrays.stream(memberAttrMap).collect(Collectors.toMap(e -> e.split("=")[0], e -> e.split("=")[1]));
        List<String> ldapAttrList = new ArrayList<String>(habMemberAttrMap.values());
        ldapAttrList.add(Provisioning.A_objectClass);
        ldapAttrList.add(Provisioning.A_mail);
        ldapAttrList.add(Provisioning.A_zimbraMailDeliveryAddress);
        ldapAttrList.add(Provisioning.A_zimbraHABSeniorityIndex);
        final String[] attrsToGet = ldapAttrList.toArray(new String[] {});
        for (String memberDN : memberDNs) {
            ZAttributes memberAttrs = zlc.getAttributes(memberDN, attrsToGet);
            boolean isHABGroup = memberAttrs.hasAttributeValue(Provisioning.A_objectClass, AttributeClass.OC_zimbraHabGroup);
            if (!isHABGroup) {
                HABGroupMember habMember = new HABGroupMember(memberAttrs.getAttrString(Provisioning.A_mail));
                for (String key : habMemberAttrMap.keySet()) {
                    if (Provisioning.A_zimbraMailAlias.equals(habMemberAttrMap.get(key))) {
                        String[] aliases = memberAttrs.getMultiAttrString(habMemberAttrMap.get(key));
                        for (String alias : aliases) {
                            habMember.addAttr(new NamedValue(key, alias));
                        }
                    } else {
                        String val = memberAttrs.getAttrString(habMemberAttrMap.get(key));
                        if (StringUtils.isNotEmpty(val)) {
                            habMember.addAttr(new NamedValue(key, val));
                        }
                    }
                }
                String seniorityIndex = memberAttrs.getAttrString(Provisioning.A_zimbraHABSeniorityIndex);
                if (seniorityIndex == null) {
                    seniorityIndex = "0";
                }
                habMember.setSeniorityIndex(Integer.parseInt(seniorityIndex));
                members.add(habMember);
            }
        }
        Collections.sort(members, new SortBySeniorityIndexThenName());
    } catch (ServiceException e) {
        ZimbraLog.account.debug("unable to get hab dynamic group members", e);
    } finally {
        LdapClient.closeContext(zlc);
    }
    return members;
}
Also used : LdapCos(com.zimbra.cs.account.ldap.entry.LdapCos) StringUtils(org.apache.commons.lang.StringUtils) PermissionCache(com.zimbra.cs.account.accesscontrol.PermissionCache) AccountUtil(com.zimbra.cs.util.AccountUtil) LdapGlobalGrant(com.zimbra.cs.account.ldap.entry.LdapGlobalGrant) LdapShareLocator(com.zimbra.cs.account.ldap.entry.LdapShareLocator) EntryCacheDataKey(com.zimbra.cs.account.EntryCacheDataKey) SetUtil(com.zimbra.common.util.SetUtil) TODO(com.zimbra.cs.ldap.LdapTODO.TODO) Map(java.util.Map) LdapUtil(com.zimbra.cs.ldap.LdapUtil) LdapAlwaysOnCluster(com.zimbra.cs.account.ldap.entry.LdapAlwaysOnCluster) ZMutableEntry(com.zimbra.cs.ldap.ZMutableEntry) IDNUtil(com.zimbra.cs.account.IDNUtil) AttributeMigration(com.zimbra.cs.ephemeral.migrate.AttributeMigration) Signature(com.zimbra.cs.account.Signature) TargetType(com.zimbra.cs.account.accesscontrol.TargetType) ZimbraLog(com.zimbra.common.util.ZimbraLog) MailTarget(com.zimbra.cs.account.MailTarget) IAccountCache(com.zimbra.cs.account.cache.IAccountCache) StringUtil(com.zimbra.common.util.StringUtil) Folder(com.zimbra.cs.mailbox.Folder) Key(com.zimbra.common.account.Key) LdapUCService(com.zimbra.cs.account.ldap.entry.LdapUCService) AccountServiceException(com.zimbra.cs.account.AccountServiceException) EphemeralLocation(com.zimbra.cs.ephemeral.EphemeralLocation) MimeTypeInfo(com.zimbra.cs.mime.MimeTypeInfo) SearchDirectoryOptions(com.zimbra.cs.account.SearchDirectoryOptions) Strings(com.google.common.base.Strings) Constants(com.zimbra.common.util.Constants) Lists(com.google.common.collect.Lists) ZimletException(com.zimbra.cs.zimlet.ZimletException) Group(com.zimbra.cs.account.Group) LdapAlias(com.zimbra.cs.account.ldap.entry.LdapAlias) LdapEntryNotFoundException(com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException) GetFromDomainCacheOption(com.zimbra.cs.account.cache.DomainCache.GetFromDomainCacheOption) IOException(java.io.IOException) ZSearchControls(com.zimbra.cs.ldap.ZSearchControls) LdapDateUtil(com.zimbra.cs.ldap.LdapDateUtil) LdapInvalidSearchFilterException(com.zimbra.cs.ldap.LdapException.LdapInvalidSearchFilterException) TreeMap(java.util.TreeMap) StopIteratingException(com.zimbra.cs.ldap.SearchLdapOptions.StopIteratingException) RightModifier(com.zimbra.cs.account.accesscontrol.RightModifier) AttributeConverter(com.zimbra.cs.ephemeral.migrate.AttributeConverter) Account(com.zimbra.cs.account.Account) GranteeType(com.zimbra.cs.account.accesscontrol.GranteeType) IAttributes(com.zimbra.cs.ldap.IAttributes) Config(com.zimbra.cs.account.Config) Date(java.util.Date) Random(java.util.Random) Cos(com.zimbra.cs.account.Cos) GalSyncToken(com.zimbra.cs.gal.GalSyncToken) Zimlet(com.zimbra.cs.account.Zimlet) NamedEntry(com.zimbra.cs.account.NamedEntry) GalUtil(com.zimbra.cs.account.gal.GalUtil) ZimletUtil(com.zimbra.cs.zimlet.ZimletUtil) EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey) DataSourceManager(com.zimbra.cs.datasource.DataSourceManager) INamedEntryCache(com.zimbra.cs.account.cache.INamedEntryCache) Element(com.zimbra.common.soap.Element) Argument(com.zimbra.common.service.ServiceException.Argument) LogFactory(com.zimbra.common.util.LogFactory) LdapIdentity(com.zimbra.cs.account.ldap.entry.LdapIdentity) LdapInvalidAttrValueException(com.zimbra.cs.ldap.LdapException.LdapInvalidAttrValueException) Collection(java.util.Collection) ZLdapFilterFactory(com.zimbra.cs.ldap.ZLdapFilterFactory) Mailbox(com.zimbra.cs.mailbox.Mailbox) Collectors(java.util.stream.Collectors) LC(com.zimbra.common.localconfig.LC) PostCreateAccountListener(com.zimbra.cs.account.ProvisioningExt.PostCreateAccountListener) DataKey(com.zimbra.cs.account.callback.CallbackContext.DataKey) GalSearchType(com.zimbra.soap.type.GalSearchType) Pair(com.zimbra.common.util.Pair) InMemoryLdapServer(com.zimbra.cs.ldap.unboundid.InMemoryLdapServer) LdapMimeType(com.zimbra.cs.account.ldap.entry.LdapMimeType) ShareLocator(com.zimbra.cs.account.ShareLocator) GalSearchControl(com.zimbra.cs.gal.GalSearchControl) AttributeManager(com.zimbra.cs.account.AttributeManager) GuestAccount(com.zimbra.cs.account.GuestAccount) ObjectType(com.zimbra.cs.account.SearchDirectoryOptions.ObjectType) EphemeralInput(com.zimbra.cs.ephemeral.EphemeralInput) AdminConstants(com.zimbra.common.soap.AdminConstants) GalSearchResultCallback(com.zimbra.cs.gal.GalSearchResultCallback) GalParams(com.zimbra.cs.account.gal.GalParams) AddressListInfo(com.zimbra.soap.account.type.AddressListInfo) LdapSignature(com.zimbra.cs.account.ldap.entry.LdapSignature) EffectiveRights(com.zimbra.cs.account.accesscontrol.RightCommand.EffectiveRights) Hex(org.apache.commons.codec.binary.Hex) Stack(java.util.Stack) NamedValue(com.zimbra.soap.type.NamedValue) HashSet(java.util.HashSet) FilterId(com.zimbra.cs.ldap.ZLdapFilterFactory.FilterId) LdapDistributionList(com.zimbra.cs.account.ldap.entry.LdapDistributionList) LdapContextNotEmptyException(com.zimbra.cs.ldap.LdapException.LdapContextNotEmptyException) LdapConfig(com.zimbra.cs.account.ldap.entry.LdapConfig) GroupedEntry(com.zimbra.cs.account.GroupedEntry) CallbackContext(com.zimbra.cs.account.callback.CallbackContext) CountObjectsType(com.zimbra.soap.admin.type.CountObjectsType) IncludeType(com.zimbra.cs.account.SearchAccountsOptions.IncludeType) ZAttributes(com.zimbra.cs.ldap.ZAttributes) LdapConstants(com.zimbra.cs.ldap.LdapConstants) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) EphemeralStore(com.zimbra.cs.ephemeral.EphemeralStore) DomainCache(com.zimbra.cs.account.cache.DomainCache) MailboxManager(com.zimbra.cs.mailbox.MailboxManager) ProvisioningExt(com.zimbra.cs.account.ProvisioningExt) LdapAccount(com.zimbra.cs.account.ldap.entry.LdapAccount) TargetBy(com.zimbra.soap.type.TargetBy) CodeConstants(com.zimbra.common.account.ForgetPasswordEnums.CodeConstants) GlobalGrant(com.zimbra.cs.account.GlobalGrant) ZSearchScope(com.zimbra.cs.ldap.ZSearchScope) AliasedEntry(com.zimbra.cs.account.AliasedEntry) LdapZimlet(com.zimbra.cs.account.ldap.entry.LdapZimlet) AccessManager(com.zimbra.cs.account.AccessManager) ResetPasswordUtil(com.zimbra.cs.service.util.ResetPasswordUtil) Comparator(java.util.Comparator) LdapEntry(com.zimbra.cs.account.ldap.entry.LdapEntry) IDomainCache(com.zimbra.cs.account.cache.IDomainCache) Arrays(java.util.Arrays) LdapCalendarResource(com.zimbra.cs.account.ldap.entry.LdapCalendarResource) PreAuthKey(com.zimbra.cs.account.PreAuthKey) HABGroupMember(com.zimbra.soap.account.type.HABGroupMember) SecureRandom(java.security.SecureRandom) DistributionListBy(com.zimbra.common.account.Key.DistributionListBy) ZSearchResultEnumeration(com.zimbra.cs.ldap.ZSearchResultEnumeration) IMimeTypeCache(com.zimbra.cs.account.cache.IMimeTypeCache) LdapEntryAlreadyExistException(com.zimbra.cs.ldap.LdapException.LdapEntryAlreadyExistException) DynamicGroup(com.zimbra.cs.account.DynamicGroup) AuthMech(com.zimbra.cs.account.auth.AuthMechanism.AuthMech) PrintWriter(java.io.PrintWriter) LdapDomain(com.zimbra.cs.account.ldap.entry.LdapDomain) AuthContext(com.zimbra.cs.account.auth.AuthContext) LdapEntryLocation(com.zimbra.cs.ephemeral.LdapEntryLocation) Set(java.util.Set) GalContact(com.zimbra.cs.account.GalContact) DataSourceType(com.zimbra.soap.admin.type.DataSourceType) SearchLdapVisitor(com.zimbra.cs.ldap.SearchLdapOptions.SearchLdapVisitor) DataSource(com.zimbra.cs.account.DataSource) LdapServerType(com.zimbra.cs.ldap.LdapServerType) ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter) ZLdapSchema(com.zimbra.cs.ldap.ZLdapSchema) UCService(com.zimbra.cs.account.UCService) SortBySeniorityIndexThenName(com.zimbra.cs.service.util.SortBySeniorityIndexThenName) SearchLdapOptions(com.zimbra.cs.ldap.SearchLdapOptions) ServiceException(com.zimbra.common.service.ServiceException) AttributeInfo(com.zimbra.cs.account.AttributeInfo) TreeSet(java.util.TreeSet) CheckBinary(com.zimbra.cs.ldap.IAttributes.CheckBinary) ZSearchResultEntry(com.zimbra.cs.ldap.ZSearchResultEntry) ArrayList(java.util.ArrayList) PasswordUtil(com.zimbra.cs.account.auth.PasswordUtil) Krb5Principal(com.zimbra.cs.account.krb5.Krb5Principal) Right(com.zimbra.cs.account.accesscontrol.Right) UCServiceBy(com.zimbra.common.account.Key.UCServiceBy) Domain(com.zimbra.cs.account.Domain) EmailUtil(com.zimbra.common.util.EmailUtil) SystemUtil(com.zimbra.common.util.SystemUtil) LdapException(com.zimbra.cs.ldap.LdapException) LdapMultipleEntriesMatchedException(com.zimbra.cs.ldap.LdapException.LdapMultipleEntriesMatchedException) ExternalLdapConfig(com.zimbra.cs.ldap.LdapServerConfig.ExternalLdapConfig) AlwaysOnCluster(com.zimbra.cs.account.AlwaysOnCluster) GranteeBy(com.zimbra.soap.admin.type.GranteeSelector.GranteeBy) MakeObjectOpt(com.zimbra.cs.account.SearchDirectoryOptions.MakeObjectOpt) GalSearchConfig(com.zimbra.cs.gal.GalSearchConfig) Zimbra(com.zimbra.cs.util.Zimbra) ProvisioningConstants(com.zimbra.common.account.ProvisioningConstants) GalNamedFilter(com.zimbra.cs.account.gal.GalNamedFilter) Identity(com.zimbra.cs.account.Identity) SearchAccountsOptions(com.zimbra.cs.account.SearchAccountsOptions) CacheEntryType(com.zimbra.soap.admin.type.CacheEntryType) CacheAwareProvisioning(com.zimbra.cs.account.CacheAwareProvisioning) Provisioning(com.zimbra.cs.account.Provisioning) LdapServer(com.zimbra.cs.account.ldap.entry.LdapServer) LdapEphemeralStore(com.zimbra.cs.ephemeral.LdapEphemeralStore) PatternSyntaxException(java.util.regex.PatternSyntaxException) XMPPComponent(com.zimbra.cs.account.XMPPComponent) LdapXMPPComponent(com.zimbra.cs.account.ldap.entry.LdapXMPPComponent) LdapSizeLimitExceededException(com.zimbra.cs.ldap.LdapException.LdapSizeLimitExceededException) LdapInvalidAttrNameException(com.zimbra.cs.ldap.LdapException.LdapInvalidAttrNameException) Sets(com.google.common.collect.Sets) AutoProvPrincipalBy(com.zimbra.soap.type.AutoProvPrincipalBy) List(java.util.List) Log(com.zimbra.common.util.Log) LdapUsage(com.zimbra.cs.ldap.LdapUsage) LdapDynamicGroup(com.zimbra.cs.account.ldap.entry.LdapDynamicGroup) NameUtil(com.zimbra.cs.account.names.NameUtil) AccountBy(com.zimbra.common.account.Key.AccountBy) Entry(com.zimbra.cs.account.Entry) Pattern(java.util.regex.Pattern) EmailAddress(com.zimbra.cs.account.names.NameUtil.EmailAddress) SortOpt(com.zimbra.cs.account.SearchDirectoryOptions.SortOpt) GalSearchParams(com.zimbra.cs.gal.GalSearchParams) AuthMechanism(com.zimbra.cs.account.auth.AuthMechanism) HashMap(java.util.HashMap) LdapClient(com.zimbra.cs.ldap.LdapClient) Server(com.zimbra.cs.account.Server) CalendarResource(com.zimbra.cs.account.CalendarResource) RightCommand(com.zimbra.cs.account.accesscontrol.RightCommand) AddressList(com.zimbra.cs.account.AddressList) Alias(com.zimbra.cs.account.Alias) Iterator(java.util.Iterator) DistributionList(com.zimbra.cs.account.DistributionList) ZLdapContext(com.zimbra.cs.ldap.ZLdapContext) GalOp(com.zimbra.cs.account.gal.GalOp) Maps(com.google.common.collect.Maps) LdapDataSource(com.zimbra.cs.account.ldap.entry.LdapDataSource) L10nUtil(com.zimbra.common.util.L10nUtil) AttributeClass(com.zimbra.cs.account.AttributeClass) Collections(java.util.Collections) JWEUtil(com.zimbra.cs.service.util.JWEUtil) ZLdapContext(com.zimbra.cs.ldap.ZLdapContext) SortBySeniorityIndexThenName(com.zimbra.cs.service.util.SortBySeniorityIndexThenName) ArrayList(java.util.ArrayList) NamedValue(com.zimbra.soap.type.NamedValue) AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) ZAttributes(com.zimbra.cs.ldap.ZAttributes) HABGroupMember(com.zimbra.soap.account.type.HABGroupMember)

Example 2 with SortBySeniorityIndexThenName

use of com.zimbra.cs.service.util.SortBySeniorityIndexThenName in project zm-mailbox by Zimbra.

the class LdapProvisioning method getHABGroupMemberDetails.

/**
 * get members of static group and member details
 * @param group
 * @return
 */
public List<HABGroupMember> getHABGroupMemberDetails(Group group) {
    final List<HABGroupMember> members = Lists.newArrayList();
    ZLdapContext zlc = null;
    try {
        zlc = LdapClient.getContext(LdapServerType.REPLICA, LdapUsage.GET_GROUP_MEMBER);
        String[] memberEmails = null;
        DistributionList dl = get(DistributionListBy.id, group.getId());
        memberEmails = dl.getMultiAttr(Provisioning.A_zimbraMailForwardingAddress);
        String[] memberAttrMap = getConfig().getMultiAttr(Provisioning.A_zimbraHABMemberLdapAttrMap);
        Map<String, String> habMemberAttrMap = Arrays.stream(memberAttrMap).collect(Collectors.toMap(e -> e.split("=")[0], e -> e.split("=")[1]));
        for (String memberEmail : memberEmails) {
            Account memberAcc = null;
            try {
                memberAcc = get(AccountBy.name, memberEmail);
            } catch (ServiceException e) {
                ZimbraLog.account.debug("not a direct member of hab group %s", memberEmail, e);
            }
            if (memberAcc != null) {
                HABGroupMember habMember = new HABGroupMember(memberEmail);
                for (String key : habMemberAttrMap.keySet()) {
                    if (Provisioning.A_zimbraMailAlias.equals(habMemberAttrMap.get(key))) {
                        String[] aliases = memberAcc.getAliases();
                        for (String alias : aliases) {
                            habMember.addAttr(new NamedValue(key, alias));
                        }
                    } else {
                        String val = memberAcc.getAttr(habMemberAttrMap.get(key));
                        if (StringUtils.isNotEmpty(val)) {
                            habMember.addAttr(new NamedValue(key, val));
                        }
                    }
                }
                int seniorityIndex = memberAcc.getHABSeniorityIndex();
                if (seniorityIndex == -1) {
                    seniorityIndex = 0;
                }
                habMember.setSeniorityIndex(seniorityIndex);
                members.add(habMember);
            }
        }
        Collections.sort(members, new SortBySeniorityIndexThenName());
    } catch (ServiceException e) {
        ZimbraLog.account.debug("unable to get hab group members", e);
    } finally {
        LdapClient.closeContext(zlc);
    }
    return members;
}
Also used : LdapCos(com.zimbra.cs.account.ldap.entry.LdapCos) StringUtils(org.apache.commons.lang.StringUtils) PermissionCache(com.zimbra.cs.account.accesscontrol.PermissionCache) AccountUtil(com.zimbra.cs.util.AccountUtil) LdapGlobalGrant(com.zimbra.cs.account.ldap.entry.LdapGlobalGrant) LdapShareLocator(com.zimbra.cs.account.ldap.entry.LdapShareLocator) EntryCacheDataKey(com.zimbra.cs.account.EntryCacheDataKey) SetUtil(com.zimbra.common.util.SetUtil) TODO(com.zimbra.cs.ldap.LdapTODO.TODO) Map(java.util.Map) LdapUtil(com.zimbra.cs.ldap.LdapUtil) LdapAlwaysOnCluster(com.zimbra.cs.account.ldap.entry.LdapAlwaysOnCluster) ZMutableEntry(com.zimbra.cs.ldap.ZMutableEntry) IDNUtil(com.zimbra.cs.account.IDNUtil) AttributeMigration(com.zimbra.cs.ephemeral.migrate.AttributeMigration) Signature(com.zimbra.cs.account.Signature) TargetType(com.zimbra.cs.account.accesscontrol.TargetType) ZimbraLog(com.zimbra.common.util.ZimbraLog) MailTarget(com.zimbra.cs.account.MailTarget) IAccountCache(com.zimbra.cs.account.cache.IAccountCache) StringUtil(com.zimbra.common.util.StringUtil) Folder(com.zimbra.cs.mailbox.Folder) Key(com.zimbra.common.account.Key) LdapUCService(com.zimbra.cs.account.ldap.entry.LdapUCService) AccountServiceException(com.zimbra.cs.account.AccountServiceException) EphemeralLocation(com.zimbra.cs.ephemeral.EphemeralLocation) MimeTypeInfo(com.zimbra.cs.mime.MimeTypeInfo) SearchDirectoryOptions(com.zimbra.cs.account.SearchDirectoryOptions) Strings(com.google.common.base.Strings) Constants(com.zimbra.common.util.Constants) Lists(com.google.common.collect.Lists) ZimletException(com.zimbra.cs.zimlet.ZimletException) Group(com.zimbra.cs.account.Group) LdapAlias(com.zimbra.cs.account.ldap.entry.LdapAlias) LdapEntryNotFoundException(com.zimbra.cs.ldap.LdapException.LdapEntryNotFoundException) GetFromDomainCacheOption(com.zimbra.cs.account.cache.DomainCache.GetFromDomainCacheOption) IOException(java.io.IOException) ZSearchControls(com.zimbra.cs.ldap.ZSearchControls) LdapDateUtil(com.zimbra.cs.ldap.LdapDateUtil) LdapInvalidSearchFilterException(com.zimbra.cs.ldap.LdapException.LdapInvalidSearchFilterException) TreeMap(java.util.TreeMap) StopIteratingException(com.zimbra.cs.ldap.SearchLdapOptions.StopIteratingException) RightModifier(com.zimbra.cs.account.accesscontrol.RightModifier) AttributeConverter(com.zimbra.cs.ephemeral.migrate.AttributeConverter) Account(com.zimbra.cs.account.Account) GranteeType(com.zimbra.cs.account.accesscontrol.GranteeType) IAttributes(com.zimbra.cs.ldap.IAttributes) Config(com.zimbra.cs.account.Config) Date(java.util.Date) Random(java.util.Random) Cos(com.zimbra.cs.account.Cos) GalSyncToken(com.zimbra.cs.gal.GalSyncToken) Zimlet(com.zimbra.cs.account.Zimlet) NamedEntry(com.zimbra.cs.account.NamedEntry) GalUtil(com.zimbra.cs.account.gal.GalUtil) ZimletUtil(com.zimbra.cs.zimlet.ZimletUtil) EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey) DataSourceManager(com.zimbra.cs.datasource.DataSourceManager) INamedEntryCache(com.zimbra.cs.account.cache.INamedEntryCache) Element(com.zimbra.common.soap.Element) Argument(com.zimbra.common.service.ServiceException.Argument) LogFactory(com.zimbra.common.util.LogFactory) LdapIdentity(com.zimbra.cs.account.ldap.entry.LdapIdentity) LdapInvalidAttrValueException(com.zimbra.cs.ldap.LdapException.LdapInvalidAttrValueException) Collection(java.util.Collection) ZLdapFilterFactory(com.zimbra.cs.ldap.ZLdapFilterFactory) Mailbox(com.zimbra.cs.mailbox.Mailbox) Collectors(java.util.stream.Collectors) LC(com.zimbra.common.localconfig.LC) PostCreateAccountListener(com.zimbra.cs.account.ProvisioningExt.PostCreateAccountListener) DataKey(com.zimbra.cs.account.callback.CallbackContext.DataKey) GalSearchType(com.zimbra.soap.type.GalSearchType) Pair(com.zimbra.common.util.Pair) InMemoryLdapServer(com.zimbra.cs.ldap.unboundid.InMemoryLdapServer) LdapMimeType(com.zimbra.cs.account.ldap.entry.LdapMimeType) ShareLocator(com.zimbra.cs.account.ShareLocator) GalSearchControl(com.zimbra.cs.gal.GalSearchControl) AttributeManager(com.zimbra.cs.account.AttributeManager) GuestAccount(com.zimbra.cs.account.GuestAccount) ObjectType(com.zimbra.cs.account.SearchDirectoryOptions.ObjectType) EphemeralInput(com.zimbra.cs.ephemeral.EphemeralInput) AdminConstants(com.zimbra.common.soap.AdminConstants) GalSearchResultCallback(com.zimbra.cs.gal.GalSearchResultCallback) GalParams(com.zimbra.cs.account.gal.GalParams) AddressListInfo(com.zimbra.soap.account.type.AddressListInfo) LdapSignature(com.zimbra.cs.account.ldap.entry.LdapSignature) EffectiveRights(com.zimbra.cs.account.accesscontrol.RightCommand.EffectiveRights) Hex(org.apache.commons.codec.binary.Hex) Stack(java.util.Stack) NamedValue(com.zimbra.soap.type.NamedValue) HashSet(java.util.HashSet) FilterId(com.zimbra.cs.ldap.ZLdapFilterFactory.FilterId) LdapDistributionList(com.zimbra.cs.account.ldap.entry.LdapDistributionList) LdapContextNotEmptyException(com.zimbra.cs.ldap.LdapException.LdapContextNotEmptyException) LdapConfig(com.zimbra.cs.account.ldap.entry.LdapConfig) GroupedEntry(com.zimbra.cs.account.GroupedEntry) CallbackContext(com.zimbra.cs.account.callback.CallbackContext) CountObjectsType(com.zimbra.soap.admin.type.CountObjectsType) IncludeType(com.zimbra.cs.account.SearchAccountsOptions.IncludeType) ZAttributes(com.zimbra.cs.ldap.ZAttributes) LdapConstants(com.zimbra.cs.ldap.LdapConstants) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) EphemeralStore(com.zimbra.cs.ephemeral.EphemeralStore) DomainCache(com.zimbra.cs.account.cache.DomainCache) MailboxManager(com.zimbra.cs.mailbox.MailboxManager) ProvisioningExt(com.zimbra.cs.account.ProvisioningExt) LdapAccount(com.zimbra.cs.account.ldap.entry.LdapAccount) TargetBy(com.zimbra.soap.type.TargetBy) CodeConstants(com.zimbra.common.account.ForgetPasswordEnums.CodeConstants) GlobalGrant(com.zimbra.cs.account.GlobalGrant) ZSearchScope(com.zimbra.cs.ldap.ZSearchScope) AliasedEntry(com.zimbra.cs.account.AliasedEntry) LdapZimlet(com.zimbra.cs.account.ldap.entry.LdapZimlet) AccessManager(com.zimbra.cs.account.AccessManager) ResetPasswordUtil(com.zimbra.cs.service.util.ResetPasswordUtil) Comparator(java.util.Comparator) LdapEntry(com.zimbra.cs.account.ldap.entry.LdapEntry) IDomainCache(com.zimbra.cs.account.cache.IDomainCache) Arrays(java.util.Arrays) LdapCalendarResource(com.zimbra.cs.account.ldap.entry.LdapCalendarResource) PreAuthKey(com.zimbra.cs.account.PreAuthKey) HABGroupMember(com.zimbra.soap.account.type.HABGroupMember) SecureRandom(java.security.SecureRandom) DistributionListBy(com.zimbra.common.account.Key.DistributionListBy) ZSearchResultEnumeration(com.zimbra.cs.ldap.ZSearchResultEnumeration) IMimeTypeCache(com.zimbra.cs.account.cache.IMimeTypeCache) LdapEntryAlreadyExistException(com.zimbra.cs.ldap.LdapException.LdapEntryAlreadyExistException) DynamicGroup(com.zimbra.cs.account.DynamicGroup) AuthMech(com.zimbra.cs.account.auth.AuthMechanism.AuthMech) PrintWriter(java.io.PrintWriter) LdapDomain(com.zimbra.cs.account.ldap.entry.LdapDomain) AuthContext(com.zimbra.cs.account.auth.AuthContext) LdapEntryLocation(com.zimbra.cs.ephemeral.LdapEntryLocation) Set(java.util.Set) GalContact(com.zimbra.cs.account.GalContact) DataSourceType(com.zimbra.soap.admin.type.DataSourceType) SearchLdapVisitor(com.zimbra.cs.ldap.SearchLdapOptions.SearchLdapVisitor) DataSource(com.zimbra.cs.account.DataSource) LdapServerType(com.zimbra.cs.ldap.LdapServerType) ZLdapFilter(com.zimbra.cs.ldap.ZLdapFilter) ZLdapSchema(com.zimbra.cs.ldap.ZLdapSchema) UCService(com.zimbra.cs.account.UCService) SortBySeniorityIndexThenName(com.zimbra.cs.service.util.SortBySeniorityIndexThenName) SearchLdapOptions(com.zimbra.cs.ldap.SearchLdapOptions) ServiceException(com.zimbra.common.service.ServiceException) AttributeInfo(com.zimbra.cs.account.AttributeInfo) TreeSet(java.util.TreeSet) CheckBinary(com.zimbra.cs.ldap.IAttributes.CheckBinary) ZSearchResultEntry(com.zimbra.cs.ldap.ZSearchResultEntry) ArrayList(java.util.ArrayList) PasswordUtil(com.zimbra.cs.account.auth.PasswordUtil) Krb5Principal(com.zimbra.cs.account.krb5.Krb5Principal) Right(com.zimbra.cs.account.accesscontrol.Right) UCServiceBy(com.zimbra.common.account.Key.UCServiceBy) Domain(com.zimbra.cs.account.Domain) EmailUtil(com.zimbra.common.util.EmailUtil) SystemUtil(com.zimbra.common.util.SystemUtil) LdapException(com.zimbra.cs.ldap.LdapException) LdapMultipleEntriesMatchedException(com.zimbra.cs.ldap.LdapException.LdapMultipleEntriesMatchedException) ExternalLdapConfig(com.zimbra.cs.ldap.LdapServerConfig.ExternalLdapConfig) AlwaysOnCluster(com.zimbra.cs.account.AlwaysOnCluster) GranteeBy(com.zimbra.soap.admin.type.GranteeSelector.GranteeBy) MakeObjectOpt(com.zimbra.cs.account.SearchDirectoryOptions.MakeObjectOpt) GalSearchConfig(com.zimbra.cs.gal.GalSearchConfig) Zimbra(com.zimbra.cs.util.Zimbra) ProvisioningConstants(com.zimbra.common.account.ProvisioningConstants) GalNamedFilter(com.zimbra.cs.account.gal.GalNamedFilter) Identity(com.zimbra.cs.account.Identity) SearchAccountsOptions(com.zimbra.cs.account.SearchAccountsOptions) CacheEntryType(com.zimbra.soap.admin.type.CacheEntryType) CacheAwareProvisioning(com.zimbra.cs.account.CacheAwareProvisioning) Provisioning(com.zimbra.cs.account.Provisioning) LdapServer(com.zimbra.cs.account.ldap.entry.LdapServer) LdapEphemeralStore(com.zimbra.cs.ephemeral.LdapEphemeralStore) PatternSyntaxException(java.util.regex.PatternSyntaxException) XMPPComponent(com.zimbra.cs.account.XMPPComponent) LdapXMPPComponent(com.zimbra.cs.account.ldap.entry.LdapXMPPComponent) LdapSizeLimitExceededException(com.zimbra.cs.ldap.LdapException.LdapSizeLimitExceededException) LdapInvalidAttrNameException(com.zimbra.cs.ldap.LdapException.LdapInvalidAttrNameException) Sets(com.google.common.collect.Sets) AutoProvPrincipalBy(com.zimbra.soap.type.AutoProvPrincipalBy) List(java.util.List) Log(com.zimbra.common.util.Log) LdapUsage(com.zimbra.cs.ldap.LdapUsage) LdapDynamicGroup(com.zimbra.cs.account.ldap.entry.LdapDynamicGroup) NameUtil(com.zimbra.cs.account.names.NameUtil) AccountBy(com.zimbra.common.account.Key.AccountBy) Entry(com.zimbra.cs.account.Entry) Pattern(java.util.regex.Pattern) EmailAddress(com.zimbra.cs.account.names.NameUtil.EmailAddress) SortOpt(com.zimbra.cs.account.SearchDirectoryOptions.SortOpt) GalSearchParams(com.zimbra.cs.gal.GalSearchParams) AuthMechanism(com.zimbra.cs.account.auth.AuthMechanism) HashMap(java.util.HashMap) LdapClient(com.zimbra.cs.ldap.LdapClient) Server(com.zimbra.cs.account.Server) CalendarResource(com.zimbra.cs.account.CalendarResource) RightCommand(com.zimbra.cs.account.accesscontrol.RightCommand) AddressList(com.zimbra.cs.account.AddressList) Alias(com.zimbra.cs.account.Alias) Iterator(java.util.Iterator) DistributionList(com.zimbra.cs.account.DistributionList) ZLdapContext(com.zimbra.cs.ldap.ZLdapContext) GalOp(com.zimbra.cs.account.gal.GalOp) Maps(com.google.common.collect.Maps) LdapDataSource(com.zimbra.cs.account.ldap.entry.LdapDataSource) L10nUtil(com.zimbra.common.util.L10nUtil) AttributeClass(com.zimbra.cs.account.AttributeClass) Collections(java.util.Collections) JWEUtil(com.zimbra.cs.service.util.JWEUtil) Account(com.zimbra.cs.account.Account) GuestAccount(com.zimbra.cs.account.GuestAccount) LdapAccount(com.zimbra.cs.account.ldap.entry.LdapAccount) ZLdapContext(com.zimbra.cs.ldap.ZLdapContext) SortBySeniorityIndexThenName(com.zimbra.cs.service.util.SortBySeniorityIndexThenName) NamedValue(com.zimbra.soap.type.NamedValue) AccountServiceException(com.zimbra.cs.account.AccountServiceException) AuthFailedServiceException(com.zimbra.cs.account.AccountServiceException.AuthFailedServiceException) ServiceException(com.zimbra.common.service.ServiceException) HABGroupMember(com.zimbra.soap.account.type.HABGroupMember) LdapDistributionList(com.zimbra.cs.account.ldap.entry.LdapDistributionList) DistributionList(com.zimbra.cs.account.DistributionList)

Aggregations

Strings (com.google.common.base.Strings)2 Lists (com.google.common.collect.Lists)2 Maps (com.google.common.collect.Maps)2 Sets (com.google.common.collect.Sets)2 CodeConstants (com.zimbra.common.account.ForgetPasswordEnums.CodeConstants)2 Key (com.zimbra.common.account.Key)2 AccountBy (com.zimbra.common.account.Key.AccountBy)2 DistributionListBy (com.zimbra.common.account.Key.DistributionListBy)2 UCServiceBy (com.zimbra.common.account.Key.UCServiceBy)2 ProvisioningConstants (com.zimbra.common.account.ProvisioningConstants)2 LC (com.zimbra.common.localconfig.LC)2 ServiceException (com.zimbra.common.service.ServiceException)2 Argument (com.zimbra.common.service.ServiceException.Argument)2 AdminConstants (com.zimbra.common.soap.AdminConstants)2 Element (com.zimbra.common.soap.Element)2 Constants (com.zimbra.common.util.Constants)2 EmailUtil (com.zimbra.common.util.EmailUtil)2 L10nUtil (com.zimbra.common.util.L10nUtil)2 Log (com.zimbra.common.util.Log)2 LogFactory (com.zimbra.common.util.LogFactory)2