1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.ldap.server.schema;
18
19
20 import org.apache.ldap.common.schema.MatchingRule;
21
22 import javax.naming.NamingException;
23 import java.util.Iterator;
24
25
26 /***
27 * A registry used to track system matchingRules.
28 *
29 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30 * @version $Rev: 159259 $
31 */
32 public interface MatchingRuleRegistry
33 {
34 /***
35 * Registers a MatchingRule with this registry.
36 *
37 * @param schema the name of the schema the MatchingRule is associated with
38 * @param matchingRule the MatchingRule to register
39 * @throws NamingException if the matchingRule is already registered or the
40 * registration operation is not supported
41 */
42 void register( String schema, MatchingRule matchingRule ) throws NamingException;
43
44 /***
45 * Looks up a MatchingRule by its unique Object Identifier or by name.
46 *
47 * @param id the object identifier or the name identifier
48 * @return the MatchingRule for the id
49 * @throws NamingException if there is a backing store failure or the
50 * MatchingRule does not exist.
51 */
52 MatchingRule lookup( String id ) throws NamingException;
53
54 /***
55 * Gets the name of the schema this schema object is associated with.
56 *
57 * @param id the object identifier or the name
58 * @return the schema name
59 * @throws NamingException if the schema object does not exist
60 */
61 String getSchemaName( String id ) throws NamingException;
62
63 /***
64 * Checks to see if a MatchingRule exists. Backing store failures simply
65 * return false.
66 *
67 * @param oid the object identifier
68 * @return true if a MatchingRule definition exists for the oid, false
69 * otherwise
70 */
71 boolean hasMatchingRule( String oid );
72
73 /***
74 * Gets an Iterator over the MatchingRules within this registry.
75 *
76 * @return an iterator over all MatchingRules in registry
77 */
78 Iterator list();
79 }