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; 28 29 30 /** 31 * Manages the lookup and registration of Syntaxes within the system by OID. 32 * 33 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 34 * @version $Rev: 499844 $ 35 */ 36 public interface SyntaxRegistry extends SchemaObjectRegistry 37 { 38 /** 39 * Looks up a Syntax by its unique Object Identifier or by name. 40 * 41 * @param id the object identifier or name 42 * @return the Syntax for the id 43 * @throws NamingException if there is a backing store failure or the Syntax 44 * does not exist. 45 */ 46 Syntax lookup( String id ) throws NamingException; 47 48 49 /** 50 * Registers a Syntax with this registry. 51 * 52 * @param syntax the Syntax to register 53 * @throws NamingException if the syntax is already registered or the 54 * registration operation is not supported 55 */ 56 void register( Syntax syntax ) throws NamingException; 57 58 59 /** 60 * Checks to see if a Syntax exists. Backing store failures simply return 61 * false. 62 * 63 * @param id the object identifier or name 64 * @return true if a Syntax definition exists for the id, false otherwise 65 */ 66 boolean hasSyntax( String id ); 67 68 69 /** 70 * Lists all the Syntaxes within this registry. 71 * 72 * @return an Iterator over all the Syntaxes within this registry 73 */ 74 Iterator<Syntax> iterator(); 75 }