001    package org.apache.directory.server.core.schema;
002    
003    
004    import org.apache.directory.shared.ldap.entry.ServerEntry;
005    import org.apache.directory.shared.ldap.exception.LdapException;
006    import org.apache.directory.shared.ldap.schema.SchemaManager;
007    
008    
009    public interface SchemaService
010    {
011    
012        /**
013         * Tells if the given DN is the schemaSubentry DN
014         * 
015         * @param dnString The DN we want to check
016         * @return <code>true</code> if the given DN is the Schema subentry DN
017         * @throws LdapException If the given DN is not valid
018         */
019        boolean isSchemaSubentry( String dnString ) throws LdapException;
020    
021    
022        /**
023         * @return the schemaManager loaded from schemaPartition
024         */
025        SchemaManager getSchemaManager();
026    
027    
028        SchemaPartition getSchemaPartition();
029    
030    
031        void setSchemaPartition( SchemaPartition schemaPartition );
032        
033        
034        /**
035         * Initializes the SchemaService
036         *
037         * @throws Exception If the initializaion fails
038         */
039        void initialize() throws Exception;
040    
041    
042        /**
043         * A seriously unsafe (unsynchronized) means to access the schemaSubentry.
044         *
045         * @return the schemaSubentry
046         * @throws Exception if there is a failure to access schema timestamps
047         */
048        ServerEntry getSubschemaEntryImmutable() throws Exception;
049    
050    
051        /**
052         * A seriously unsafe (unsynchronized) means to access the schemaSubentry.
053         *
054         * @return the schemaSubentry
055         * @throws Exception if there is a failure to access schema timestamps
056         */
057        ServerEntry getSubschemaEntryCloned() throws Exception;
058    
059    
060        /**
061         * Gets the schemaSubentry based on specific search id parameters which
062         * include the special '*' and '+' operators.
063         *
064         * @param ids the ids of the attributes that should be returned from a search
065         * @return the subschema entry with the ids provided
066         * @throws Exception if there are failures during schema info access
067         */
068        ServerEntry getSubschemaEntry( String[] ids ) throws Exception;
069    }