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.syntax.SyntaxChecker;
28 import org.apache.directory.shared.ldap.schema.syntax.SyntaxCheckerDescription;
29
30
31 /**
32 * SyntaxChecker registry component's service interface.
33 *
34 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
35 * @version $Rev: 504773 $
36 */
37 public interface SyntaxCheckerRegistry
38 {
39 /**
40 * Registers a SyntaxChecker with this registry.
41 *
42 * @param description the syntaxCheckerDescription for this syntaxChecker
43 * @param syntaxChecker the SyntaxChecker to register
44 * @throws NamingException if the SyntaxChecker is already registered or the
45 * registration operation is not supported
46 */
47 void register( SyntaxCheckerDescription description, SyntaxChecker syntaxChecker ) throws NamingException;
48
49
50 /**
51 * Looks up a SyntaxChecker by its unique Object Identifier.
52 *
53 * @param oid the object identifier
54 * @return the SyntaxChecker for the oid
55 * @throws NamingException if there is a backing store failure or the
56 * SyntaxChecker does not exist.
57 */
58 SyntaxChecker lookup( String oid ) throws NamingException;
59
60
61 /**
62 * Gets the name of the schema this schema object is associated with.
63 *
64 * @param oid the object identifier
65 * @return the schema name
66 * @throws NamingException if the schema object does not exist
67 */
68 String getSchemaName( String oid ) throws NamingException;
69
70
71 /**
72 * Checks to see if a SyntaxChecker exists. Backing store failures simply
73 * return false.
74 *
75 * @param oid the object identifier
76 * @return true if a SyntaxChecker definition exists for the oid, false
77 * otherwise
78 */
79 boolean hasSyntaxChecker( String oid );
80
81
82 /**
83 * Get's an iterator over all the syntaxCheckers associated with this registry.
84 *
85 * @return an Iterator over all the syntaxCheckers
86 */
87 Iterator<SyntaxChecker> iterator();
88
89
90 /**
91 * Get's an iterator over all the syntaxCheckerDescriptions associated with this registry.
92 *
93 * @return an Iterator over all the syntaxCheckerDescriptions
94 */
95 Iterator<SyntaxCheckerDescription> syntaxCheckerDescriptionIterator();
96
97
98 /**
99 * Unregisters a registered syntaxChecker from this registry.
100 *
101 * @param numericOid the numeric oid of the syntax this checker is associated with
102 * @throws NamingException if the numericOid is not valid
103 */
104 void unregister( String numericOid ) throws NamingException;
105
106
107 /**
108 * Unregisters all syntaxCheckers defined for a specific schema from
109 * this registry.
110 *
111 * @param schemaName the name of the schema whose syntaxCheckers will be removed
112 */
113 void unregisterSchemaElements( String schemaName );
114
115
116 /**
117 * Renames the schemaName associated with entities within this
118 * registry to a new schema name.
119 *
120 * @param originalSchemaName the original schema name
121 * @param newSchemaName the new name to give to the schema
122 */
123 void renameSchema( String originalSchemaName, String newSchemaName );
124 }