edu.internet2.middleware.grouper.attr.resolver.LdapGlobalAttributeResolverOptionValueDriver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grouper Show documentation
Show all versions of grouper Show documentation
Internet2 Groups Management Toolkit
package edu.internet2.middleware.grouper.attr.resolver;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import edu.internet2.middleware.grouper.cfg.dbConfig.OptionValueDriver;
import edu.internet2.middleware.grouperClient.collections.MultiKey;
import org.apache.commons.lang3.StringUtils;
public class LdapGlobalAttributeResolverOptionValueDriver implements OptionValueDriver {
@Override
public List retrieveKeysAndLabels() {
List keysAndLabels = new ArrayList();
List resolverConfigs = (List) (Object) new GlobalAttributeResolverConfiguration().listAllConfigurationsOfThisType();
for (GlobalAttributeResolverConfiguration resolverConfig: resolverConfigs) {
if (StringUtils.equals(resolverConfig.retrieveAttributeValueFromConfig("resolverType", false), "ldap") &&
resolverConfig.isEnabled()) {
String configId = resolverConfig.getConfigId();
keysAndLabels.add(new MultiKey(configId, configId));
}
}
Collections.sort(keysAndLabels, new Comparator() {
@Override
public int compare(MultiKey o1, MultiKey o2) {
return ((String)o1.getKey(0)).compareTo((String)o2.getKey(0));
}
});
return keysAndLabels;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy