private MatchingRule getMatchingRule( String attrId, int matchType )
throws NamingException
{
MatchingRule mrule = null;
String oid = oidRegistry.getOid( attrId );
AttributeType type = attributeTypeRegistry.lookup( oid );
switch( matchType )
{
case( EQUALITY_MATCH ):
mrule = type.getEquality();
break;
case( SUBSTRING_MATCH ):
mrule = type.getSubstr();
break;
case( ORDERING_MATCH ):
mrule = type.getOrdering();
break;
default:
throw new NamingException( "Unknown match type: " + matchType );
}