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