{
Set<ServerEntry> set = new HashSet<ServerEntry>();
BranchNode filter = new AndNode();
// ( objectClass = metaAttributeType )
filter.addNode( new EqualityNode<String>( OBJECTCLASS_OID, new StringValue(
MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC.toLowerCase() ) ) );
BranchNode or = new OrNode();
or.addNode( new EqualityNode<String>( M_ORDERING_OID, new StringValue( mr.getOid() ) ) );
or.addNode( new EqualityNode<String>( M_SUBSTRING_OID, new StringValue( mr.getOid() ) ) );
or.addNode( new EqualityNode<String>( M_EQUALITY_OID, new StringValue( mr.getOid() ) ) );
filter.addNode( or );
List<String> names = mr.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
for ( String name : names )
{
or.addNode( new EqualityNode<String>( M_ORDERING_OID, new StringValue( name.toLowerCase() ) ) );
or.addNode( new EqualityNode<String>( M_SUBSTRING_OID, new StringValue( name.toLowerCase() ) ) );
or.addNode( new EqualityNode<String>( M_EQUALITY_OID, new StringValue( name.toLowerCase() ) ) );
}
}
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope( SearchControls.SUBTREE_SCOPE );