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