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