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