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.Syntax;
21
22 import javax.naming.NamingException;
23 import java.util.Iterator;
24
25
26 /***
27 * Manages the lookup and registration of Syntaxes within the system by OID.
28 *
29 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30 * @version $Rev: 159259 $
31 */
32 public interface SyntaxRegistry
33 {
34 /***
35 * Looks up a Syntax by its unique Object Identifier or by name.
36 *
37 * @param id the object identifier or name
38 * @return the Syntax for the id
39 * @throws NamingException if there is a backing store failure or the Syntax
40 * does not exist.
41 */
42 Syntax lookup( String id ) throws NamingException;
43
44 /***
45 * Registers a Syntax with this registry.
46 *
47 * @param schema the name of the schema the Syntax is associated with
48 * @param syntax the Syntax to register
49 * @throws NamingException if the syntax is already registered or the
50 * registration operation is not supported
51 */
52 void register( String schema, Syntax syntax ) 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 Syntax exists. Backing store failures simply return
65 * false.
66 *
67 * @param id the object identifier or name
68 * @return true if a Syntax definition exists for the id, false otherwise
69 */
70 boolean hasSyntax( String id );
71
72 /***
73 * Lists all the Syntaxes within this registry.
74 *
75 * @return an Iterator over all the Syntaxes within this registry
76 */
77 Iterator list();
78 }