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