* @see org.apache.directory.server.core.schema.SchemaPartitionDao#listMatchingRuleDependents(org.apache.directory.shared.ldap.schema.MatchingRule)
*/
public Set<Entry> listMatchingRuleDependents( MatchingRule mr ) throws Exception
{
Set<Entry> set = new HashSet<Entry>();
BranchNode filter = new AndNode();
// ( objectClass = metaAttributeType )
filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC.toLowerCase() ) ) );
BranchNode or = new OrNode();
or.addNode( new EqualityNode<String>( M_ORDERING_AT, new StringValue( mr.getOid() ) ) );
or.addNode( new EqualityNode<String>( M_SUBSTRING_AT, new StringValue( mr.getOid() ) ) );
or.addNode( new EqualityNode<String>( M_EQUALITY_AT, 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_AT, new StringValue( name.toLowerCase() ) ) );
or.addNode( new EqualityNode<String>( M_SUBSTRING_AT, new StringValue( name.toLowerCase() ) ) );
or.addNode( new EqualityNode<String>( M_EQUALITY_AT, new StringValue( name.toLowerCase() ) ) );
}
}
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope( SearchControls.SUBTREE_SCOPE );