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.NameForm;
28
29
30 /**
31 * An NameForm 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 NameFormRegistry extends SchemaObjectRegistry
37 {
38 /**
39 * Registers a NameForm with this registry.
40 *
41 * @param nameForm the nameForm to register
42 * @throws NamingException if the NameForm is already registered or the
43 * registration operation is not supported
44 */
45 void register( NameForm nameForm ) throws NamingException;
46
47
48 /**
49 * Looks up a nameForm by its unique Object Identifier or by name.
50 *
51 * @param id the object identifier or name
52 * @return the NameForm instance for the id
53 * @throws NamingException if the NameForm does not exist
54 */
55 NameForm lookup( String id ) throws NamingException;
56
57
58 /**
59 * Checks to see if an nameForm exists.
60 *
61 * @param id the object identifier or name
62 * @return true if an nameForm definition exists for the oid, false
63 * otherwise
64 */
65 boolean hasNameForm( String id );
66
67
68 /**
69 * Lists all the NameForms within this registry.
70 *
71 * @return an Iterator over all the NameForms within this registry
72 */
73 Iterator<NameForm> iterator();
74 }