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