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 2008 Sun Microsystems, Inc. 015 */ 016package org.forgerock.opendj.server.config.meta; 017 018 019 020import java.net.InetAddress; 021import java.util.Collection; 022import java.util.SortedSet; 023import org.forgerock.opendj.config.AdministratorAction; 024import org.forgerock.opendj.config.AggregationPropertyDefinition; 025import org.forgerock.opendj.config.AliasDefaultBehaviorProvider; 026import org.forgerock.opendj.config.client.ConcurrentModificationException; 027import org.forgerock.opendj.config.client.ManagedObject; 028import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException; 029import org.forgerock.opendj.config.client.OperationRejectedException; 030import org.forgerock.opendj.config.conditions.Conditions; 031import org.forgerock.opendj.config.DefaultBehaviorProvider; 032import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider; 033import org.forgerock.opendj.config.IntegerPropertyDefinition; 034import org.forgerock.opendj.config.IPAddressMaskPropertyDefinition; 035import org.forgerock.opendj.config.IPAddressPropertyDefinition; 036import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException; 037import org.forgerock.opendj.config.ManagedObjectDefinition; 038import org.forgerock.opendj.config.PropertyOption; 039import org.forgerock.opendj.config.PropertyProvider; 040import org.forgerock.opendj.config.server.ConfigurationChangeListener; 041import org.forgerock.opendj.config.server.ServerManagedObject; 042import org.forgerock.opendj.config.StringPropertyDefinition; 043import org.forgerock.opendj.config.Tag; 044import org.forgerock.opendj.config.TopCfgDefn; 045import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider; 046import org.forgerock.opendj.ldap.AddressMask; 047import org.forgerock.opendj.ldap.DN; 048import org.forgerock.opendj.ldap.LdapException; 049import org.forgerock.opendj.server.config.client.AdministrationConnectorCfgClient; 050import org.forgerock.opendj.server.config.client.KeyManagerProviderCfgClient; 051import org.forgerock.opendj.server.config.client.TrustManagerProviderCfgClient; 052import org.forgerock.opendj.server.config.server.AdministrationConnectorCfg; 053import org.forgerock.opendj.server.config.server.KeyManagerProviderCfg; 054import org.forgerock.opendj.server.config.server.TrustManagerProviderCfg; 055 056 057 058/** 059 * An interface for querying the Administration Connector managed 060 * object definition meta information. 061 * <p> 062 * The Administration Connector is used to interact with 063 * administration tools using LDAP. 064 */ 065public final class AdministrationConnectorCfgDefn extends ManagedObjectDefinition<AdministrationConnectorCfgClient, AdministrationConnectorCfg> { 066 067 /** The singleton configuration definition instance. */ 068 private static final AdministrationConnectorCfgDefn INSTANCE = new AdministrationConnectorCfgDefn(); 069 070 071 072 /** The "allowed-client" property definition. */ 073 private static final IPAddressMaskPropertyDefinition PD_ALLOWED_CLIENT; 074 075 076 077 /** The "denied-client" property definition. */ 078 private static final IPAddressMaskPropertyDefinition PD_DENIED_CLIENT; 079 080 081 082 /** The "key-manager-provider" property definition. */ 083 private static final AggregationPropertyDefinition<KeyManagerProviderCfgClient, KeyManagerProviderCfg> PD_KEY_MANAGER_PROVIDER; 084 085 086 087 /** The "listen-address" property definition. */ 088 private static final IPAddressPropertyDefinition PD_LISTEN_ADDRESS; 089 090 091 092 /** The "listen-port" property definition. */ 093 private static final IntegerPropertyDefinition PD_LISTEN_PORT; 094 095 096 097 /** The "ssl-cert-nickname" property definition. */ 098 private static final StringPropertyDefinition PD_SSL_CERT_NICKNAME; 099 100 101 102 /** The "ssl-cipher-suite" property definition. */ 103 private static final StringPropertyDefinition PD_SSL_CIPHER_SUITE; 104 105 106 107 /** The "ssl-protocol" property definition. */ 108 private static final StringPropertyDefinition PD_SSL_PROTOCOL; 109 110 111 112 /** The "trust-manager-provider" property definition. */ 113 private static final AggregationPropertyDefinition<TrustManagerProviderCfgClient, TrustManagerProviderCfg> PD_TRUST_MANAGER_PROVIDER; 114 115 116 117 /** Build the "allowed-client" property definition. */ 118 static { 119 IPAddressMaskPropertyDefinition.Builder builder = IPAddressMaskPropertyDefinition.createBuilder(INSTANCE, "allowed-client"); 120 builder.setOption(PropertyOption.MULTI_VALUED); 121 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "allowed-client")); 122 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<AddressMask>(INSTANCE, "allowed-client")); 123 PD_ALLOWED_CLIENT = builder.getInstance(); 124 INSTANCE.registerPropertyDefinition(PD_ALLOWED_CLIENT); 125 } 126 127 128 129 /** Build the "denied-client" property definition. */ 130 static { 131 IPAddressMaskPropertyDefinition.Builder builder = IPAddressMaskPropertyDefinition.createBuilder(INSTANCE, "denied-client"); 132 builder.setOption(PropertyOption.MULTI_VALUED); 133 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "denied-client")); 134 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<AddressMask>(INSTANCE, "denied-client")); 135 PD_DENIED_CLIENT = builder.getInstance(); 136 INSTANCE.registerPropertyDefinition(PD_DENIED_CLIENT); 137 } 138 139 140 141 /** Build the "key-manager-provider" property definition. */ 142 static { 143 AggregationPropertyDefinition.Builder<KeyManagerProviderCfgClient, KeyManagerProviderCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "key-manager-provider"); 144 builder.setOption(PropertyOption.MANDATORY); 145 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.SERVER_RESTART, INSTANCE, "key-manager-provider")); 146 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>()); 147 builder.setParentPath("/"); 148 builder.setRelationDefinition("key-manager-provider"); 149 builder.setTargetIsEnabledCondition(Conditions.contains("enabled", "true")); 150 PD_KEY_MANAGER_PROVIDER = builder.getInstance(); 151 INSTANCE.registerPropertyDefinition(PD_KEY_MANAGER_PROVIDER); 152 INSTANCE.registerConstraint(PD_KEY_MANAGER_PROVIDER.getSourceConstraint()); 153 } 154 155 156 157 /** Build the "listen-address" property definition. */ 158 static { 159 IPAddressPropertyDefinition.Builder builder = IPAddressPropertyDefinition.createBuilder(INSTANCE, "listen-address"); 160 builder.setOption(PropertyOption.MULTI_VALUED); 161 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.SERVER_RESTART, INSTANCE, "listen-address")); 162 DefaultBehaviorProvider<InetAddress> provider = new DefinedDefaultBehaviorProvider<InetAddress>("0.0.0.0"); 163 builder.setDefaultBehaviorProvider(provider); 164 PD_LISTEN_ADDRESS = builder.getInstance(); 165 INSTANCE.registerPropertyDefinition(PD_LISTEN_ADDRESS); 166 } 167 168 169 170 /** Build the "listen-port" property definition. */ 171 static { 172 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "listen-port"); 173 builder.setOption(PropertyOption.MANDATORY); 174 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "listen-port")); 175 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<Integer>()); 176 builder.setUpperLimit(65535); 177 builder.setLowerLimit(1); 178 PD_LISTEN_PORT = builder.getInstance(); 179 INSTANCE.registerPropertyDefinition(PD_LISTEN_PORT); 180 } 181 182 183 184 /** Build the "ssl-cert-nickname" property definition. */ 185 static { 186 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-cert-nickname"); 187 builder.setOption(PropertyOption.MULTI_VALUED); 188 builder.setOption(PropertyOption.MANDATORY); 189 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.SERVER_RESTART, INSTANCE, "ssl-cert-nickname")); 190 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cert-nickname")); 191 PD_SSL_CERT_NICKNAME = builder.getInstance(); 192 INSTANCE.registerPropertyDefinition(PD_SSL_CERT_NICKNAME); 193 } 194 195 196 197 /** Build the "ssl-cipher-suite" property definition. */ 198 static { 199 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-cipher-suite"); 200 builder.setOption(PropertyOption.MULTI_VALUED); 201 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-cipher-suite")); 202 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cipher-suite")); 203 PD_SSL_CIPHER_SUITE = builder.getInstance(); 204 INSTANCE.registerPropertyDefinition(PD_SSL_CIPHER_SUITE); 205 } 206 207 208 209 /** Build the "ssl-protocol" property definition. */ 210 static { 211 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-protocol"); 212 builder.setOption(PropertyOption.MULTI_VALUED); 213 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-protocol")); 214 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-protocol")); 215 PD_SSL_PROTOCOL = builder.getInstance(); 216 INSTANCE.registerPropertyDefinition(PD_SSL_PROTOCOL); 217 } 218 219 220 221 /** Build the "trust-manager-provider" property definition. */ 222 static { 223 AggregationPropertyDefinition.Builder<TrustManagerProviderCfgClient, TrustManagerProviderCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "trust-manager-provider"); 224 builder.setOption(PropertyOption.MANDATORY); 225 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.SERVER_RESTART, INSTANCE, "trust-manager-provider")); 226 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>()); 227 builder.setParentPath("/"); 228 builder.setRelationDefinition("trust-manager-provider"); 229 builder.setTargetIsEnabledCondition(Conditions.contains("enabled", "true")); 230 PD_TRUST_MANAGER_PROVIDER = builder.getInstance(); 231 INSTANCE.registerPropertyDefinition(PD_TRUST_MANAGER_PROVIDER); 232 INSTANCE.registerConstraint(PD_TRUST_MANAGER_PROVIDER.getSourceConstraint()); 233 } 234 235 236 237 // Register the tags associated with this managed object definition. 238 static { 239 INSTANCE.registerTag(Tag.valueOf("core-server")); 240 } 241 242 243 244 /** 245 * Get the Administration Connector configuration definition 246 * singleton. 247 * 248 * @return Returns the Administration Connector configuration 249 * definition singleton. 250 */ 251 public static AdministrationConnectorCfgDefn getInstance() { 252 return INSTANCE; 253 } 254 255 256 257 /** 258 * Private constructor. 259 */ 260 private AdministrationConnectorCfgDefn() { 261 super("administration-connector", TopCfgDefn.getInstance()); 262 } 263 264 265 266 /** {@inheritDoc} */ 267 public AdministrationConnectorCfgClient createClientConfiguration( 268 ManagedObject<? extends AdministrationConnectorCfgClient> impl) { 269 return new AdministrationConnectorCfgClientImpl(impl); 270 } 271 272 273 274 /** {@inheritDoc} */ 275 public AdministrationConnectorCfg createServerConfiguration( 276 ServerManagedObject<? extends AdministrationConnectorCfg> impl) { 277 return new AdministrationConnectorCfgServerImpl(impl); 278 } 279 280 281 282 /** {@inheritDoc} */ 283 public Class<AdministrationConnectorCfg> getServerConfigurationClass() { 284 return AdministrationConnectorCfg.class; 285 } 286 287 288 289 /** 290 * Get the "allowed-client" property definition. 291 * <p> 292 * Specifies a set of host names or address masks that determine the 293 * clients that are allowed to establish connections to this 294 * Administration Connector. 295 * <p> 296 * Valid values include a host name, a fully qualified domain name, 297 * a domain name, an IP address, or a subnetwork with subnetwork 298 * mask. 299 * 300 * @return Returns the "allowed-client" property definition. 301 */ 302 public IPAddressMaskPropertyDefinition getAllowedClientPropertyDefinition() { 303 return PD_ALLOWED_CLIENT; 304 } 305 306 307 308 /** 309 * Get the "denied-client" property definition. 310 * <p> 311 * Specifies a set of host names or address masks that determine the 312 * clients that are not allowed to establish connections to this 313 * Administration Connector. 314 * <p> 315 * Valid values include a host name, a fully qualified domain name, 316 * a domain name, an IP address, or a subnetwork with subnetwork 317 * mask. If both allowed and denied client masks are defined and a 318 * client connection matches one or more masks in both lists, then 319 * the connection is denied. If only a denied list is specified, then 320 * any client not matching a mask in that list is allowed. 321 * 322 * @return Returns the "denied-client" property definition. 323 */ 324 public IPAddressMaskPropertyDefinition getDeniedClientPropertyDefinition() { 325 return PD_DENIED_CLIENT; 326 } 327 328 329 330 /** 331 * Get the "key-manager-provider" property definition. 332 * <p> 333 * Specifies the name of the key manager that is used with the 334 * Administration Connector . 335 * 336 * @return Returns the "key-manager-provider" property definition. 337 */ 338 public AggregationPropertyDefinition<KeyManagerProviderCfgClient, KeyManagerProviderCfg> getKeyManagerProviderPropertyDefinition() { 339 return PD_KEY_MANAGER_PROVIDER; 340 } 341 342 343 344 /** 345 * Get the "listen-address" property definition. 346 * <p> 347 * Specifies the address or set of addresses on which this 348 * Administration Connector should listen for connections from LDAP 349 * clients. 350 * <p> 351 * Multiple addresses may be provided as separate values for this 352 * attribute. If no values are provided, then the Administration 353 * Connector listens on all interfaces. 354 * 355 * @return Returns the "listen-address" property definition. 356 */ 357 public IPAddressPropertyDefinition getListenAddressPropertyDefinition() { 358 return PD_LISTEN_ADDRESS; 359 } 360 361 362 363 /** 364 * Get the "listen-port" property definition. 365 * <p> 366 * Specifies the port number on which the Administration Connector 367 * will listen for connections from clients. 368 * <p> 369 * Only a single port number may be provided. 370 * 371 * @return Returns the "listen-port" property definition. 372 */ 373 public IntegerPropertyDefinition getListenPortPropertyDefinition() { 374 return PD_LISTEN_PORT; 375 } 376 377 378 379 /** 380 * Get the "ssl-cert-nickname" property definition. 381 * <p> 382 * Specifies the nicknames (also called the aliases) of the keys or 383 * key pairs that the Administration Connector should use when 384 * performing SSL communication. The property can be used multiple 385 * times (referencing different nicknames) when server certificates 386 * with different public key algorithms are used in parallel (for 387 * example, RSA, DSA, and ECC-based algorithms). When a nickname 388 * refers to an asymmetric (public/private) key pair, the nickname 389 * for the public key certificate and associated private key entry 390 * must match exactly. A single nickname is used to retrieve both the 391 * public key and the private key. 392 * 393 * @return Returns the "ssl-cert-nickname" property definition. 394 */ 395 public StringPropertyDefinition getSSLCertNicknamePropertyDefinition() { 396 return PD_SSL_CERT_NICKNAME; 397 } 398 399 400 401 /** 402 * Get the "ssl-cipher-suite" property definition. 403 * <p> 404 * Specifies the names of the SSL cipher suites that are allowed for 405 * use in SSL communication. 406 * 407 * @return Returns the "ssl-cipher-suite" property definition. 408 */ 409 public StringPropertyDefinition getSSLCipherSuitePropertyDefinition() { 410 return PD_SSL_CIPHER_SUITE; 411 } 412 413 414 415 /** 416 * Get the "ssl-protocol" property definition. 417 * <p> 418 * Specifies the names of the SSL protocols that are allowed for use 419 * in SSL or StartTLS communication. 420 * 421 * @return Returns the "ssl-protocol" property definition. 422 */ 423 public StringPropertyDefinition getSSLProtocolPropertyDefinition() { 424 return PD_SSL_PROTOCOL; 425 } 426 427 428 429 /** 430 * Get the "trust-manager-provider" property definition. 431 * <p> 432 * Specifies the name of the trust manager that is used with the 433 * Administration Connector . 434 * 435 * @return Returns the "trust-manager-provider" property definition. 436 */ 437 public AggregationPropertyDefinition<TrustManagerProviderCfgClient, TrustManagerProviderCfg> getTrustManagerProviderPropertyDefinition() { 438 return PD_TRUST_MANAGER_PROVIDER; 439 } 440 441 442 443 /** 444 * Managed object client implementation. 445 */ 446 private static class AdministrationConnectorCfgClientImpl implements 447 AdministrationConnectorCfgClient { 448 449 /** Private implementation. */ 450 private ManagedObject<? extends AdministrationConnectorCfgClient> impl; 451 452 453 454 /** Private constructor. */ 455 private AdministrationConnectorCfgClientImpl( 456 ManagedObject<? extends AdministrationConnectorCfgClient> impl) { 457 this.impl = impl; 458 } 459 460 461 462 /** {@inheritDoc} */ 463 public SortedSet<AddressMask> getAllowedClient() { 464 return impl.getPropertyValues(INSTANCE.getAllowedClientPropertyDefinition()); 465 } 466 467 468 469 /** {@inheritDoc} */ 470 public void setAllowedClient(Collection<AddressMask> values) { 471 impl.setPropertyValues(INSTANCE.getAllowedClientPropertyDefinition(), values); 472 } 473 474 475 476 /** {@inheritDoc} */ 477 public SortedSet<AddressMask> getDeniedClient() { 478 return impl.getPropertyValues(INSTANCE.getDeniedClientPropertyDefinition()); 479 } 480 481 482 483 /** {@inheritDoc} */ 484 public void setDeniedClient(Collection<AddressMask> values) { 485 impl.setPropertyValues(INSTANCE.getDeniedClientPropertyDefinition(), values); 486 } 487 488 489 490 /** {@inheritDoc} */ 491 public String getKeyManagerProvider() { 492 return impl.getPropertyValue(INSTANCE.getKeyManagerProviderPropertyDefinition()); 493 } 494 495 496 497 /** {@inheritDoc} */ 498 public void setKeyManagerProvider(String value) { 499 impl.setPropertyValue(INSTANCE.getKeyManagerProviderPropertyDefinition(), value); 500 } 501 502 503 504 /** {@inheritDoc} */ 505 public SortedSet<InetAddress> getListenAddress() { 506 return impl.getPropertyValues(INSTANCE.getListenAddressPropertyDefinition()); 507 } 508 509 510 511 /** {@inheritDoc} */ 512 public void setListenAddress(Collection<InetAddress> values) { 513 impl.setPropertyValues(INSTANCE.getListenAddressPropertyDefinition(), values); 514 } 515 516 517 518 /** {@inheritDoc} */ 519 public Integer getListenPort() { 520 return impl.getPropertyValue(INSTANCE.getListenPortPropertyDefinition()); 521 } 522 523 524 525 /** {@inheritDoc} */ 526 public void setListenPort(int value) { 527 impl.setPropertyValue(INSTANCE.getListenPortPropertyDefinition(), value); 528 } 529 530 531 532 /** {@inheritDoc} */ 533 public SortedSet<String> getSSLCertNickname() { 534 return impl.getPropertyValues(INSTANCE.getSSLCertNicknamePropertyDefinition()); 535 } 536 537 538 539 /** {@inheritDoc} */ 540 public void setSSLCertNickname(Collection<String> values) { 541 impl.setPropertyValues(INSTANCE.getSSLCertNicknamePropertyDefinition(), values); 542 } 543 544 545 546 /** {@inheritDoc} */ 547 public SortedSet<String> getSSLCipherSuite() { 548 return impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 549 } 550 551 552 553 /** {@inheritDoc} */ 554 public void setSSLCipherSuite(Collection<String> values) { 555 impl.setPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition(), values); 556 } 557 558 559 560 /** {@inheritDoc} */ 561 public SortedSet<String> getSSLProtocol() { 562 return impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 563 } 564 565 566 567 /** {@inheritDoc} */ 568 public void setSSLProtocol(Collection<String> values) { 569 impl.setPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition(), values); 570 } 571 572 573 574 /** {@inheritDoc} */ 575 public String getTrustManagerProvider() { 576 return impl.getPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition()); 577 } 578 579 580 581 /** {@inheritDoc} */ 582 public void setTrustManagerProvider(String value) { 583 impl.setPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition(), value); 584 } 585 586 587 588 /** {@inheritDoc} */ 589 public ManagedObjectDefinition<? extends AdministrationConnectorCfgClient, ? extends AdministrationConnectorCfg> definition() { 590 return INSTANCE; 591 } 592 593 594 595 /** {@inheritDoc} */ 596 public PropertyProvider properties() { 597 return impl; 598 } 599 600 601 602 /** {@inheritDoc} */ 603 public void commit() throws ManagedObjectAlreadyExistsException, 604 MissingMandatoryPropertiesException, ConcurrentModificationException, 605 OperationRejectedException, LdapException { 606 impl.commit(); 607 } 608 609 610 611 /** {@inheritDoc} */ 612 public String toString() { 613 return impl.toString(); 614 } 615 } 616 617 618 619 /** 620 * Managed object server implementation. 621 */ 622 private static class AdministrationConnectorCfgServerImpl implements 623 AdministrationConnectorCfg { 624 625 /** Private implementation. */ 626 private ServerManagedObject<? extends AdministrationConnectorCfg> impl; 627 628 /** The value of the "allowed-client" property. */ 629 private final SortedSet<AddressMask> pAllowedClient; 630 631 /** The value of the "denied-client" property. */ 632 private final SortedSet<AddressMask> pDeniedClient; 633 634 /** The value of the "key-manager-provider" property. */ 635 private final String pKeyManagerProvider; 636 637 /** The value of the "listen-address" property. */ 638 private final SortedSet<InetAddress> pListenAddress; 639 640 /** The value of the "listen-port" property. */ 641 private final int pListenPort; 642 643 /** The value of the "ssl-cert-nickname" property. */ 644 private final SortedSet<String> pSSLCertNickname; 645 646 /** The value of the "ssl-cipher-suite" property. */ 647 private final SortedSet<String> pSSLCipherSuite; 648 649 /** The value of the "ssl-protocol" property. */ 650 private final SortedSet<String> pSSLProtocol; 651 652 /** The value of the "trust-manager-provider" property. */ 653 private final String pTrustManagerProvider; 654 655 656 657 /** Private constructor. */ 658 private AdministrationConnectorCfgServerImpl(ServerManagedObject<? extends AdministrationConnectorCfg> impl) { 659 this.impl = impl; 660 this.pAllowedClient = impl.getPropertyValues(INSTANCE.getAllowedClientPropertyDefinition()); 661 this.pDeniedClient = impl.getPropertyValues(INSTANCE.getDeniedClientPropertyDefinition()); 662 this.pKeyManagerProvider = impl.getPropertyValue(INSTANCE.getKeyManagerProviderPropertyDefinition()); 663 this.pListenAddress = impl.getPropertyValues(INSTANCE.getListenAddressPropertyDefinition()); 664 this.pListenPort = impl.getPropertyValue(INSTANCE.getListenPortPropertyDefinition()); 665 this.pSSLCertNickname = impl.getPropertyValues(INSTANCE.getSSLCertNicknamePropertyDefinition()); 666 this.pSSLCipherSuite = impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 667 this.pSSLProtocol = impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 668 this.pTrustManagerProvider = impl.getPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition()); 669 } 670 671 672 673 /** {@inheritDoc} */ 674 public void addChangeListener( 675 ConfigurationChangeListener<AdministrationConnectorCfg> listener) { 676 impl.registerChangeListener(listener); 677 } 678 679 680 681 /** {@inheritDoc} */ 682 public void removeChangeListener( 683 ConfigurationChangeListener<AdministrationConnectorCfg> listener) { 684 impl.deregisterChangeListener(listener); 685 } 686 687 688 689 /** {@inheritDoc} */ 690 public SortedSet<AddressMask> getAllowedClient() { 691 return pAllowedClient; 692 } 693 694 695 696 /** {@inheritDoc} */ 697 public SortedSet<AddressMask> getDeniedClient() { 698 return pDeniedClient; 699 } 700 701 702 703 /** {@inheritDoc} */ 704 public String getKeyManagerProvider() { 705 return pKeyManagerProvider; 706 } 707 708 709 710 /** 711 * {@inheritDoc} 712 */ 713 public DN getKeyManagerProviderDN() { 714 String value = getKeyManagerProvider(); 715 if (value == null) return null; 716 return INSTANCE.getKeyManagerProviderPropertyDefinition().getChildDN(value); 717 } 718 719 720 721 /** {@inheritDoc} */ 722 public SortedSet<InetAddress> getListenAddress() { 723 return pListenAddress; 724 } 725 726 727 728 /** {@inheritDoc} */ 729 public int getListenPort() { 730 return pListenPort; 731 } 732 733 734 735 /** {@inheritDoc} */ 736 public SortedSet<String> getSSLCertNickname() { 737 return pSSLCertNickname; 738 } 739 740 741 742 /** {@inheritDoc} */ 743 public SortedSet<String> getSSLCipherSuite() { 744 return pSSLCipherSuite; 745 } 746 747 748 749 /** {@inheritDoc} */ 750 public SortedSet<String> getSSLProtocol() { 751 return pSSLProtocol; 752 } 753 754 755 756 /** {@inheritDoc} */ 757 public String getTrustManagerProvider() { 758 return pTrustManagerProvider; 759 } 760 761 762 763 /** 764 * {@inheritDoc} 765 */ 766 public DN getTrustManagerProviderDN() { 767 String value = getTrustManagerProvider(); 768 if (value == null) return null; 769 return INSTANCE.getTrustManagerProviderPropertyDefinition().getChildDN(value); 770 } 771 772 773 774 /** {@inheritDoc} */ 775 public Class<? extends AdministrationConnectorCfg> configurationClass() { 776 return AdministrationConnectorCfg.class; 777 } 778 779 780 781 /** {@inheritDoc} */ 782 public DN dn() { 783 return impl.getDN(); 784 } 785 786 787 788 /** {@inheritDoc} */ 789 public String toString() { 790 return impl.toString(); 791 } 792 } 793}