* provided ID.
*/
public Entry getEntryForID(String id)
throws DirectoryException
{
ExactMatchIdentityMapperCfg config = currentConfig;
AttributeType[] attributeTypes = this.attributeTypes;
// Construct the search filter to use to make the determination.
SearchFilter filter;
if (attributeTypes.length == 1)
{
AttributeValue value = AttributeValues.create(attributeTypes[0], id);
filter = SearchFilter.createEqualityFilter(attributeTypes[0], value);
}
else
{
ArrayList<SearchFilter> filterComps =
new ArrayList<SearchFilter>(attributeTypes.length);
for (AttributeType t : attributeTypes)
{
AttributeValue value = AttributeValues.create(t, id);
filterComps.add(SearchFilter.createEqualityFilter(t, value));
}
filter = SearchFilter.createORFilter(filterComps);
}
// Iterate through the set of search bases and process an internal search
// to find any matching entries. Since we'll only allow a single match,
// then use size and time limits to constrain costly searches resulting from
// non-unique or inefficient criteria.
Collection<DN> baseDNs = config.getMatchBaseDN();
if ((baseDNs == null) || baseDNs.isEmpty())
{
baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
}