001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.server.schema.registries;
021    
022    
023    import java.util.Iterator;
024    
025    import javax.naming.NamingException;
026    
027    import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
028    
029    
030    /**
031     * A MatchingRuleUse registry service interface.  MatchingRuleUse objects are
032     * special in that they do not have unique OID's specifically assigned to them.
033     * Their OID is really the OID of the MatchingRule they refer to.
034     *
035     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
036     * @version $Rev: 499844 $
037     */
038    public interface MatchingRuleUseRegistry extends SchemaObjectRegistry
039    {
040        /**
041         * Registers a MatchingRuleUse with this registry.
042         *
043         * @param matchingRuleUse the matchingRuleUse to register
044         * @throws NamingException if the MatchingRuleUse is already registered or
045         * the registration operation is not supported
046         */
047        void register( MatchingRuleUse matchingRuleUse ) throws NamingException;
048    
049    
050        /**
051         * Looks up an matchingRuleUse by its name.
052         * 
053         * @param name the name of the matchingRuleUse
054         * @return the MatchingRuleUse instance for the name
055         * @throws NamingException if the MatchingRuleUse does not exist
056         */
057        MatchingRuleUse lookup( String name ) throws NamingException;
058    
059        
060        /**
061         * Checks to see if an matchingRuleUse exists.
062         * 
063         * @param name the name of the matchingRuleUse
064         * @return true if an matchingRuleUse definition exists for the name, false
065         * otherwise
066         */
067        boolean hasMatchingRuleUse( String name );
068    
069    
070        /**
071         * Lists all the MatchingRuleUses within this registry.
072         *
073         * @return an Iterator over all the MatchingRuleUses within this registry
074         */
075        Iterator<MatchingRuleUse> iterator();
076    }