Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
==================== DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved. Copyright 2011-2013 Tirasa. All rights reserved. The contents of this file are subject to the terms of the Common Development and Distribution License("CDDL") (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at https://oss.oracle.com/licenses/CDDL See the License for the specific language governing permissions and limitations under the License. When distributing the Covered Code, include this CDDL Header Notice in each file and include the License file at https://oss.oracle.com/licenses/CDDL. If applicable, add the following below this CDDL Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" ====================
 
 package org.connid.bundles.ad;
 
 import java.util.List;
 import java.util.Map;
 
 public class ADConfiguration extends LdapConfiguration {
 
     private boolean ssl = true;
 
     private boolean retrieveDeletedUser = true;
 
     private boolean retrieveDeletedGroup = true;
 
     public static final String PROMPT_USER_FLAG = "pwdLastSet";
 
     public static final String PROMPT_USER_VALUE = "0";
 
     public static final String LOCK_OUT_FLAG = "lockoutTime";
 
     public static final String LOCK_OUT_DEFAULT_VALUE = "0";
 
     private List<Stringmemberships;
 
     private boolean trustAllCerts;
 
     private boolean loading = false;
 
     private boolean membershipsInOr = false;
 
     private boolean startSyncFromToday = true;
 
     private String defaultPeopleContainer;
 
     private String defaultGroupContainer;
 
     private SearchScope userSearchScope;
 
     private SearchScope groupSearchScope;
 
     private String groupSearchFilter;
 
     private String[] groupBaseContexts = {};
 
     private String groupMemberReferenceAttribute = "member";
 
     private String groupOwnerReferenceAttribute = "managedBy";
 
             .,
             CollectionUtil.newList("top""person""organizationalPerson""user"),
             false,
             CollectionUtil.newList("sAMAccountName""cn""member"),
             .);
 
             .,
             CollectionUtil.newList("top""group"),
             false,
             Collections.<String>emptyList());
 
     public ADConfiguration() {
         super();
 
         setUidAttribute("sAMAccountName");
         setSynchronizePasswords(false);
         setAccountUserNameAttributes("sAMAccountName");
         setObjectClassesToSynchronize(new String[]{"user"});
        setGroupMemberAttribute("member");
        setUsePagedResultControl(true);
        setBlockSize(100);
        setUseBlocks(true);
        setPasswordAttribute("unicodePwd");
        setPort(636);
         = new ArrayList<String>();
    }
    @Override
    @ConfigurationProperty(displayMessageKey = "ssl.display",
    helpMessageKey = "ssl.help", order = 1)
    public boolean isSsl() {
        return ;
    }
    @Override
    public void setSsl(final boolean ssl) {
        super.setSsl(ssl);
        this. = ssl;
    }
    @Override
        result.put(.getObjectClass(), );
        result.put(.getObjectClass(), );
        return result;
    }
    @ConfigurationProperty(displayMessageKey = "memberships.display",
    helpMessageKey = "memberships.help", order = 1)
    public String[] getMemberships() {
        return .toArray(new String[.size()]);
    }
    public void setMemberships(String... memberships) {
        this. = new ArrayList<String>();
        if (memberships != null) {
            for (String membership : memberships) {
                this..add(membership.trim());
            }
        }
    }
    @ConfigurationProperty(displayMessageKey = "retrieveDeletedUser.display",
    helpMessageKey = "retrieveDeletedUser.help", order = 2)
    public boolean isRetrieveDeletedUser() {
        return ;
    }
    public void setRetrieveDeletedUser(boolean retrieveDeletedUser) {
        this. = retrieveDeletedUser;
    }
    @ConfigurationProperty(displayMessageKey = "retrieveDeletedGroup.display",
    helpMessageKey = "retrieveDeletedGroup.help", order = 3)
    public boolean isRetrieveDeletedGroup() {
        return this.;
    }
    public void setRetrieveDeletedGroup(boolean retrieveDeletedGroup) {
        this. = retrieveDeletedGroup;
    }
    @ConfigurationProperty(displayMessageKey = "trustAllCerts.display",
    helpMessageKey = "trustAllCerts.help", order = 4)
    public boolean isTrustAllCerts() {
        return ;
    }
    public void setTrustAllCerts(final boolean trustAllCerts) {
        this. = trustAllCerts;
    }
    @ConfigurationProperty(displayMessageKey = "loading.display",
    helpMessageKey = "loading.help", order = 5)
    public boolean isLoading() {
        return ;
    }
    public void setLoading(boolean loading) {
        this. = loading;
    }
    public boolean isMembershipsInOr() {
        return ;
    }
    @ConfigurationProperty(displayMessageKey = "membershipsInOr.display",
    helpMessageKey = "membershipsInOr.help", order = 6)
    public void setMembershipsInOr(boolean membershipsInOr) {
        this. = membershipsInOr;
    }
    @ConfigurationProperty(order = 7, required = true,
    displayMessageKey = "baseContextsToSynchronize.display",
    helpMessageKey = "baseContextsToSynchronize.help")
    public String[] getBaseContextsToSynchronize() {
        return super.getBaseContextsToSynchronize();
    }
    @Override
    public void setBaseContextsToSynchronize(String... baseContextsToSynchronize) {
        super.setBaseContextsToSynchronize(baseContextsToSynchronize);
    }
    @ConfigurationProperty(displayMessageKey = "defaultPeopleContainer.display",
    helpMessageKey = "defaultPeopleContainer.help", order = 8)
    public String getDefaultPeopleContainer() {
        if (StringUtil.isBlank()) {
            return getBaseContextsToSynchronize() == null || getBaseContextsToSynchronize().length < 1
                    ? null : getBaseContextsToSynchronize()[0];
        } else {
            return ;
        }
    }
    public void setDefaultPeopleContainer(String defaultPeopleContainer) {
        this. = defaultPeopleContainer;
    }
    @ConfigurationProperty(displayMessageKey = "defaultGroupContainer.display",
    helpMessageKey = "defaultGroupContainer.help", order = 9)
    public String getDefaultGroupContainer() {
        if (StringUtil.isBlank()) {
            return getBaseContextsToSynchronize() == null || getBaseContextsToSynchronize().length < 1
                    ? null : getBaseContextsToSynchronize()[0];
        } else {
            return ;
        }
    }
    public void setDefaultGroupContainer(String defaultGroupContainer) {
        this. = defaultGroupContainer;
    }
    @ConfigurationProperty(displayMessageKey = "userSearchScope.display",
    helpMessageKey = "userSearchScope.help", order = 10)
    public String getUserSearchScope() {
        return  == null ? ..toString() : .toString();
    }
    public void setUserSearchScope(final String userSearchScope) {
        this. = SearchScope.valueOf(userSearchScope.toLowerCase());
    }
    @ConfigurationProperty(displayMessageKey = "groupSearchScope.display",
    helpMessageKey = "groupSearchScope.help", order = 11)
    public String getGroupSearchScope() {
        return  == null ? ..toString() : .toString();
    }
    public void setGroupSearchScope(final String groupSearchScope) {
        this. = SearchScope.valueOf(groupSearchScope.toLowerCase());
    }
    @ConfigurationProperty(displayMessageKey = "groupSearchFilter.display",
    helpMessageKey = "groupSearchFilter.help", order = 12)
    public String getGroupSearchFilter() {
        return ;
    }
    public void setGroupSearchFilter(String groupSearchFilter) {
        this. = groupSearchFilter;
    }
    @ConfigurationProperty(displayMessageKey = "groupBaseContexts.display",
    helpMessageKey = "groupBaseContexts.help", order = 13)
    public String[] getGroupBaseContexts() {
        if ( != null && . > 0) {
            // return specified configuration
            return .clone();
        } else {
            // return root suffixes
            return getBaseContextsToSynchronize();
        }
    }
    public void setGroupBaseContexts(String... baseContexts) {
        this. = baseContexts.clone();
    }
    @ConfigurationProperty(displayMessageKey = "groupMemberReferenceAttribute.display",
    helpMessageKey = "groupMemberReferenceAttribute.help", order = 14)
        return StringUtil.isBlank() ? "member" : ;
    }
    public void setGroupMemberReferenceAttribute(String groupMemberReferenceAttribute) {
        this. = groupMemberReferenceAttribute;
    }
    @ConfigurationProperty(displayMessageKey = "groupOwnerReferenceAttribute.display",
    helpMessageKey = "groupOwnerReferenceAttribute.help", order = 15)
        return StringUtil.isBlank() ? "managedBy" : ;
    }
    public void setGroupOwnerReferenceAttribute(String groupOwnerReferenceAttribute) {
        this. = groupOwnerReferenceAttribute;
    }
    @ConfigurationProperty(displayMessageKey = "startSyncFromToday.display",
    helpMessageKey = "startSyncFromToday.help", order = 16)
    public boolean isStartSyncFromToday() {
        return ;
    }
    public void setStartSyncFromToday(boolean startSyncFromToday) {
        this. = startSyncFromToday;
    }
    public enum SearchScope {
        object,
        onelevel,
        subtree
    }
New to GrepCode? Check out our FAQ X