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