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.List;
024    import java.util.Map;
025    import java.util.Properties;
026    
027    import org.apache.directory.server.schema.bootstrap.Schema;
028    
029    
030    /**
031     * Document this class.
032     *
033     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
034     * @version $Rev: 725712 $
035     */
036    public interface Registries
037    {
038        String getName();
039        
040        Map<String,Schema> getLoadedSchemas();
041        
042        void load( String schemaName ) throws Exception;
043        
044        void load( String schemaName, Properties props ) throws Exception;
045    
046        void unload( String schemaName ) throws Exception;
047        
048        SchemaLoader getSchemaLoader();
049        
050        AttributeTypeRegistry getAttributeTypeRegistry();
051        
052        ComparatorRegistry getComparatorRegistry();
053    
054        DITContentRuleRegistry getDitContentRuleRegistry();
055    
056        DITStructureRuleRegistry getDitStructureRuleRegistry();
057    
058        MatchingRuleRegistry getMatchingRuleRegistry();
059    
060        MatchingRuleUseRegistry getMatchingRuleUseRegistry();
061    
062        NameFormRegistry getNameFormRegistry();
063    
064        NormalizerRegistry getNormalizerRegistry();
065    
066        ObjectClassRegistry getObjectClassRegistry();
067    
068        OidRegistry getOidRegistry();
069    
070        SyntaxCheckerRegistry getSyntaxCheckerRegistry();
071    
072        SyntaxRegistry getSyntaxRegistry();
073    
074        List<Throwable> checkRefInteg();
075    
076        Schema getSchema( String schemaName );
077    
078        /**
079         * Removes a schema from the loaded set without unloading the schema.
080         * This should be used ONLY when an enabled schema is deleted.
081         * 
082         * @param schemaName the name of the schema to remove
083         */
084        void removeFromLoadedSet( String schemaName );
085        
086        /**
087         * Adds a schema to the loaded set but does not load the schema in 
088         * question.  This may be a temporary fix for new schemas being added
089         * which are enabled yet do not have any schema entities associated 
090         * with them to load.  In this case all objects added under this 
091         * schema will load when added instead of in bulk.
092         * 
093         * @param schema the schema object to add to the loaded set.
094         */
095        void addToLoadedSet( Schema schema );
096    }