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.shared.ldap.schema;
021    
022    
023    import java.util.List;
024    import java.util.Map;
025    import java.util.Set;
026    
027    import org.apache.directory.shared.ldap.exception.LdapException;
028    import org.apache.directory.shared.ldap.name.DN;
029    import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
030    import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
031    import org.apache.directory.shared.ldap.schema.registries.ComparatorRegistry;
032    import org.apache.directory.shared.ldap.schema.registries.DITContentRuleRegistry;
033    import org.apache.directory.shared.ldap.schema.registries.DITStructureRuleRegistry;
034    import org.apache.directory.shared.ldap.schema.registries.LdapSyntaxRegistry;
035    import org.apache.directory.shared.ldap.schema.registries.MatchingRuleRegistry;
036    import org.apache.directory.shared.ldap.schema.registries.MatchingRuleUseRegistry;
037    import org.apache.directory.shared.ldap.schema.registries.NameFormRegistry;
038    import org.apache.directory.shared.ldap.schema.registries.NormalizerRegistry;
039    import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
040    import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
041    import org.apache.directory.shared.ldap.schema.registries.Registries;
042    import org.apache.directory.shared.ldap.schema.registries.Schema;
043    import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
044    import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
045    
046    
047    /**
048     * A class used to manage access to the Schemas and Registries. It's associated 
049     * with a SchemaLoader, in charge of loading the schemas from the disk.
050     * 
051     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
052     * @version $Rev$, $Date$
053     */
054    public interface SchemaManager
055    {
056        //---------------------------------------------------------------------------------
057        // Schema loading methods
058        //---------------------------------------------------------------------------------
059        /**
060         * Load some Schemas into the registries. The Registries is checked after the 
061         * schemas have been loaded, and if there is an error, the method returns false
062         * and the registries is kept intact.
063         * <br>
064         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
065         * <br>
066         * If any error was met, the {@link #getErrors} method will contain them
067         * 
068         * @param schemas the Schemas to load
069         * @return true if the schemas have been loaded and the registries is consistent
070         * @throws Exception @TODO 
071         */
072        boolean load( Schema... schemas ) throws Exception;
073    
074    
075        /**
076         * Load some Schemas into the registries. The Registries is checked after the 
077         * schemas have been loaded, and if there is an error, the method returns false
078         * and the registries is kept intact.
079         * <br>
080         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
081         * <br>
082         * If any error was met, the {@link #getErrors} method will contain them
083         * 
084         * @param schemas the Schemas' name to load
085         * @return true if the schemas have been loaded and the registries is consistent
086         * @throws Exception @TODO 
087         */
088        boolean load( String... schemas ) throws Exception;
089    
090    
091        /**
092         * Load some Schemas into the registries, and loads all of the schemas they depend
093         * on. The Registries is checked after the schemas have been loaded, and if there 
094         * is an error, the method returns false and the registries is kept intact.
095         * <br>
096         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
097         * <br>
098         * If any error was met, the {@link #getErrors} method will contain them
099         * 
100         * @param schemas the Schemas to load
101         * @return true if the schemas have been loaded and the registries is consistent
102         * @throws Exception @TODO 
103         */
104        boolean loadWithDeps( Schema... schemas ) throws Exception;
105    
106    
107        /**
108         * Load some Schemas into the registries, and loads all of the schemas they depend
109         * on. The Registries is checked after the schemas have been loaded, and if there 
110         * is an error, the method returns false and the registries is kept intact.
111         * <br>
112         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
113         * <br>
114         * If any error was met, the {@link #getErrors} method will contain them
115         * 
116         * @param schemas the Schemas' name to load
117         * @return true if the schemas have been loaded and the registries is consistent
118         * @throws Exception @TODO 
119         */
120        boolean loadWithDeps( String... schemas ) throws Exception;
121    
122    
123        /**
124         * Load Schemas into the registries, even if there are some errors in the schemas. 
125         * The Registries is checked after the schemas have been loaded. Even if we have 
126         * errors, the registries will be updated.
127         * <br>
128         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
129         * <br>
130         * If any error was met, the {@link #getErrors} method will contain them
131         * 
132         * @param schemas the Schemas to load, if enabled
133         * @return true if the schemas have been loaded
134         * @throws Exception @TODO 
135         */
136        boolean loadRelaxed( Schema... schemas ) throws Exception;
137    
138    
139        /**
140         * Load Schemas into the registries, even if there are some errors in the schemas. 
141         * The Registries is checked after the schemas have been loaded. Even if we have 
142         * errors, the registries will be updated.
143         * <br>
144         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
145         * <br>
146         * If any error was met, the {@link #getErrors} method will contain them
147         * 
148         * @param schemas the Schemas' name to load, if enabled
149         * @return true if the schemas have been loaded and the registries is consistent
150         * @throws Exception @TODO 
151         */
152        boolean loadRelaxed( String... schemas ) throws Exception;
153    
154    
155        /**
156         * Load some Schemas into the registries, and loads all of the schemas they depend
157         * on. The Registries is checked after the schemas have been loaded. Even if we have 
158         * errors, the registries will be updated.
159         * <br>
160         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
161         * <br>
162         * If any error was met, the {@link #getErrors} method will contain them
163         * 
164         * @param schemas the Schemas to load
165         * @return true if the schemas have been loaded
166         * @throws Exception @TODO 
167         */
168        boolean loadWithDepsRelaxed( Schema... schemas ) throws Exception;
169    
170    
171        /**
172         * Load some Schemas into the registries, and loads all of the schemas they depend
173         * on. The Registries is checked after the schemas have been loaded. Even if we have 
174         * errors, the registries will be updated.
175         * <br>
176         * The Schemas must be enabled, and only enabled SchemaObject will be loaded.
177         * <br>
178         * If any error was met, the {@link #getErrors} method will contain them
179         * 
180         * @param schemas the Schemas' name to load
181         * @return true if the schemas have been loaded
182         * @throws Exception @TODO 
183         */
184        boolean loadWithDepsRelaxed( String... schemas ) throws Exception;
185    
186    
187        /**
188         * Load Schemas into the Registries, even if they are disabled. The disabled
189         * SchemaObject from an enabled schema will also be loaded. The Registries will
190         * be checked after the schemas have been loaded. Even if we have errors, the
191         * Registries will be updated.
192         * <br>
193         * If any error was met, the {@link #getErrors} method will contain them
194         *
195         * @param schemas The Schemas to load
196         * @return true if the schemas have been loaded
197         * @throws Exception @TODO 
198         */
199        boolean loadDisabled( Schema... schemas ) throws Exception;
200    
201    
202        /**
203         * Load Schemas into the Registries, even if they are disabled. The disabled
204         * SchemaObject from an enabled schema will also be loaded. The Registries will
205         * be checked after the schemas have been loaded. Even if we have errors, the
206         * Registries will be updated.
207         * <br>
208         * If any error was met, the {@link #getErrors} method will contain them
209         *
210         * @param schemas The Schemas' name to load
211         * @return true if the schemas have been loaded
212         * @throws Exception @TODO 
213         */
214        boolean loadDisabled( String... schemas ) throws Exception;
215    
216    
217        /**
218         * Load all the enabled schema into the Registries. The Registries is strict,
219         * any inconsistent schema will be rejected. 
220         *
221         * @return true if the schemas have been loaded
222         * @throws Exception @TODO
223         */
224        boolean loadAllEnabled() throws Exception;
225    
226    
227        /**
228         * Load all the enabled schema into the Registries. The Registries is relaxed,
229         * even inconsistent schema will be loaded. 
230         *
231         * @return true if the schemas have been loaded
232         * @throws Exception @TODO
233         */
234        boolean loadAllEnabledRelaxed() throws Exception;
235    
236    
237        /**
238         * Unload the given set of Schemas
239         *
240         * @param schemas The list of Schema to unload
241         * @return True if all the schemas have been unloaded
242         */
243        boolean unload( Schema... schemas ) throws Exception;
244    
245    
246        /**
247         * Unload the given set of Schemas
248         *
249         * @param schemas The list of Schema to unload
250         * @return True if all the schemas have been unloaded
251         */
252        boolean unload( String... schemas ) throws Exception;
253    
254    
255        //---------------------------------------------------------------------------------
256        // Other Schema methods
257        //---------------------------------------------------------------------------------
258        /**
259         * Enables a set of Schemas, and returns true if all the schema have been
260         * enabled, with all the dependent schemas, and if the registries is 
261         * still consistent.
262         * 
263         * If the modification is ok, the Registries will be updated. 
264         * 
265         *  @param schemas The list of schemas to enable
266         *  @return true if the Registries is still consistent, false otherwise.
267         *  @throws If something went wrong
268         */
269        boolean enable( Schema... schemas ) throws Exception;
270    
271    
272        /**
273         * Enables a set of Schemas, and returns true if all the schema have been
274         * enabled, with all the dependent schemas, and if the registries is 
275         * still consistent.
276         * 
277         * If the modification is ok, the Registries will be updated.
278         *  
279         *  @param schemas The list of schema name to enable
280         *  @return true if the Registries is still consistent, false otherwise.
281         *  @throws If something went wrong
282         */
283        boolean enable( String... schemas ) throws Exception;
284    
285    
286        /**
287         * Enables a set of Schemas, and returns true if all the schema have been
288         * enabled, with all the dependent schemas. No check is done, the Registries
289         * might become inconsistent after this operation.
290         * 
291         *  @param schemas The list of schemas to enable
292         *  @return true if all the schemas have been enabled
293         */
294        boolean enableRelaxed( Schema... schemas );
295    
296    
297        /**
298         * Enables a set of Schemas, and returns true if all the schema have been
299         * enabled, with all the dependent schemas. No check is done, the Registries
300         * might become inconsistent after this operation.
301         * 
302         *  @param schemas The list of schema names to enable
303         *  @return true if all the schemas have been enabled
304         */
305        boolean enableRelaxed( String... schemas );
306    
307    
308        /**
309         * @return the list of all the enabled schema
310         */
311        List<Schema> getEnabled();
312    
313    
314        /**
315         * Tells if the given Schema is enabled
316         *
317         * @param schemaName The schema name
318         * @return true if the schema is enabled
319         */
320        boolean isEnabled( String schemaName );
321    
322    
323        /**
324         * Tells if the given Schema is enabled
325         *
326         * @param schema The schema
327         * @return true if the schema is enabled
328         */
329        boolean isEnabled( Schema schema );
330    
331    
332        /**
333         * Disables a set of Schemas, and returns true if all the schema have been
334         * disabled, with all the dependent schemas, and if the registries is 
335         * still consistent.
336         * 
337         * If the modification is ok, the Registries will be updated. 
338         * 
339         *  @param schemas The list of schemas to disable
340         *  @return true if the Registries is still consistent, false otherwise.
341         *  @throws If something went wrong
342         */
343        boolean disable( Schema... schemas ) throws Exception;
344    
345    
346        /**
347         * Disables a set of Schemas, and returns true if all the schema have been
348         * disabled, with all the dependent schemas, and if the registries is 
349         * still consistent.
350         * 
351         * If the modification is ok, the Registries will be updated. 
352         * 
353         *  @param schemas The list of schema names to disable
354         *  @return true if the Registries is still consistent, false otherwise.
355         *  @throws If something went wrong
356         */
357        boolean disable( String... schemas ) throws Exception;
358    
359    
360        /**
361         * Disables a set of Schemas, and returns true if all the schema have been
362         * disabled, with all the dependent schemas. The Registries is not checked
363         * and can be inconsistent after this operation
364         * 
365         * If the modification is ok, the Registries will be updated. 
366         * 
367         *  @param schemas The list of schemas to disable
368         *  @return true if all the schemas have been disabled
369         */
370        boolean disabledRelaxed( Schema... schemas );
371    
372    
373        /**
374         * Disables a set of Schemas, and returns true if all the schema have been
375         * disabled, with all the dependent schemas. The Registries is not checked
376         * and can be inconsistent after this operation
377         * 
378         * If the modification is ok, the Registries will be updated. 
379         * 
380         *  @param schemas The list of schema names to disable
381         *  @return true if all the schemas have been disabled
382         */
383        boolean disabledRelaxed( String... schemas );
384    
385    
386        /**
387         * @return the list of all the disabled schema
388         */
389        List<Schema> getDisabled();
390    
391    
392        /**
393         * Tells if the given Schema is disabled
394         *
395         * @param schemaName The schema name
396         * @return true if the schema is disabled
397         */
398        boolean isDisabled( String schemaName );
399    
400    
401        /**
402         * Tells if the given Schema is disabled
403         *
404         * @param schema The schema
405         * @return true if the schema is disabled
406         */
407        boolean isDisabled( Schema schema );
408    
409    
410        /**
411         * Check that the Schemas are consistent regarding the current Registries.
412         * 
413         * @param schemas The schemas to check
414         * @return true if the schemas can be loaded in the registries
415         * @throws Exception if something went wrong
416         */
417        boolean verify( Schema... schemas ) throws Exception;
418    
419    
420        /**
421         * Check that the Schemas are consistent regarding the current Registries.
422         * 
423         * @param schemas The schema names to check
424         * @return true if the schemas can be loaded in the registries
425         * @throws Exception if something went wrong
426         */
427        boolean verify( String... schemas ) throws Exception;
428    
429    
430        /**
431         * @return The Registries
432         */
433        Registries getRegistries();
434    
435    
436        /**
437         * Lookup for an AttributeType in the AttributeType registry
438         * 
439         * @param String oid the OID we are looking for
440         * @return The found AttributeType 
441         * @throws LdapException if the OID is not found in the AttributeType registry
442         */
443        AttributeType lookupAttributeTypeRegistry( String oid ) throws LdapException;
444    
445    
446        /**
447         * Lookup for a Comparator in the Comparator registry
448         * 
449         * @param String oid the OID we are looking for
450         * @return The found Comparator 
451         * @throws LdapException if the OID is not found in the Comparator registry
452         */
453        LdapComparator<?> lookupComparatorRegistry( String oid ) throws LdapException;
454    
455    
456        /**
457         * Lookup for a MatchingRule in the MatchingRule registry
458         * 
459         * @param String oid the OID we are looking for
460         * @return The found MatchingRule 
461         * @throws LdapException if the OID is not found in the MatchingRule registry
462         */
463        MatchingRule lookupMatchingRuleRegistry( String oid ) throws LdapException;
464    
465    
466        /**
467         * Lookup for a Normalizer in the Normalizer registry
468         * 
469         * @param String oid the OID we are looking for
470         * @return The found Normalizer 
471         * @throws LdapException if the OID is not found in the Normalizer registry
472         */
473        Normalizer lookupNormalizerRegistry( String oid ) throws LdapException;
474    
475    
476        /**
477         * Lookup for a ObjectClass in the ObjectClass registry
478         * 
479         * @param String oid the OID we are looking for
480         * @return The found ObjectClass 
481         * @throws LdapException if the OID is not found in the ObjectClass registry
482         */
483        ObjectClass lookupObjectClassRegistry( String oid ) throws LdapException;
484    
485    
486        /**
487         * Lookup for an LdapSyntax in the LdapSyntax registry
488         * 
489         * @param String oid the OID we are looking for
490         * @return The found LdapSyntax 
491         * @throws LdapException if the OID is not found in the LdapSyntax registry
492         */
493        LdapSyntax lookupLdapSyntaxRegistry( String oid ) throws LdapException;
494    
495    
496        /**
497         * Lookup for a SyntaxChecker in the SyntaxChecker registry
498         * 
499         * @param String oid the OID we are looking for
500         * @return The found SyntaxChecker 
501         * @throws LdapException if the OID is not found in the SyntaxChecker registry
502         */
503        SyntaxChecker lookupSyntaxCheckerRegistry( String oid ) throws LdapException;
504    
505    
506        /**
507         * Get an immutable reference on the AttributeType registry
508         * 
509         * @return A reference to the AttributeType registry.
510         */
511        AttributeTypeRegistry getAttributeTypeRegistry();
512    
513    
514        /**
515         * Get an immutable reference on the Comparator registry
516         * 
517         * @return A reference to the Comparator registry.
518         */
519        ComparatorRegistry getComparatorRegistry();
520    
521    
522        /**
523         * Get an immutable reference on the DITContentRule registry
524         * 
525         * @return A reference to the DITContentRule registry.
526         */
527        DITContentRuleRegistry getDITContentRuleRegistry();
528    
529    
530        /**
531         * Get an immutable reference on the DITStructureRule registry
532         * 
533         * @return A reference to the DITStructureRule registry.
534         */
535        DITStructureRuleRegistry getDITStructureRuleRegistry();
536    
537    
538        /**
539         * Get an immutable reference on the MatchingRule registry
540         * 
541         * @return A reference to the MatchingRule registry.
542         */
543        MatchingRuleRegistry getMatchingRuleRegistry();
544    
545    
546        /**
547         * Get an immutable reference on the MatchingRuleUse registry
548         * 
549         * @return A reference to the MatchingRuleUse registry.
550         */
551        MatchingRuleUseRegistry getMatchingRuleUseRegistry();
552    
553    
554        /**
555         * Get an immutable reference on the Normalizer registry
556         * 
557         * @return A reference to the Normalizer registry.
558         */
559        NormalizerRegistry getNormalizerRegistry();
560    
561    
562        /**
563         * Get an immutable reference on the NameForm registry
564         * 
565         * @return A reference to the NameForm registry.
566         */
567        NameFormRegistry getNameFormRegistry();
568    
569    
570        /**
571         * Get an immutable reference on the ObjectClass registry
572         * 
573         * @return A reference to the ObjectClass registry.
574         */
575        ObjectClassRegistry getObjectClassRegistry();
576    
577    
578        /**
579         * Get an immutable reference on the LdapSyntax registry
580         * 
581         * @return A reference to the LdapSyntax registry.
582         */
583        LdapSyntaxRegistry getLdapSyntaxRegistry();
584    
585    
586        /**
587         * Get an immutable reference on the SyntaxChecker registry
588         * 
589         * @return A reference to the SyntaxChecker registry.
590         */
591        SyntaxCheckerRegistry getSyntaxCheckerRegistry();
592    
593    
594        /**
595         * Get an immutable reference on the Normalizer mapping
596         * 
597         * @return A reference to the Normalizer mapping
598         */
599        Map<String, OidNormalizer> getNormalizerMapping();
600    
601    
602        /**
603         * Associate a new Registries to the SchemaManager
604         *
605         * @param registries The new Registries
606         */
607        void setRegistries( Registries registries );
608    
609    
610        /**
611         * @return The errors obtained when checking the registries
612         */
613        List<Throwable> getErrors();
614    
615    
616        /**
617         * Associate a Schema loader to this SchemaManager
618         *
619         * @param schemaLoader The schema loader to use
620         */
621        void setSchemaLoader( SchemaLoader schemaLoader );
622    
623    
624        /**
625         * @return the namingContext
626         */
627        DN getNamingContext();
628    
629    
630        /**
631         * Initializes the SchemaService
632         *
633         * @throws Exception If the initialization fails
634         */
635        void initialize() throws Exception;
636    
637    
638        /**
639         * @return The used loader
640         */
641        SchemaLoader getLoader();
642    
643    
644        /**
645         * Registers a new SchemaObject. The registries will be updated only if it's
646         * consistent after this addition, if the SchemaManager is in Strict mode.
647         * If something went wrong during this operation, the 
648         * SchemaManager.getErrors() will give the list of generated errors.
649         *
650         * @param schemaObject the SchemaObject to register
651         * @return true if the addition has been made, false if there were some errors
652         * @throws Exception if the SchemaObject is already registered or
653         * the registration operation is not supported
654         */
655        boolean add( SchemaObject schemaObject ) throws Exception;
656    
657    
658        /**
659         * Unregisters a new SchemaObject. The registries will be updated only if it's
660         * consistent after this deletion, if the SchemaManager is in Strict mode.
661         * If something went wrong during this operation, the 
662         * SchemaManager.getErrors() will give the list of generated errors.
663         *
664         * @param schemaObject the SchemaObject to unregister
665         * @return true if the deletion has been made, false if there were some errors
666         * @throws Exception if the SchemaObject is not registered or
667         * the deletion operation is not supported
668         */
669        boolean delete( SchemaObject schemaObject ) throws Exception;
670    
671    
672        /**
673         * Removes the registered attributeType from the attributeTypeRegistry 
674         * 
675         * @param String the attributeType OID to unregister
676         * @throws LdapException if the attributeType is invalid
677         */
678        SchemaObject unregisterAttributeType( String attributeTypeOid ) throws LdapException;
679    
680    
681        /**
682         * Removes the registered Comparator from the ComparatorRegistry 
683         * 
684         * @param String the Comparator OID to unregister
685         * @throws LdapException if the Comparator is invalid
686         */
687        SchemaObject unregisterComparator( String comparatorOid ) throws LdapException;
688    
689    
690        /**
691         * Removes the registered DitControlRule from the DitControlRuleRegistry 
692         * 
693         * @param String the DitControlRule OID to unregister
694         * @throws LdapException if the DitControlRule is invalid
695         */
696        SchemaObject unregisterDitControlRule( String ditControlRuleOid ) throws LdapException;
697    
698    
699        /**
700         * Removes the registered DitStructureRule from the DitStructureRuleRegistry 
701         * 
702         * @param String the DitStructureRule OID to unregister
703         * @throws LdapException if the DitStructureRule is invalid
704         */
705        SchemaObject unregisterDitStructureRule( String ditStructureRuleOid ) throws LdapException;
706    
707    
708        /**
709         * Removes the registered MatchingRule from the MatchingRuleRegistry 
710         * 
711         * @param String the MatchingRuleRule OID to unregister
712         * @throws LdapException if the MatchingRule is invalid
713         */
714        SchemaObject unregisterMatchingRule( String matchingRuleOid ) throws LdapException;
715    
716    
717        /**
718         * Removes the registered MatchingRuleUse from the MatchingRuleUseRegistry 
719         * 
720         * @param String the MatchingRuleUse OID to unregister
721         * @throws LdapException if the MatchingRuleUse is invalid
722         */
723        SchemaObject unregisterMatchingRuleUse( String matchingRuleUseOid ) throws LdapException;
724    
725    
726        /**
727         * Removes the registered NameForm from the NameFormRegistry 
728         * 
729         * @param String the NameForm OID to unregister
730         * @throws LdapException if the NameForm is invalid
731         */
732        SchemaObject unregisterNameForm( String nameFormOid ) throws LdapException;
733    
734    
735        /**
736         * Removes the registered Normalizer from the NormalizerRegistry 
737         * 
738         * @param String the Normalizer OID to unregister
739         * @throws LdapException if the Normalizer is invalid
740         */
741        SchemaObject unregisterNormalizer( String normalizerOid ) throws LdapException;
742    
743    
744        /**
745         * Removes the registered ObjectClass from the ObjectClassRegistry 
746         * 
747         * @param String the ObjectClass OID to unregister
748         * @throws LdapException if the ObjectClass is invalid
749         */
750        SchemaObject unregisterObjectClass( String objectClassOid ) throws LdapException;
751    
752    
753        /**
754         * Removes the registered LdapSyntax from the LdapSyntaxRegistry 
755         * 
756         * @param String the LdapSyntax OID to unregister
757         * @throws LdapException if the LdapSyntax is invalid
758         */
759        SchemaObject unregisterLdapSyntax( String ldapSyntaxOid ) throws LdapException;
760    
761    
762        /**
763         * Removes the registered SyntaxChecker from the SyntaxCheckerRegistry 
764         * 
765         * @param String the SyntaxChecker OID to unregister
766         * @throws LdapException if the SyntaxChecker is invalid
767         */
768        SchemaObject unregisterSyntaxChecker( String syntaxCheckerOid ) throws LdapException;
769    
770    
771        /**
772         * Returns a reference to the global OidRegistry
773         *
774         * @return The the global OidRegistry
775         */
776        OidRegistry getGlobalOidRegistry();
777    
778    
779        /**
780         * Gets a schema that has been loaded into these Registries.
781         * 
782         * @param schemaName the name of the schema to lookup
783         * @return the loaded Schema if one corresponding to the name exists
784         */
785        Schema getLoadedSchema( String schemaName );
786    
787    
788        /**
789         * Tells if the specific schema is loaded
790         *
791         * @param schemaName The schema we want to check
792         * @return true if the schema is laoded
793         */
794        boolean isSchemaLoaded( String schemaName );
795        
796        
797        /**
798         * Get the list of Schema names which has the given schema name as a dependence
799         *
800         * @param schemaName The Schema name for which we want to get the list of dependent schemas
801         * @return The list of dependent schemas
802         */
803        Set<String> listDependentSchemaNames( String schemaName );
804    }