View Javadoc

1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.server.schema.registries;
21  
22  
23  import java.util.Iterator;
24  
25  import javax.naming.NamingException;
26  
27  import org.apache.directory.shared.ldap.schema.ObjectClass;
28  
29  
30  /**
31   * ObjectClass registry service interface.
32   *
33   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34   * @version $Rev: 499844 $
35   */
36  public interface ObjectClassRegistry extends SchemaObjectRegistry
37  {
38      /**
39       * Registers an ObjectClass with this registry.
40       *
41       * @param objectClass the objectClass to register
42       * @throws NamingException if the ObjectClass is already registered or the
43       * registration operation is not supported
44       */
45      void register( ObjectClass objectClass ) throws NamingException;
46  
47  
48      /**
49       * Looks up an objectClass by its unique Object Identifier or by name.
50       *
51       * @param id the object identifier or name
52       * @return the ObjectClass instance for the id
53       * @throws NamingException if the ObjectClass does not exist
54       */
55      ObjectClass lookup( String id ) throws NamingException;
56  
57  
58      /**
59       * Checks to see if an objectClass exists.
60       *
61       * @param id the object identifier or name
62       * @return true if an objectClass definition exists for the id, false
63       * otherwise
64       */
65      boolean hasObjectClass( String id );
66  
67  
68      /**
69       * Gets an Iterator over the ObjectClasses within this ObjectClassRegistry.
70       *
71       * @return an iterator over all ObjectClasses in registry
72       */
73      Iterator<ObjectClass> iterator();
74  }