View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.ldap.server.schema;
18  
19  
20  import org.apache.ldap.common.schema.DITStructureRule;
21  
22  import javax.naming.NamingException;
23  import java.util.Iterator;
24  
25  
26  /***
27   * An DITStructureRule 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 DITStructureRuleRegistry
33  {
34      /***
35       * Registers a DITStructureRule with this registry.
36       * 
37       * @param schema the name of the schema the DITStructureRule is associated with
38       * @param dITStructureRule the dITStructureRule to register
39       * @throws NamingException if the DITStructureRule is already registered
40       * or the registration operation is not supported
41       */
42      void register( String schema, DITStructureRule dITStructureRule ) throws NamingException;
43      
44      /***
45       * Looks up an dITStructureRule by its unique Object IDentifier or by its
46       * name.
47       * 
48       * @param id the object identifier, or the name
49       * @return the DITStructureRule instance for the id
50       * @throws NamingException if the DITStructureRule does not exist
51       */
52      DITStructureRule 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 dITStructureRule exists.
65       * 
66       * @param id the object identifier, or the name
67       * @return true if an dITStructureRule definition exists for the id, false
68       * otherwise
69       */
70      boolean hasDITStructureRule( String id );
71  
72      /***
73       * Lists all the DITStructureRules within this registry.
74       *
75       * @return an Iterator over all the DITStructureRules within this registry
76       */
77      Iterator list();
78  }