001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2006-2009 Sun Microsystems, Inc.
015 * Portions Copyright 2013-2016 ForgeRock AS.
016 */
017package org.opends.server.types;
018
019import java.util.Collection;
020import java.util.List;
021import java.util.Map;
022import java.util.Set;
023
024import org.forgerock.i18n.LocalizableMessage;
025import org.forgerock.opendj.config.server.ConfigException;
026import org.forgerock.opendj.ldap.DN;
027import org.forgerock.opendj.ldap.ResultCode;
028import org.forgerock.opendj.ldap.schema.AttributeType;
029import org.forgerock.opendj.ldap.schema.MatchingRule;
030import org.forgerock.opendj.ldap.schema.Syntax;
031import org.opends.server.api.AlertGenerator;
032import org.opends.server.api.ConfigHandler;
033import org.opends.server.api.ExtendedOperationHandler;
034import org.opends.server.api.SASLMechanismHandler;
035import org.opends.server.api.ServerShutdownListener;
036import org.opends.server.config.ConfigEntry;
037import org.opends.server.core.DirectoryServer;
038
039import com.forgerock.opendj.util.OperatingSystem;
040
041/**
042 * This interface defines a set of methods that may be used by
043 * third-party code to obtain information about the core Directory
044 * Server configuration and the instances of various kinds of
045 * components that have registered themselves with the server.
046 * <BR><BR>
047 * Note that this interface is not intended to be implemented by any
048 * third-party code.  It is merely used to control which elements are
049 * intended for use by external classes.
050 */
051@org.opends.server.types.PublicAPI(
052     stability=org.opends.server.types.StabilityLevel.VOLATILE,
053     mayInstantiate=false,
054     mayExtend=false,
055     mayInvoke=true)
056public final class DirectoryConfig
057{
058  /**
059   * Retrieves a reference to the Directory Server crypto manager.
060   *
061   * @return  A reference to the Directory Server crypto manager.
062   */
063  public static CryptoManager getCryptoManager()
064  {
065    return DirectoryServer.getCryptoManager();
066  }
067
068
069
070  /**
071   * Retrieves the operating system on which the Directory Server is
072   * running.
073   *
074   * @return  The operating system on which the Directory Server is
075   *          running.
076   */
077  public static OperatingSystem getOperatingSystem()
078  {
079    return DirectoryServer.getOperatingSystem();
080  }
081
082
083
084  /**
085   * Retrieves a reference to the Directory Server configuration
086   * handler.
087   *
088   * @return  A reference to the Directory Server configuration
089   *          handler.
090   */
091  public static ConfigHandler getConfigHandler()
092  {
093    return DirectoryServer.getConfigHandler();
094  }
095
096
097
098  /**
099   * Retrieves the requested entry from the Directory Server
100   * configuration.
101   *
102   * @param  entryDN  The DN of the configuration entry to retrieve.
103   *
104   * @return  The requested entry from the Directory Server
105   *          configuration.
106   *
107   * @throws  ConfigException  If a problem occurs while trying to
108   *                           retrieve the requested entry.
109   */
110  public static ConfigEntry getConfigEntry(DN entryDN)
111         throws ConfigException
112  {
113    return DirectoryServer.getConfigEntry(entryDN);
114  }
115
116
117
118  /**
119   * Retrieves the path to the root directory for this instance of the
120   * Directory Server.
121   *
122   * @return  The path to the root directory for this instance of the
123   *          Directory Server.
124  */
125  public static String getServerRoot()
126  {
127    return DirectoryServer.getServerRoot();
128  }
129
130
131
132  /**
133   * Retrieves the time that the Directory Server was started, in
134   * milliseconds since the epoch.
135   *
136   * @return  The time that the Directory Server was started, in
137   *          milliseconds since the epoch.
138   */
139  public static long getStartTime()
140  {
141    return DirectoryServer.getStartTime();
142  }
143
144
145
146  /**
147   * Retrieves the time that the Directory Server was started,
148   * formatted in UTC.
149   *
150   * @return  The time that the Directory Server was started,
151   *          formatted in UTC.
152   */
153  public static String getStartTimeUTC()
154  {
155    return DirectoryServer.getStartTimeUTC();
156  }
157
158
159
160  /**
161   * Retrieves a reference to the Directory Server schema.
162   *
163   * @return  A reference to the Directory Server schema.
164   */
165  public static Schema getSchema()
166  {
167    return DirectoryServer.getSchema();
168  }
169
170
171
172  /**
173   * Retrieves the set of matching rules registered with the Directory
174   * Server.
175   *
176   * @return  The set of matching rules registered with the Directory
177   *          Server.
178   */
179  public static Collection<MatchingRule> getMatchingRules()
180  {
181    return DirectoryServer.getMatchingRules();
182  }
183
184
185
186  /**
187   * Retrieves the matching rule with the specified name or OID.
188   *
189   * @param  lowerName  The lowercase name or OID for the matching
190   *                    rule to retrieve.
191   *
192   * @return  The requested matching rule, or <CODE>null</CODE> if no
193   *          such matching rule has been defined in the server.
194   */
195  public static MatchingRule getMatchingRule(String lowerName)
196  {
197    return DirectoryServer.getMatchingRule(lowerName);
198  }
199
200
201
202  /**
203   * Retrieves the approximate matching rule with the specified name
204   * or OID.
205   *
206   * @param  lowerName  The lowercase name or OID for the approximate
207   *                    matching rule to retrieve.
208   *
209   * @return  The requested approximate matching rule, or
210   *          <CODE>null</CODE> if no such matching rule has been
211   *          defined in the server.
212   */
213  public static MatchingRule
214       getApproximateMatchingRule(String lowerName)
215  {
216    return DirectoryServer.getMatchingRule(lowerName);
217  }
218
219
220
221  /**
222   * Retrieves the equality matching rule with the specified name or
223   * OID.
224   *
225   * @param  lowerName  The lowercase name or OID for the equality
226   *                    matching rule to retrieve.
227   *
228   * @return  The requested equality matching rule, or
229   *          <CODE>null</CODE> if no such matching rule has been
230   *          defined in the server.
231   */
232  public static MatchingRule
233       getEqualityMatchingRule(String lowerName)
234  {
235    return DirectoryServer.getMatchingRule(lowerName);
236  }
237
238
239
240  /**
241   * Retrieves the ordering matching rule with the specified name or
242   * OID.
243   *
244   * @param  lowerName  The lowercase name or OID for the ordering
245   *                    matching rule to retrieve.
246   *
247   * @return  The requested ordering matching rule, or
248   *          <CODE>null</CODE> if no such matching rule has been
249   *          defined in the server.
250   */
251  public static MatchingRule
252       getOrderingMatchingRule(String lowerName)
253  {
254    return DirectoryServer.getMatchingRule(lowerName);
255  }
256
257
258
259  /**
260   * Retrieves the substring matching rule with the specified name or
261   * OID.
262   *
263   * @param  lowerName  The lowercase name or OID for the substring
264   *                    matching rule to retrieve.
265   *
266   * @return  The requested substring matching rule, or
267   *          <CODE>null</CODE> if no such matching rule has been
268   *          defined in the server.
269   */
270  public static MatchingRule
271       getSubstringMatchingRule(String lowerName)
272  {
273    return DirectoryServer.getMatchingRule(lowerName);
274  }
275
276
277
278  /**
279   * Retrieves the set of objectclasses registered with the Directory
280   * Server.  The mapping will be between the lowercase name or OID
281   * for each objectclass and the objectclass implementation.  The
282   * same objectclass instance may be included multiple times with
283   * different keys.  The returned map must not be altered by the
284   * caller.
285   *
286   * @return  The set of objectclasses defined in the Directory
287   *          Server.
288   */
289  public static Map<String,ObjectClass> getObjectClasses()
290  {
291    return DirectoryServer.getObjectClasses();
292  }
293
294
295
296  /**
297   * Retrieves the objectclass for the provided lowercase name or OID.
298   * It can optionally return a generated "default" version if the
299   * requested objectclass is not defined in the schema.
300   *
301   * @param  lowerName      The lowercase name or OID for the
302   *                        objectclass to retrieve.
303   * @param  returnDefault  Indicates whether to generate a default
304   *                        version if the requested objectclass is
305   *                        not defined in the server schema.
306   *
307   * @return  The objectclass type, or <CODE>null</CODE> if there is
308   *          no objectclass with the specified name or OID defined in
309   *          the server schema and a default class should not be
310   *          returned.
311   */
312  public static ObjectClass
313       getObjectClass(String lowerName, boolean returnDefault)
314  {
315    return DirectoryServer.getObjectClass(lowerName, returnDefault);
316  }
317
318
319
320  /**
321   * Retrieves the "top" objectClass, which should be the topmost
322   * objectclass in the inheritance chain for most other
323   * objectclasses.
324   *
325   * @return  The "top" objectClass.
326   */
327  public static ObjectClass getTopObjectClass()
328  {
329    return DirectoryServer.getTopObjectClass();
330  }
331
332
333
334  /**
335   * Retrieves the set of attribute type definitions that have been
336   * defined in the Directory Server.  The mapping will be between the
337   * lowercase name or OID for each attribute type and the attribute
338   * type implementation.  The same attribute type may be included
339   * multiple times with different keys.  The returned map must not be
340   * altered by the caller.
341   *
342   * @return The set of attribute type definitions that have been
343   *         defined in the Directory Server.
344   */
345  public static Collection<AttributeType> getAttributeTypes()
346  {
347    return DirectoryServer.getAttributeTypes();
348  }
349
350  /**
351   * Retrieves the attribute type for the "objectClass" attribute.
352   *
353   * @return  The attribute type for the "objectClass" attribute.
354   */
355  public static AttributeType getObjectClassAttributeType()
356  {
357    return DirectoryServer.getObjectClassAttributeType();
358  }
359
360
361
362  /**
363   * Retrieves the set of attribute syntaxes defined in the Directory
364   * Server.
365   *
366   * @return  The set of attribute syntaxes defined in the Directory
367   *          Server.
368   */
369  public static Collection<Syntax> getAttributeSyntaxes()
370  {
371    return DirectoryServer.getAttributeSyntaxes();
372  }
373
374  /**
375   * Retrieves the default attribute syntax that should be used for
376   * attributes that are not defined in the server schema and are
377   * meant to store binary values.
378   *
379   * @return  The default attribute syntax that should be used for
380   *          attributes that are not defined in the server schema and
381   *          are meant to store binary values.
382   */
383  public static Syntax getDefaultBinarySyntax()
384  {
385    return DirectoryServer.getDefaultBinarySyntax();
386  }
387
388
389
390  /**
391   * Retrieves the default attribute syntax that should be used for
392   * attributes that are not defined in the server schema and are
393   * meant to store Boolean values.
394   *
395   * @return  The default attribute syntax that should be used for
396   *          attributes that are not defined in the server schema and
397   *          are meant to store Boolean values.
398   */
399  public static Syntax getDefaultBooleanSyntax()
400  {
401    return DirectoryServer.getDefaultBooleanSyntax();
402  }
403
404
405
406  /**
407   * Retrieves the default attribute syntax that should be used for
408   * attributes that are not defined in the server schema and are
409   * meant to store DN values.
410   *
411   * @return  The default attribute syntax that should be used for
412   *          attributes that are not defined in the server schema and
413   *          are meant to store DN values.
414   */
415  public static Syntax getDefaultDNSyntax()
416  {
417    return DirectoryServer.getDefaultDNSyntax();
418  }
419
420
421
422  /**
423   * Retrieves the default attribute syntax that should be used for
424   * attributes that are not defined in the server schema and are
425   * meant to store integer values.
426   *
427   * @return  The default attribute syntax that should be used for
428   *          attributes that are not defined in the server schema and
429   *          are meant to store integer values.
430   */
431  public static Syntax getDefaultIntegerSyntax()
432  {
433    return DirectoryServer.getDefaultIntegerSyntax();
434  }
435
436
437
438  /**
439   * Retrieves the default attribute syntax that should be used for
440   * attributes that are not defined in the server schema and are
441   * meant to store string values.
442   *
443   * @return  The default attribute syntax that should be used for
444   *          attributes that are not defined in the server schema and
445   *          are meant to store string values.
446   */
447  public static Syntax getDefaultStringSyntax()
448  {
449    return DirectoryServer.getDefaultStringSyntax();
450  }
451
452
453
454  /**
455   * Retrieves the set of matching rule uses defined in the Directory
456   * Server.  The mapping will be between the matching rule and its
457   * corresponding matching rule use.  The returned map must not be
458   * altered by the caller.
459   *
460   * @return  The set of matching rule uses defined in the Directory
461   *          Server.
462   */
463  public static Map<MatchingRule,MatchingRuleUse>
464       getMatchingRuleUses()
465  {
466    return DirectoryServer.getMatchingRuleUses();
467  }
468
469
470
471  /**
472   * Retrieves the matching rule use associated with the provided
473   * matching rule.
474   *
475   * @param  matchingRule  The matching rule for which to retrieve the
476   *                       matching rule use.
477   *
478   * @return  The matching rule use for the provided matching rule, or
479   *          <CODE>null</CODE> if none is defined.
480   */
481  public static MatchingRuleUse
482       getMatchingRuleUse(MatchingRule matchingRule)
483  {
484    return DirectoryServer.getMatchingRuleUse(matchingRule);
485  }
486
487
488
489  /**
490   * Retrieves the set of DIT content rules defined in the Directory
491   * Server.  The mapping will be between the structural objectclass
492   * and its corresponding DIT content rule.  The returned map must
493   * not be altered by the caller.
494   *
495   * @return  The set of DIT content rules defined in the Directory
496   *          Server.
497   */
498  public static Map<ObjectClass,DITContentRule>
499       getDITContentRules()
500  {
501    return DirectoryServer.getDITContentRules();
502  }
503
504
505
506  /**
507   * Retrieves the DIT content rule associated with the specified
508   * objectclass.
509   *
510   * @param  objectClass  The objectclass for which to retrieve the
511   *                      associated DIT content rule.
512   *
513   * @return  The requested DIT content rule, or <CODE>null</CODE> if
514   *          no such rule is defined in the schema.
515   */
516  public static DITContentRule
517       getDITContentRule(ObjectClass objectClass)
518  {
519    return DirectoryServer.getDITContentRule(objectClass);
520  }
521
522
523
524  /**
525   * Retrieves the set of DIT structure rules defined in the Directory
526   * Server.  The mapping will be between the name form and its
527   * corresponding DIT structure rule.  The returned map must not be
528   * altered by the caller.
529   *
530   * @return  The set of DIT structure rules defined in the Directory
531   *          Server.
532   */
533  public static Map<NameForm,DITStructureRule>
534       getDITStructureRules()
535  {
536    return DirectoryServer.getDITStructureRules();
537  }
538
539
540
541  /**
542   * Retrieves the DIT structure rule associated with the provided
543   * rule ID.
544   *
545   * @param  ruleID  The rule ID for which to retrieve the associated
546   *                 DIT structure rule.
547   *
548   * @return  The requested DIT structure rule, or <CODE>null</CODE>
549   *          if no such rule is defined.
550   */
551  public static DITStructureRule getDITStructureRule(int ruleID)
552  {
553    return DirectoryServer.getDITStructureRule(ruleID);
554  }
555
556
557
558  /**
559   * Retrieves the DIT structure rule associated with the provided
560   * name form.
561   *
562   * @param  nameForm  The name form for which to retrieve the
563   *                   associated DIT structure rule.
564   *
565   * @return  The requested DIT structure rule, or <CODE>null</CODE>
566   *          if no such rule is defined.
567   */
568  public static DITStructureRule
569       getDITStructureRule(NameForm nameForm)
570  {
571    return DirectoryServer.getDITStructureRule(nameForm);
572  }
573
574
575
576  /**
577   * Retrieves the set of name forms defined in the Directory Server.
578   * The mapping will be between the structural objectclass and its
579   * corresponding name forms.  The returned map must not be altered
580   * by the caller.
581   *
582   * @return  The set of name forms defined in the Directory Server.
583   */
584  public static Map<ObjectClass,List<NameForm>> getNameForms()
585  {
586    return DirectoryServer.getNameForms();
587  }
588
589
590
591  /**
592   * Retrieves the list of name forms associated with the specified
593   * structural objectclass.
594   *
595   * @param  objectClass  The structural objectclass for which to
596   *                      retrieve the  associated name form.
597   *
598   * @return  The list of requested name forms, or <CODE>null</CODE>
599   *           if no such name form is defined in the schema.
600   */
601  public static List<NameForm> getNameForm(ObjectClass objectClass)
602  {
603    return DirectoryServer.getNameForm(objectClass);
604  }
605
606
607
608  /**
609   * Retrieves the name form associated with the specified name or
610   * OID.
611   *
612   * @param  lowerName  The name or OID of the name form to retrieve,
613   *                    formatted in all lowercase characters.
614   *
615   * @return  The requested name form, or <CODE>null</CODE> if no such
616   *          name form is defined in the schema.
617   */
618  public static NameForm getNameForm(String lowerName)
619  {
620    return DirectoryServer.getNameForm(lowerName);
621  }
622
623  /**
624   * Registers the provided alert generator with the Directory Server.
625   *
626   * @param  alertGenerator  The alert generator to register.
627   */
628  public static void registerAlertGenerator(
629                                AlertGenerator alertGenerator)
630  {
631    DirectoryServer.registerAlertGenerator(alertGenerator);
632  }
633
634
635
636  /**
637   * Deregisters the provided alert generator with the Directory
638   * Server.
639   *
640   * @param  alertGenerator  The alert generator to deregister.
641   */
642  public static void deregisterAlertGenerator(
643                                AlertGenerator alertGenerator)
644  {
645    DirectoryServer.deregisterAlertGenerator(alertGenerator);
646  }
647
648
649
650  /**
651   * Sends an alert notification with the provided information.
652   *
653   * @param  generator     The alert generator that created the alert.
654   * @param  alertType     The alert type name for this alert.
655   * @param  alertMessage  A message (possibly <CODE>null</CODE>) that
656   *                       can provide more information about this
657   *                       alert.
658   */
659  public static void
660       sendAlertNotification(AlertGenerator generator,
661                             String alertType,
662                             LocalizableMessage alertMessage)
663  {
664    DirectoryServer.sendAlertNotification(generator, alertType,
665            alertMessage);
666  }
667
668
669
670  /**
671   * Retrieves the result code that should be used when the Directory
672   * Server encounters an internal server error.
673   *
674   * @return  The result code that should be used when the Directory
675   *          Server encounters an internal server error.
676   */
677  public static ResultCode getServerErrorResultCode()
678  {
679    return DirectoryServer.getServerErrorResultCode();
680  }
681
682
683
684  /**
685   * Retrieves the entry with the requested DN.  It will first
686   * determine which backend should be used for this DN and will then
687   * use that backend to retrieve the entry.  The caller must already
688   * hold the appropriate lock on the specified entry.
689   *
690   * @param  entryDN  The DN of the entry to retrieve.
691   *
692   * @return  The requested entry, or <CODE>null</CODE> if it does not
693   *          exist.
694   *
695   * @throws  DirectoryException  If a problem occurs while attempting
696   *                              to retrieve the entry.
697   */
698  public static Entry getEntry(DN entryDN)
699         throws DirectoryException
700  {
701    return DirectoryServer.getEntry(entryDN);
702  }
703
704
705
706  /**
707   * Indicates whether the specified entry exists in the Directory
708   * Server.  The caller is not required to hold any locks when
709   * invoking this method.
710   *
711   * @param  entryDN  The DN of the entry for which to make the
712   *                  determination.
713   *
714   * @return  <CODE>true</CODE> if the specified entry exists in one
715   *          of the backends, or <CODE>false</CODE> if it does not.
716   *
717   * @throws  DirectoryException  If a problem occurs while attempting
718   *                              to make the determination.
719   */
720  public static boolean entryExists(DN entryDN)
721         throws DirectoryException
722  {
723    return DirectoryServer.entryExists(entryDN);
724  }
725
726
727
728  /**
729   * Retrieves the set of OIDs for the supported controls registered
730   * with the Directory Server.
731   *
732   * @return  The set of OIDS for the supported controls registered
733   *          with the Directory Server.
734   */
735  public static Set<String> getSupportedControls()
736  {
737    return DirectoryServer.getSupportedControls();
738  }
739
740
741
742  /**
743   * Indicates whether the specified OID is registered with the
744   * Directory Server as a supported control.
745   *
746   * @param  controlOID  The OID of the control for which to make the
747   *                     determination.
748   *
749   * @return  <CODE>true</CODE> if the specified OID is registered
750   *          with the server as a supported control, or
751   *          <CODE>false</CODE> if not.
752   */
753  public static boolean isSupportedControl(String controlOID)
754  {
755    return DirectoryServer.isSupportedControl(controlOID);
756  }
757
758
759
760  /**
761   * Registers the provided OID as a supported control for the
762   * Directory Server.  This will have no effect if the specified
763   * control OID is already present in the list of supported controls.
764   *
765   * @param  controlOID  The OID of the control to register as a
766   *                     supported control.
767   */
768  public static void registerSupportedControl(String controlOID)
769  {
770    DirectoryServer.registerSupportedControl(controlOID);
771  }
772
773
774
775  /**
776   * Deregisters the provided OID as a supported control for the
777   * Directory Server.  This will have no effect if the specified
778   * control OID is not present in the list of supported controls.
779   *
780   * @param  controlOID  The OID of the control to deregister as a
781   *                     supported control.
782   */
783  public static void
784       deregisterSupportedControl(String controlOID)
785  {
786    DirectoryServer.deregisterSupportedControl(controlOID);
787  }
788
789
790
791  /**
792   * Retrieves the set of OIDs for the supported features registered
793   * with the Directory Server.
794   *
795   * @return  The set of OIDs for the supported features registered
796   *          with the Directory Server.
797   */
798  public static Set<String> getSupportedFeatures()
799  {
800    return DirectoryServer.getSupportedFeatures();
801  }
802
803
804
805  /**
806   * Indicates whether the specified OID is registered with the
807   * Directory Server as a supported feature.
808   *
809   * @param  featureOID  The OID of the feature for which to make the
810   *                     determination.
811   *
812   * @return  <CODE>true</CODE> if the specified OID is registered
813   *          with the server as a supported feature, or
814   *          <CODE>false</CODE> if not.
815   */
816  public static boolean isSupportedFeature(String featureOID)
817  {
818    return DirectoryServer.isSupportedFeature(featureOID);
819  }
820
821
822
823  /**
824   * Registers the provided OID as a supported feature for the
825   * Directory Server.  This will have no effect if the specified
826   * feature OID is already present in the list of supported features.
827   *
828   * @param  featureOID  The OID of the feature to register as a
829   *                     supported feature.
830   */
831  public static void registerSupportedFeature(String featureOID)
832  {
833    DirectoryServer.registerSupportedFeature(featureOID);
834  }
835
836
837
838  /**
839   * Deregisters the provided OID as a supported feature for the
840   * Directory Server.  This will have no effect if the specified
841   * feature OID is not present in the list of supported features.
842   *
843   * @param  featureOID  The OID of the feature to deregister as a
844   *                     supported feature.
845   */
846  public static void
847       deregisterSupportedFeature(String featureOID)
848  {
849    DirectoryServer.deregisterSupportedFeature(featureOID);
850  }
851
852
853
854  /**
855   * Retrieves the set of extended operations that may be processed by
856   * the Directory Server.  The mapping will be between the OID and
857   * the extended operation handler providing the logic for the
858   * extended operation with that OID.  The returned map must not be
859   * altered by the caller.
860   *
861   * @return  The set of extended operations that may be processed by
862   *          the Directory Server.
863   */
864  public static Map<String,ExtendedOperationHandler>
865                     getSupportedExtensions()
866  {
867    return DirectoryServer.getSupportedExtensions();
868  }
869
870
871
872  /**
873   * Retrieves the handler for the extended operation for the provided
874   * extended operation OID.
875   *
876   * @param  oid  The OID of the extended operation to retrieve.
877   *
878   * @return  The handler for the specified extended operation, or
879   *          <CODE>null</CODE> if there is none.
880   */
881  public static ExtendedOperationHandler
882       getExtendedOperationHandler(String oid)
883  {
884    return DirectoryServer.getExtendedOperationHandler(oid);
885  }
886
887
888
889  /**
890   * Registers the provided extended operation handler with the
891   * Directory Server.
892   *
893   * @param  oid      The OID for the extended operation to register.
894   * @param  handler  The extended operation handler to register with
895   *                  the Directory Server.
896   */
897  public static void registerSupportedExtension(String oid,
898                          ExtendedOperationHandler handler)
899  {
900    DirectoryServer.registerSupportedExtension(oid, handler);
901  }
902
903
904
905  /**
906   * Deregisters the provided extended operation handler with the
907   * Directory Server.
908   *
909   * @param  oid  The OID for the extended operation to deregister.
910   */
911  public static void deregisterSupportedExtension(String oid)
912  {
913    DirectoryServer.deregisterSupportedExtension(oid);
914  }
915
916
917
918  /**
919   * Retrieves the set of SASL mechanisms that are supported by the
920   * Directory Server.  The mapping will be between the mechanism name
921   * and the SASL mechanism handler that implements support for that
922   * mechanism.  The returned map must not be altered by the caller.
923   *
924   * @return  The set of SASL mechanisms that are supported by the
925   *          Directory Server.
926   */
927  public static Map<String,SASLMechanismHandler>
928                     getSupportedSASLMechanisms()
929  {
930    return DirectoryServer.getSupportedSASLMechanisms();
931  }
932
933
934
935  /**
936   * Retrieves the handler for the specified SASL mechanism.
937   *
938   * @param  name  The name of the SASL mechanism to retrieve.
939   *
940   * @return  The handler for the specified SASL mechanism, or
941   *          <CODE>null</CODE> if there is none.
942   */
943  public static SASLMechanismHandler
944       getSASLMechanismHandler(String name)
945  {
946    return DirectoryServer.getSASLMechanismHandler(name);
947  }
948
949
950
951  /**
952   * Registers the provided SASL mechanism handler with the Directory
953   * Server.
954   *
955   * @param  name     The name of the SASL mechanism to be registered.
956   * @param  handler  The SASL mechanism handler to register with the
957   *                  Directory Server.
958   */
959  public static void
960       registerSASLMechanismHandler(String name,
961                                    SASLMechanismHandler handler)
962  {
963    DirectoryServer.registerSASLMechanismHandler(name, handler);
964  }
965
966
967
968  /**
969   * Deregisters the provided SASL mechanism handler with the
970   * Directory Server.
971   *
972   * @param  name  The name of the SASL mechanism to be deregistered.
973   */
974  public static void deregisterSASLMechanismHandler(String name)
975  {
976    DirectoryServer.deregisterSASLMechanismHandler(name);
977  }
978
979  /**
980   * Registers the provided shutdown listener with the Directory
981   * Server so that it will be notified when the server shuts down.
982   *
983   * @param  listener  The shutdown listener to register with the
984   *                   Directory Server.
985   */
986  public static void
987       registerShutdownListener(ServerShutdownListener listener)
988  {
989    DirectoryServer.registerShutdownListener(listener);
990  }
991
992
993
994  /**
995   * Deregisters the provided shutdown listener with the Directory
996   * Server.
997   *
998   * @param  listener  The shutdown listener to deregister with the
999   *                   Directory Server.
1000   */
1001  public static void
1002       deregisterShutdownListener(ServerShutdownListener listener)
1003  {
1004    DirectoryServer.deregisterShutdownListener(listener);
1005  }
1006
1007
1008
1009  /**
1010   * Retrieves the full version string for the Directory Server.
1011   *
1012   * @return  The full version string for the Directory Server.
1013   */
1014  public static String getVersionString()
1015  {
1016    return DirectoryServer.getVersionString();
1017  }
1018}
1019