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 legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2008 Sun Microsystems, Inc. 025 */ 026package org.forgerock.opendj.server.config.meta; 027 028 029 030import java.net.InetAddress; 031import java.util.Collection; 032import java.util.SortedSet; 033import org.forgerock.opendj.config.AdministratorAction; 034import org.forgerock.opendj.config.AggregationPropertyDefinition; 035import org.forgerock.opendj.config.AliasDefaultBehaviorProvider; 036import org.forgerock.opendj.config.BooleanPropertyDefinition; 037import org.forgerock.opendj.config.ClassPropertyDefinition; 038import org.forgerock.opendj.config.client.ConcurrentModificationException; 039import org.forgerock.opendj.config.client.ManagedObject; 040import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException; 041import org.forgerock.opendj.config.client.OperationRejectedException; 042import org.forgerock.opendj.config.conditions.Conditions; 043import org.forgerock.opendj.config.DefaultBehaviorProvider; 044import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider; 045import org.forgerock.opendj.config.DurationPropertyDefinition; 046import org.forgerock.opendj.config.EnumPropertyDefinition; 047import org.forgerock.opendj.config.GenericConstraint; 048import org.forgerock.opendj.config.IntegerPropertyDefinition; 049import org.forgerock.opendj.config.IPAddressMaskPropertyDefinition; 050import org.forgerock.opendj.config.IPAddressPropertyDefinition; 051import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException; 052import org.forgerock.opendj.config.ManagedObjectDefinition; 053import org.forgerock.opendj.config.PropertyOption; 054import org.forgerock.opendj.config.PropertyProvider; 055import org.forgerock.opendj.config.server.ConfigurationChangeListener; 056import org.forgerock.opendj.config.server.ServerManagedObject; 057import org.forgerock.opendj.config.SizePropertyDefinition; 058import org.forgerock.opendj.config.StringPropertyDefinition; 059import org.forgerock.opendj.config.Tag; 060import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider; 061import org.forgerock.opendj.ldap.AddressMask; 062import org.forgerock.opendj.ldap.DN; 063import org.forgerock.opendj.ldap.LdapException; 064import org.forgerock.opendj.server.config.client.HTTPConnectionHandlerCfgClient; 065import org.forgerock.opendj.server.config.client.KeyManagerProviderCfgClient; 066import org.forgerock.opendj.server.config.client.TrustManagerProviderCfgClient; 067import org.forgerock.opendj.server.config.server.ConnectionHandlerCfg; 068import org.forgerock.opendj.server.config.server.HTTPConnectionHandlerCfg; 069import org.forgerock.opendj.server.config.server.KeyManagerProviderCfg; 070import org.forgerock.opendj.server.config.server.TrustManagerProviderCfg; 071 072 073 074/** 075 * An interface for querying the HTTP Connection Handler managed 076 * object definition meta information. 077 * <p> 078 * The HTTP Connection Handler is used to interact with clients using 079 * HTTP. 080 */ 081public final class HTTPConnectionHandlerCfgDefn extends ManagedObjectDefinition<HTTPConnectionHandlerCfgClient, HTTPConnectionHandlerCfg> { 082 083 // The singleton configuration definition instance. 084 private static final HTTPConnectionHandlerCfgDefn INSTANCE = new HTTPConnectionHandlerCfgDefn(); 085 086 087 088 /** 089 * Defines the set of permissable values for the "ssl-client-auth-policy" property. 090 * <p> 091 * Specifies the policy that the HTTP Connection Handler should use 092 * regarding client SSL certificates. Clients can use the SASL 093 * EXTERNAL mechanism only if the policy is set to "optional" or 094 * "required". 095 * <p> 096 * This is only applicable if clients are allowed to use SSL. 097 */ 098 public static enum SSLClientAuthPolicy { 099 100 /** 101 * Clients must not provide their own certificates when performing 102 * SSL negotiation. 103 */ 104 DISABLED("disabled"), 105 106 107 108 /** 109 * Clients are requested to provide their own certificates when 110 * performing SSL negotiation, but still accept the connection even 111 * if the client does not provide a certificate. 112 */ 113 OPTIONAL("optional"), 114 115 116 117 /** 118 * Clients are requested to provide their own certificates when 119 * performing SSL negotiation. The connection is nevertheless 120 * accepted if the client does not provide a certificate. 121 */ 122 REQUIRED("required"); 123 124 125 126 // String representation of the value. 127 private final String name; 128 129 130 131 // Private constructor. 132 private SSLClientAuthPolicy(String name) { this.name = name; } 133 134 135 136 /** 137 * {@inheritDoc} 138 */ 139 public String toString() { return name; } 140 141 } 142 143 144 145 // The "accept-backlog" property definition. 146 private static final IntegerPropertyDefinition PD_ACCEPT_BACKLOG; 147 148 149 150 // The "allow-tcp-reuse-address" property definition. 151 private static final BooleanPropertyDefinition PD_ALLOW_TCP_REUSE_ADDRESS; 152 153 154 155 // The "authentication-required" property definition. 156 private static final BooleanPropertyDefinition PD_AUTHENTICATION_REQUIRED; 157 158 159 160 // The "buffer-size" property definition. 161 private static final SizePropertyDefinition PD_BUFFER_SIZE; 162 163 164 165 // The "config-file" property definition. 166 private static final StringPropertyDefinition PD_CONFIG_FILE; 167 168 169 170 // The "java-class" property definition. 171 private static final ClassPropertyDefinition PD_JAVA_CLASS; 172 173 174 175 // The "keep-stats" property definition. 176 private static final BooleanPropertyDefinition PD_KEEP_STATS; 177 178 179 180 // The "key-manager-provider" property definition. 181 private static final AggregationPropertyDefinition<KeyManagerProviderCfgClient, KeyManagerProviderCfg> PD_KEY_MANAGER_PROVIDER; 182 183 184 185 // The "listen-address" property definition. 186 private static final IPAddressPropertyDefinition PD_LISTEN_ADDRESS; 187 188 189 190 // The "listen-port" property definition. 191 private static final IntegerPropertyDefinition PD_LISTEN_PORT; 192 193 194 195 // The "max-blocked-write-time-limit" property definition. 196 private static final DurationPropertyDefinition PD_MAX_BLOCKED_WRITE_TIME_LIMIT; 197 198 199 200 // The "max-concurrent-ops-per-connection" property definition. 201 private static final IntegerPropertyDefinition PD_MAX_CONCURRENT_OPS_PER_CONNECTION; 202 203 204 205 // The "max-request-size" property definition. 206 private static final SizePropertyDefinition PD_MAX_REQUEST_SIZE; 207 208 209 210 // The "num-request-handlers" property definition. 211 private static final IntegerPropertyDefinition PD_NUM_REQUEST_HANDLERS; 212 213 214 215 // The "ssl-cert-nickname" property definition. 216 private static final StringPropertyDefinition PD_SSL_CERT_NICKNAME; 217 218 219 220 // The "ssl-cipher-suite" property definition. 221 private static final StringPropertyDefinition PD_SSL_CIPHER_SUITE; 222 223 224 225 // The "ssl-client-auth-policy" property definition. 226 private static final EnumPropertyDefinition<SSLClientAuthPolicy> PD_SSL_CLIENT_AUTH_POLICY; 227 228 229 230 // The "ssl-protocol" property definition. 231 private static final StringPropertyDefinition PD_SSL_PROTOCOL; 232 233 234 235 // The "trust-manager-provider" property definition. 236 private static final AggregationPropertyDefinition<TrustManagerProviderCfgClient, TrustManagerProviderCfg> PD_TRUST_MANAGER_PROVIDER; 237 238 239 240 // The "use-ssl" property definition. 241 private static final BooleanPropertyDefinition PD_USE_SSL; 242 243 244 245 // The "use-tcp-keep-alive" property definition. 246 private static final BooleanPropertyDefinition PD_USE_TCP_KEEP_ALIVE; 247 248 249 250 // The "use-tcp-no-delay" property definition. 251 private static final BooleanPropertyDefinition PD_USE_TCP_NO_DELAY; 252 253 254 255 // Build the "accept-backlog" property definition. 256 static { 257 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "accept-backlog"); 258 builder.setOption(PropertyOption.ADVANCED); 259 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "accept-backlog")); 260 DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("128"); 261 builder.setDefaultBehaviorProvider(provider); 262 builder.setLowerLimit(1); 263 PD_ACCEPT_BACKLOG = builder.getInstance(); 264 INSTANCE.registerPropertyDefinition(PD_ACCEPT_BACKLOG); 265 } 266 267 268 269 // Build the "allow-tcp-reuse-address" property definition. 270 static { 271 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "allow-tcp-reuse-address"); 272 builder.setOption(PropertyOption.ADVANCED); 273 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "allow-tcp-reuse-address")); 274 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 275 builder.setDefaultBehaviorProvider(provider); 276 PD_ALLOW_TCP_REUSE_ADDRESS = builder.getInstance(); 277 INSTANCE.registerPropertyDefinition(PD_ALLOW_TCP_REUSE_ADDRESS); 278 } 279 280 281 282 // Build the "authentication-required" property definition. 283 static { 284 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "authentication-required"); 285 builder.setOption(PropertyOption.MANDATORY); 286 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "authentication-required")); 287 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 288 builder.setDefaultBehaviorProvider(provider); 289 PD_AUTHENTICATION_REQUIRED = builder.getInstance(); 290 INSTANCE.registerPropertyDefinition(PD_AUTHENTICATION_REQUIRED); 291 } 292 293 294 295 // Build the "buffer-size" property definition. 296 static { 297 SizePropertyDefinition.Builder builder = SizePropertyDefinition.createBuilder(INSTANCE, "buffer-size"); 298 builder.setOption(PropertyOption.ADVANCED); 299 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "buffer-size")); 300 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("4096 bytes"); 301 builder.setDefaultBehaviorProvider(provider); 302 builder.setUpperLimit("2147483647b"); 303 builder.setLowerLimit("1b"); 304 PD_BUFFER_SIZE = builder.getInstance(); 305 INSTANCE.registerPropertyDefinition(PD_BUFFER_SIZE); 306 } 307 308 309 310 // Build the "config-file" property definition. 311 static { 312 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "config-file"); 313 builder.setOption(PropertyOption.MANDATORY); 314 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "config-file")); 315 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("config/http-config.json"); 316 builder.setDefaultBehaviorProvider(provider); 317 builder.setPattern(".*", "FILE"); 318 PD_CONFIG_FILE = builder.getInstance(); 319 INSTANCE.registerPropertyDefinition(PD_CONFIG_FILE); 320 } 321 322 323 324 // Build the "java-class" property definition. 325 static { 326 ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class"); 327 builder.setOption(PropertyOption.MANDATORY); 328 builder.setOption(PropertyOption.ADVANCED); 329 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "java-class")); 330 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.protocols.http.HTTPConnectionHandler"); 331 builder.setDefaultBehaviorProvider(provider); 332 builder.addInstanceOf("org.opends.server.api.ConnectionHandler"); 333 PD_JAVA_CLASS = builder.getInstance(); 334 INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS); 335 } 336 337 338 339 // Build the "keep-stats" property definition. 340 static { 341 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "keep-stats"); 342 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "keep-stats")); 343 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 344 builder.setDefaultBehaviorProvider(provider); 345 PD_KEEP_STATS = builder.getInstance(); 346 INSTANCE.registerPropertyDefinition(PD_KEEP_STATS); 347 } 348 349 350 351 // Build the "key-manager-provider" property definition. 352 static { 353 AggregationPropertyDefinition.Builder<KeyManagerProviderCfgClient, KeyManagerProviderCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "key-manager-provider"); 354 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "key-manager-provider")); 355 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>()); 356 builder.setParentPath("/"); 357 builder.setRelationDefinition("key-manager-provider"); 358 builder.setTargetNeedsEnablingCondition(Conditions.and(Conditions.contains("enabled", "true"), Conditions.contains("use-ssl", "true"))); 359 builder.setTargetIsEnabledCondition(Conditions.contains("enabled", "true")); 360 PD_KEY_MANAGER_PROVIDER = builder.getInstance(); 361 INSTANCE.registerPropertyDefinition(PD_KEY_MANAGER_PROVIDER); 362 INSTANCE.registerConstraint(PD_KEY_MANAGER_PROVIDER.getSourceConstraint()); 363 } 364 365 366 367 // Build the "listen-address" property definition. 368 static { 369 IPAddressPropertyDefinition.Builder builder = IPAddressPropertyDefinition.createBuilder(INSTANCE, "listen-address"); 370 builder.setOption(PropertyOption.MULTI_VALUED); 371 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "listen-address")); 372 DefaultBehaviorProvider<InetAddress> provider = new DefinedDefaultBehaviorProvider<InetAddress>("0.0.0.0"); 373 builder.setDefaultBehaviorProvider(provider); 374 PD_LISTEN_ADDRESS = builder.getInstance(); 375 INSTANCE.registerPropertyDefinition(PD_LISTEN_ADDRESS); 376 } 377 378 379 380 // Build the "listen-port" property definition. 381 static { 382 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "listen-port"); 383 builder.setOption(PropertyOption.MANDATORY); 384 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "listen-port")); 385 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<Integer>()); 386 builder.setUpperLimit(65535); 387 builder.setLowerLimit(1); 388 PD_LISTEN_PORT = builder.getInstance(); 389 INSTANCE.registerPropertyDefinition(PD_LISTEN_PORT); 390 } 391 392 393 394 // Build the "max-blocked-write-time-limit" property definition. 395 static { 396 DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "max-blocked-write-time-limit"); 397 builder.setOption(PropertyOption.ADVANCED); 398 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "max-blocked-write-time-limit")); 399 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("2 minutes"); 400 builder.setDefaultBehaviorProvider(provider); 401 builder.setBaseUnit("ms"); 402 builder.setLowerLimit("0"); 403 PD_MAX_BLOCKED_WRITE_TIME_LIMIT = builder.getInstance(); 404 INSTANCE.registerPropertyDefinition(PD_MAX_BLOCKED_WRITE_TIME_LIMIT); 405 } 406 407 408 409 // Build the "max-concurrent-ops-per-connection" property definition. 410 static { 411 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "max-concurrent-ops-per-connection"); 412 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "max-concurrent-ops-per-connection")); 413 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<Integer>(INSTANCE, "max-concurrent-ops-per-connection")); 414 builder.setLowerLimit(0); 415 PD_MAX_CONCURRENT_OPS_PER_CONNECTION = builder.getInstance(); 416 INSTANCE.registerPropertyDefinition(PD_MAX_CONCURRENT_OPS_PER_CONNECTION); 417 } 418 419 420 421 // Build the "max-request-size" property definition. 422 static { 423 SizePropertyDefinition.Builder builder = SizePropertyDefinition.createBuilder(INSTANCE, "max-request-size"); 424 builder.setOption(PropertyOption.ADVANCED); 425 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "max-request-size")); 426 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("5 megabytes"); 427 builder.setDefaultBehaviorProvider(provider); 428 builder.setUpperLimit("2147483647b"); 429 PD_MAX_REQUEST_SIZE = builder.getInstance(); 430 INSTANCE.registerPropertyDefinition(PD_MAX_REQUEST_SIZE); 431 } 432 433 434 435 // Build the "num-request-handlers" property definition. 436 static { 437 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "num-request-handlers"); 438 builder.setOption(PropertyOption.ADVANCED); 439 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "num-request-handlers")); 440 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<Integer>(INSTANCE, "num-request-handlers")); 441 builder.setLowerLimit(1); 442 PD_NUM_REQUEST_HANDLERS = builder.getInstance(); 443 INSTANCE.registerPropertyDefinition(PD_NUM_REQUEST_HANDLERS); 444 } 445 446 447 448 // Build the "ssl-cert-nickname" property definition. 449 static { 450 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-cert-nickname"); 451 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "ssl-cert-nickname")); 452 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cert-nickname")); 453 PD_SSL_CERT_NICKNAME = builder.getInstance(); 454 INSTANCE.registerPropertyDefinition(PD_SSL_CERT_NICKNAME); 455 } 456 457 458 459 // Build the "ssl-cipher-suite" property definition. 460 static { 461 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-cipher-suite"); 462 builder.setOption(PropertyOption.MULTI_VALUED); 463 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-cipher-suite")); 464 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cipher-suite")); 465 PD_SSL_CIPHER_SUITE = builder.getInstance(); 466 INSTANCE.registerPropertyDefinition(PD_SSL_CIPHER_SUITE); 467 } 468 469 470 471 // Build the "ssl-client-auth-policy" property definition. 472 static { 473 EnumPropertyDefinition.Builder<SSLClientAuthPolicy> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "ssl-client-auth-policy"); 474 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "ssl-client-auth-policy")); 475 DefaultBehaviorProvider<SSLClientAuthPolicy> provider = new DefinedDefaultBehaviorProvider<SSLClientAuthPolicy>("optional"); 476 builder.setDefaultBehaviorProvider(provider); 477 builder.setEnumClass(SSLClientAuthPolicy.class); 478 PD_SSL_CLIENT_AUTH_POLICY = builder.getInstance(); 479 INSTANCE.registerPropertyDefinition(PD_SSL_CLIENT_AUTH_POLICY); 480 } 481 482 483 484 // Build the "ssl-protocol" property definition. 485 static { 486 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-protocol"); 487 builder.setOption(PropertyOption.MULTI_VALUED); 488 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-protocol")); 489 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-protocol")); 490 PD_SSL_PROTOCOL = builder.getInstance(); 491 INSTANCE.registerPropertyDefinition(PD_SSL_PROTOCOL); 492 } 493 494 495 496 // Build the "trust-manager-provider" property definition. 497 static { 498 AggregationPropertyDefinition.Builder<TrustManagerProviderCfgClient, TrustManagerProviderCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "trust-manager-provider"); 499 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-manager-provider")); 500 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>()); 501 builder.setParentPath("/"); 502 builder.setRelationDefinition("trust-manager-provider"); 503 builder.setTargetNeedsEnablingCondition(Conditions.and(Conditions.contains("enabled", "true"), Conditions.contains("use-ssl", "true"))); 504 builder.setTargetIsEnabledCondition(Conditions.contains("enabled", "true")); 505 PD_TRUST_MANAGER_PROVIDER = builder.getInstance(); 506 INSTANCE.registerPropertyDefinition(PD_TRUST_MANAGER_PROVIDER); 507 INSTANCE.registerConstraint(PD_TRUST_MANAGER_PROVIDER.getSourceConstraint()); 508 } 509 510 511 512 // Build the "use-ssl" property definition. 513 static { 514 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-ssl"); 515 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "use-ssl")); 516 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false"); 517 builder.setDefaultBehaviorProvider(provider); 518 PD_USE_SSL = builder.getInstance(); 519 INSTANCE.registerPropertyDefinition(PD_USE_SSL); 520 } 521 522 523 524 // Build the "use-tcp-keep-alive" property definition. 525 static { 526 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-tcp-keep-alive"); 527 builder.setOption(PropertyOption.ADVANCED); 528 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "use-tcp-keep-alive")); 529 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 530 builder.setDefaultBehaviorProvider(provider); 531 PD_USE_TCP_KEEP_ALIVE = builder.getInstance(); 532 INSTANCE.registerPropertyDefinition(PD_USE_TCP_KEEP_ALIVE); 533 } 534 535 536 537 // Build the "use-tcp-no-delay" property definition. 538 static { 539 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-tcp-no-delay"); 540 builder.setOption(PropertyOption.ADVANCED); 541 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "use-tcp-no-delay")); 542 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 543 builder.setDefaultBehaviorProvider(provider); 544 PD_USE_TCP_NO_DELAY = builder.getInstance(); 545 INSTANCE.registerPropertyDefinition(PD_USE_TCP_NO_DELAY); 546 } 547 548 549 550 // Register the tags associated with this managed object definition. 551 static { 552 INSTANCE.registerTag(Tag.valueOf("core-server")); 553 } 554 555 556 557 // Register the constraints associated with this managed object definition. 558 static { 559 INSTANCE.registerConstraint(new GenericConstraint(INSTANCE, 1, Conditions.implies(Conditions.contains("enabled", "true"), Conditions.implies(Conditions.contains("use-ssl", "true"), Conditions.isPresent("key-manager-provider"))))); 560 INSTANCE.registerConstraint(new GenericConstraint(INSTANCE, 2, Conditions.implies(Conditions.contains("enabled", "true"), Conditions.implies(Conditions.contains("use-ssl", "true"), Conditions.isPresent("trust-manager-provider"))))); 561 } 562 563 564 565 /** 566 * Get the HTTP Connection Handler configuration definition 567 * singleton. 568 * 569 * @return Returns the HTTP Connection Handler configuration 570 * definition singleton. 571 */ 572 public static HTTPConnectionHandlerCfgDefn getInstance() { 573 return INSTANCE; 574 } 575 576 577 578 /** 579 * Private constructor. 580 */ 581 private HTTPConnectionHandlerCfgDefn() { 582 super("http-connection-handler", ConnectionHandlerCfgDefn.getInstance()); 583 } 584 585 586 587 /** 588 * {@inheritDoc} 589 */ 590 public HTTPConnectionHandlerCfgClient createClientConfiguration( 591 ManagedObject<? extends HTTPConnectionHandlerCfgClient> impl) { 592 return new HTTPConnectionHandlerCfgClientImpl(impl); 593 } 594 595 596 597 /** 598 * {@inheritDoc} 599 */ 600 public HTTPConnectionHandlerCfg createServerConfiguration( 601 ServerManagedObject<? extends HTTPConnectionHandlerCfg> impl) { 602 return new HTTPConnectionHandlerCfgServerImpl(impl); 603 } 604 605 606 607 /** 608 * {@inheritDoc} 609 */ 610 public Class<HTTPConnectionHandlerCfg> getServerConfigurationClass() { 611 return HTTPConnectionHandlerCfg.class; 612 } 613 614 615 616 /** 617 * Get the "accept-backlog" property definition. 618 * <p> 619 * Specifies the maximum number of pending connection attempts that 620 * are allowed to queue up in the accept backlog before the server 621 * starts rejecting new connection attempts. 622 * <p> 623 * This is primarily an issue for cases in which a large number of 624 * connections are established to the server in a very short period 625 * of time (for example, a benchmark utility that creates a large 626 * number of client threads that each have their own connection to 627 * the server) and the connection handler is unable to keep up with 628 * the rate at which the new connections are established. 629 * 630 * @return Returns the "accept-backlog" property definition. 631 */ 632 public IntegerPropertyDefinition getAcceptBacklogPropertyDefinition() { 633 return PD_ACCEPT_BACKLOG; 634 } 635 636 637 638 /** 639 * Get the "allowed-client" property definition. 640 * <p> 641 * Specifies a set of host names or address masks that determine the 642 * clients that are allowed to establish connections to this HTTP 643 * Connection Handler. 644 * <p> 645 * Valid values include a host name, a fully qualified domain name, 646 * a domain name, an IP address, or a subnetwork with subnetwork 647 * mask. 648 * 649 * @return Returns the "allowed-client" property definition. 650 */ 651 public IPAddressMaskPropertyDefinition getAllowedClientPropertyDefinition() { 652 return ConnectionHandlerCfgDefn.getInstance().getAllowedClientPropertyDefinition(); 653 } 654 655 656 657 /** 658 * Get the "allow-tcp-reuse-address" property definition. 659 * <p> 660 * Indicates whether the HTTP Connection Handler should reuse socket 661 * descriptors. 662 * <p> 663 * If enabled, the SO_REUSEADDR socket option is used on the server 664 * listen socket to potentially allow the reuse of socket descriptors 665 * for clients in a TIME_WAIT state. This may help the server avoid 666 * temporarily running out of socket descriptors in cases in which a 667 * very large number of short-lived connections have been established 668 * from the same client system. 669 * 670 * @return Returns the "allow-tcp-reuse-address" property definition. 671 */ 672 public BooleanPropertyDefinition getAllowTCPReuseAddressPropertyDefinition() { 673 return PD_ALLOW_TCP_REUSE_ADDRESS; 674 } 675 676 677 678 /** 679 * Get the "authentication-required" property definition. 680 * <p> 681 * Specifies whether only authenticated requests can be processed by 682 * the HTTP Connection Handler. 683 * <p> 684 * If true, only authenticated requests will be processed by the 685 * HTTP Connection Handler. If false, both authenticated requests and 686 * unauthenticated requests will be processed. All requests are 687 * subject to ACI limitations and unauthenticated requests are 688 * subject to server limits like maximum number of entries returned. 689 * Note that setting ds-cfg-reject-unauthenticated-requests to true 690 * will override the current setting. 691 * 692 * @return Returns the "authentication-required" property definition. 693 */ 694 public BooleanPropertyDefinition getAuthenticationRequiredPropertyDefinition() { 695 return PD_AUTHENTICATION_REQUIRED; 696 } 697 698 699 700 /** 701 * Get the "buffer-size" property definition. 702 * <p> 703 * Specifies the size in bytes of the HTTP response message write 704 * buffer. 705 * <p> 706 * This property specifies write buffer size allocated by the server 707 * for each client connection and used to buffer HTTP response 708 * messages data when writing. 709 * 710 * @return Returns the "buffer-size" property definition. 711 */ 712 public SizePropertyDefinition getBufferSizePropertyDefinition() { 713 return PD_BUFFER_SIZE; 714 } 715 716 717 718 /** 719 * Get the "config-file" property definition. 720 * <p> 721 * Specifies the name of the configuration file for the HTTP 722 * Connection Handler. 723 * 724 * @return Returns the "config-file" property definition. 725 */ 726 public StringPropertyDefinition getConfigFilePropertyDefinition() { 727 return PD_CONFIG_FILE; 728 } 729 730 731 732 /** 733 * Get the "denied-client" property definition. 734 * <p> 735 * Specifies a set of host names or address masks that determine the 736 * clients that are not allowed to establish connections to this HTTP 737 * Connection Handler. 738 * <p> 739 * Valid values include a host name, a fully qualified domain name, 740 * a domain name, an IP address, or a subnetwork with subnetwork 741 * mask. If both allowed and denied client masks are defined and a 742 * client connection matches one or more masks in both lists, then 743 * the connection is denied. If only a denied list is specified, then 744 * any client not matching a mask in that list is allowed. 745 * 746 * @return Returns the "denied-client" property definition. 747 */ 748 public IPAddressMaskPropertyDefinition getDeniedClientPropertyDefinition() { 749 return ConnectionHandlerCfgDefn.getInstance().getDeniedClientPropertyDefinition(); 750 } 751 752 753 754 /** 755 * Get the "enabled" property definition. 756 * <p> 757 * Indicates whether the HTTP Connection Handler is enabled. 758 * 759 * @return Returns the "enabled" property definition. 760 */ 761 public BooleanPropertyDefinition getEnabledPropertyDefinition() { 762 return ConnectionHandlerCfgDefn.getInstance().getEnabledPropertyDefinition(); 763 } 764 765 766 767 /** 768 * Get the "java-class" property definition. 769 * <p> 770 * Specifies the fully-qualified name of the Java class that 771 * provides the HTTP Connection Handler implementation. 772 * 773 * @return Returns the "java-class" property definition. 774 */ 775 public ClassPropertyDefinition getJavaClassPropertyDefinition() { 776 return PD_JAVA_CLASS; 777 } 778 779 780 781 /** 782 * Get the "keep-stats" property definition. 783 * <p> 784 * Indicates whether the HTTP Connection Handler should keep 785 * statistics. 786 * <p> 787 * If enabled, the HTTP Connection Handler maintains statistics 788 * about the number and types of operations requested over HTTP and 789 * the amount of data sent and received. 790 * 791 * @return Returns the "keep-stats" property definition. 792 */ 793 public BooleanPropertyDefinition getKeepStatsPropertyDefinition() { 794 return PD_KEEP_STATS; 795 } 796 797 798 799 /** 800 * Get the "key-manager-provider" property definition. 801 * <p> 802 * Specifies the name of the key manager that should be used with 803 * this HTTP Connection Handler . 804 * 805 * @return Returns the "key-manager-provider" property definition. 806 */ 807 public AggregationPropertyDefinition<KeyManagerProviderCfgClient, KeyManagerProviderCfg> getKeyManagerProviderPropertyDefinition() { 808 return PD_KEY_MANAGER_PROVIDER; 809 } 810 811 812 813 /** 814 * Get the "listen-address" property definition. 815 * <p> 816 * Specifies the address or set of addresses on which this HTTP 817 * Connection Handler should listen for connections from HTTP 818 * clients. 819 * <p> 820 * Multiple addresses may be provided as separate values for this 821 * attribute. If no values are provided, then the HTTP Connection 822 * Handler listens on all interfaces. 823 * 824 * @return Returns the "listen-address" property definition. 825 */ 826 public IPAddressPropertyDefinition getListenAddressPropertyDefinition() { 827 return PD_LISTEN_ADDRESS; 828 } 829 830 831 832 /** 833 * Get the "listen-port" property definition. 834 * <p> 835 * Specifies the port number on which the HTTP Connection Handler 836 * will listen for connections from clients. 837 * <p> 838 * Only a single port number may be provided. 839 * 840 * @return Returns the "listen-port" property definition. 841 */ 842 public IntegerPropertyDefinition getListenPortPropertyDefinition() { 843 return PD_LISTEN_PORT; 844 } 845 846 847 848 /** 849 * Get the "max-blocked-write-time-limit" property definition. 850 * <p> 851 * Specifies the maximum length of time that attempts to write data 852 * to HTTP clients should be allowed to block. 853 * <p> 854 * If an attempt to write data to a client takes longer than this 855 * length of time, then the client connection is terminated. 856 * 857 * @return Returns the "max-blocked-write-time-limit" property definition. 858 */ 859 public DurationPropertyDefinition getMaxBlockedWriteTimeLimitPropertyDefinition() { 860 return PD_MAX_BLOCKED_WRITE_TIME_LIMIT; 861 } 862 863 864 865 /** 866 * Get the "max-concurrent-ops-per-connection" property definition. 867 * <p> 868 * Specifies the maximum number of internal operations that each 869 * HTTP client connection can execute concurrently. 870 * <p> 871 * This property allow to limit the impact that each HTTP request 872 * can have on the whole server by limiting the number of internal 873 * operations that each HTTP request can execute concurrently. A 874 * value of 0 means that no limit is enforced. 875 * 876 * @return Returns the "max-concurrent-ops-per-connection" property definition. 877 */ 878 public IntegerPropertyDefinition getMaxConcurrentOpsPerConnectionPropertyDefinition() { 879 return PD_MAX_CONCURRENT_OPS_PER_CONNECTION; 880 } 881 882 883 884 /** 885 * Get the "max-request-size" property definition. 886 * <p> 887 * Specifies the size in bytes of the largest HTTP request message 888 * that will be allowed by the HTTP Connection Handler. 889 * <p> 890 * This can help prevent denial-of-service attacks by clients that 891 * indicate they send extremely large requests to the server causing 892 * it to attempt to allocate large amounts of memory. 893 * 894 * @return Returns the "max-request-size" property definition. 895 */ 896 public SizePropertyDefinition getMaxRequestSizePropertyDefinition() { 897 return PD_MAX_REQUEST_SIZE; 898 } 899 900 901 902 /** 903 * Get the "num-request-handlers" property definition. 904 * <p> 905 * Specifies the number of request handlers that are used to read 906 * requests from clients. 907 * <p> 908 * The HTTP Connection Handler uses one thread to accept new 909 * connections from clients, but uses one or more additional threads 910 * to read requests from existing client connections. This ensures 911 * that new requests are read efficiently and that the connection 912 * handler itself does not become a bottleneck when the server is 913 * under heavy load from many clients at the same time. 914 * 915 * @return Returns the "num-request-handlers" property definition. 916 */ 917 public IntegerPropertyDefinition getNumRequestHandlersPropertyDefinition() { 918 return PD_NUM_REQUEST_HANDLERS; 919 } 920 921 922 923 /** 924 * Get the "ssl-cert-nickname" property definition. 925 * <p> 926 * Specifies the nickname (also called the alias) of the certificate 927 * that the HTTP Connection Handler should use when performing SSL 928 * communication. 929 * <p> 930 * This is only applicable when the HTTP Connection Handler is 931 * configured to use SSL. 932 * 933 * @return Returns the "ssl-cert-nickname" property definition. 934 */ 935 public StringPropertyDefinition getSSLCertNicknamePropertyDefinition() { 936 return PD_SSL_CERT_NICKNAME; 937 } 938 939 940 941 /** 942 * Get the "ssl-cipher-suite" property definition. 943 * <p> 944 * Specifies the names of the SSL cipher suites that are allowed for 945 * use in SSL communication. 946 * 947 * @return Returns the "ssl-cipher-suite" property definition. 948 */ 949 public StringPropertyDefinition getSSLCipherSuitePropertyDefinition() { 950 return PD_SSL_CIPHER_SUITE; 951 } 952 953 954 955 /** 956 * Get the "ssl-client-auth-policy" property definition. 957 * <p> 958 * Specifies the policy that the HTTP Connection Handler should use 959 * regarding client SSL certificates. Clients can use the SASL 960 * EXTERNAL mechanism only if the policy is set to "optional" or 961 * "required". 962 * <p> 963 * This is only applicable if clients are allowed to use SSL. 964 * 965 * @return Returns the "ssl-client-auth-policy" property definition. 966 */ 967 public EnumPropertyDefinition<SSLClientAuthPolicy> getSSLClientAuthPolicyPropertyDefinition() { 968 return PD_SSL_CLIENT_AUTH_POLICY; 969 } 970 971 972 973 /** 974 * Get the "ssl-protocol" property definition. 975 * <p> 976 * Specifies the names of the SSL protocols that are allowed for use 977 * in SSL communication. 978 * 979 * @return Returns the "ssl-protocol" property definition. 980 */ 981 public StringPropertyDefinition getSSLProtocolPropertyDefinition() { 982 return PD_SSL_PROTOCOL; 983 } 984 985 986 987 /** 988 * Get the "trust-manager-provider" property definition. 989 * <p> 990 * Specifies the name of the trust manager that should be used with 991 * the HTTP Connection Handler . 992 * 993 * @return Returns the "trust-manager-provider" property definition. 994 */ 995 public AggregationPropertyDefinition<TrustManagerProviderCfgClient, TrustManagerProviderCfg> getTrustManagerProviderPropertyDefinition() { 996 return PD_TRUST_MANAGER_PROVIDER; 997 } 998 999 1000 1001 /** 1002 * Get the "use-ssl" property definition. 1003 * <p> 1004 * Indicates whether the HTTP Connection Handler should use SSL. 1005 * <p> 1006 * If enabled, the HTTP Connection Handler will use SSL to encrypt 1007 * communication with the clients. 1008 * 1009 * @return Returns the "use-ssl" property definition. 1010 */ 1011 public BooleanPropertyDefinition getUseSSLPropertyDefinition() { 1012 return PD_USE_SSL; 1013 } 1014 1015 1016 1017 /** 1018 * Get the "use-tcp-keep-alive" property definition. 1019 * <p> 1020 * Indicates whether the HTTP Connection Handler should use TCP 1021 * keep-alive. 1022 * <p> 1023 * If enabled, the SO_KEEPALIVE socket option is used to indicate 1024 * that TCP keepalive messages should periodically be sent to the 1025 * client to verify that the associated connection is still valid. 1026 * This may also help prevent cases in which intermediate network 1027 * hardware could silently drop an otherwise idle client connection, 1028 * provided that the keepalive interval configured in the underlying 1029 * operating system is smaller than the timeout enforced by the 1030 * network hardware. 1031 * 1032 * @return Returns the "use-tcp-keep-alive" property definition. 1033 */ 1034 public BooleanPropertyDefinition getUseTCPKeepAlivePropertyDefinition() { 1035 return PD_USE_TCP_KEEP_ALIVE; 1036 } 1037 1038 1039 1040 /** 1041 * Get the "use-tcp-no-delay" property definition. 1042 * <p> 1043 * Indicates whether the HTTP Connection Handler should use TCP 1044 * no-delay. 1045 * <p> 1046 * If enabled, the TCP_NODELAY socket option is used to ensure that 1047 * response messages to the client are sent immediately rather than 1048 * potentially waiting to determine whether additional response 1049 * messages can be sent in the same packet. In most cases, using the 1050 * TCP_NODELAY socket option provides better performance and lower 1051 * response times, but disabling it may help for some cases in which 1052 * the server sends a large number of entries to a client in response 1053 * to a search request. 1054 * 1055 * @return Returns the "use-tcp-no-delay" property definition. 1056 */ 1057 public BooleanPropertyDefinition getUseTCPNoDelayPropertyDefinition() { 1058 return PD_USE_TCP_NO_DELAY; 1059 } 1060 1061 1062 1063 /** 1064 * Managed object client implementation. 1065 */ 1066 private static class HTTPConnectionHandlerCfgClientImpl implements 1067 HTTPConnectionHandlerCfgClient { 1068 1069 // Private implementation. 1070 private ManagedObject<? extends HTTPConnectionHandlerCfgClient> impl; 1071 1072 1073 1074 // Private constructor. 1075 private HTTPConnectionHandlerCfgClientImpl( 1076 ManagedObject<? extends HTTPConnectionHandlerCfgClient> impl) { 1077 this.impl = impl; 1078 } 1079 1080 1081 1082 /** 1083 * {@inheritDoc} 1084 */ 1085 public int getAcceptBacklog() { 1086 return impl.getPropertyValue(INSTANCE.getAcceptBacklogPropertyDefinition()); 1087 } 1088 1089 1090 1091 /** 1092 * {@inheritDoc} 1093 */ 1094 public void setAcceptBacklog(Integer value) { 1095 impl.setPropertyValue(INSTANCE.getAcceptBacklogPropertyDefinition(), value); 1096 } 1097 1098 1099 1100 /** 1101 * {@inheritDoc} 1102 */ 1103 public SortedSet<AddressMask> getAllowedClient() { 1104 return impl.getPropertyValues(INSTANCE.getAllowedClientPropertyDefinition()); 1105 } 1106 1107 1108 1109 /** 1110 * {@inheritDoc} 1111 */ 1112 public void setAllowedClient(Collection<AddressMask> values) { 1113 impl.setPropertyValues(INSTANCE.getAllowedClientPropertyDefinition(), values); 1114 } 1115 1116 1117 1118 /** 1119 * {@inheritDoc} 1120 */ 1121 public boolean isAllowTCPReuseAddress() { 1122 return impl.getPropertyValue(INSTANCE.getAllowTCPReuseAddressPropertyDefinition()); 1123 } 1124 1125 1126 1127 /** 1128 * {@inheritDoc} 1129 */ 1130 public void setAllowTCPReuseAddress(Boolean value) { 1131 impl.setPropertyValue(INSTANCE.getAllowTCPReuseAddressPropertyDefinition(), value); 1132 } 1133 1134 1135 1136 /** 1137 * {@inheritDoc} 1138 */ 1139 public boolean isAuthenticationRequired() { 1140 return impl.getPropertyValue(INSTANCE.getAuthenticationRequiredPropertyDefinition()); 1141 } 1142 1143 1144 1145 /** 1146 * {@inheritDoc} 1147 */ 1148 public void setAuthenticationRequired(boolean value) { 1149 impl.setPropertyValue(INSTANCE.getAuthenticationRequiredPropertyDefinition(), value); 1150 } 1151 1152 1153 1154 /** 1155 * {@inheritDoc} 1156 */ 1157 public long getBufferSize() { 1158 return impl.getPropertyValue(INSTANCE.getBufferSizePropertyDefinition()); 1159 } 1160 1161 1162 1163 /** 1164 * {@inheritDoc} 1165 */ 1166 public void setBufferSize(Long value) { 1167 impl.setPropertyValue(INSTANCE.getBufferSizePropertyDefinition(), value); 1168 } 1169 1170 1171 1172 /** 1173 * {@inheritDoc} 1174 */ 1175 public String getConfigFile() { 1176 return impl.getPropertyValue(INSTANCE.getConfigFilePropertyDefinition()); 1177 } 1178 1179 1180 1181 /** 1182 * {@inheritDoc} 1183 */ 1184 public void setConfigFile(String value) { 1185 impl.setPropertyValue(INSTANCE.getConfigFilePropertyDefinition(), value); 1186 } 1187 1188 1189 1190 /** 1191 * {@inheritDoc} 1192 */ 1193 public SortedSet<AddressMask> getDeniedClient() { 1194 return impl.getPropertyValues(INSTANCE.getDeniedClientPropertyDefinition()); 1195 } 1196 1197 1198 1199 /** 1200 * {@inheritDoc} 1201 */ 1202 public void setDeniedClient(Collection<AddressMask> values) { 1203 impl.setPropertyValues(INSTANCE.getDeniedClientPropertyDefinition(), values); 1204 } 1205 1206 1207 1208 /** 1209 * {@inheritDoc} 1210 */ 1211 public Boolean isEnabled() { 1212 return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition()); 1213 } 1214 1215 1216 1217 /** 1218 * {@inheritDoc} 1219 */ 1220 public void setEnabled(boolean value) { 1221 impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value); 1222 } 1223 1224 1225 1226 /** 1227 * {@inheritDoc} 1228 */ 1229 public String getJavaClass() { 1230 return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition()); 1231 } 1232 1233 1234 1235 /** 1236 * {@inheritDoc} 1237 */ 1238 public void setJavaClass(String value) { 1239 impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value); 1240 } 1241 1242 1243 1244 /** 1245 * {@inheritDoc} 1246 */ 1247 public boolean isKeepStats() { 1248 return impl.getPropertyValue(INSTANCE.getKeepStatsPropertyDefinition()); 1249 } 1250 1251 1252 1253 /** 1254 * {@inheritDoc} 1255 */ 1256 public void setKeepStats(Boolean value) { 1257 impl.setPropertyValue(INSTANCE.getKeepStatsPropertyDefinition(), value); 1258 } 1259 1260 1261 1262 /** 1263 * {@inheritDoc} 1264 */ 1265 public String getKeyManagerProvider() { 1266 return impl.getPropertyValue(INSTANCE.getKeyManagerProviderPropertyDefinition()); 1267 } 1268 1269 1270 1271 /** 1272 * {@inheritDoc} 1273 */ 1274 public void setKeyManagerProvider(String value) { 1275 impl.setPropertyValue(INSTANCE.getKeyManagerProviderPropertyDefinition(), value); 1276 } 1277 1278 1279 1280 /** 1281 * {@inheritDoc} 1282 */ 1283 public SortedSet<InetAddress> getListenAddress() { 1284 return impl.getPropertyValues(INSTANCE.getListenAddressPropertyDefinition()); 1285 } 1286 1287 1288 1289 /** 1290 * {@inheritDoc} 1291 */ 1292 public void setListenAddress(Collection<InetAddress> values) { 1293 impl.setPropertyValues(INSTANCE.getListenAddressPropertyDefinition(), values); 1294 } 1295 1296 1297 1298 /** 1299 * {@inheritDoc} 1300 */ 1301 public Integer getListenPort() { 1302 return impl.getPropertyValue(INSTANCE.getListenPortPropertyDefinition()); 1303 } 1304 1305 1306 1307 /** 1308 * {@inheritDoc} 1309 */ 1310 public void setListenPort(int value) { 1311 impl.setPropertyValue(INSTANCE.getListenPortPropertyDefinition(), value); 1312 } 1313 1314 1315 1316 /** 1317 * {@inheritDoc} 1318 */ 1319 public long getMaxBlockedWriteTimeLimit() { 1320 return impl.getPropertyValue(INSTANCE.getMaxBlockedWriteTimeLimitPropertyDefinition()); 1321 } 1322 1323 1324 1325 /** 1326 * {@inheritDoc} 1327 */ 1328 public void setMaxBlockedWriteTimeLimit(Long value) { 1329 impl.setPropertyValue(INSTANCE.getMaxBlockedWriteTimeLimitPropertyDefinition(), value); 1330 } 1331 1332 1333 1334 /** 1335 * {@inheritDoc} 1336 */ 1337 public Integer getMaxConcurrentOpsPerConnection() { 1338 return impl.getPropertyValue(INSTANCE.getMaxConcurrentOpsPerConnectionPropertyDefinition()); 1339 } 1340 1341 1342 1343 /** 1344 * {@inheritDoc} 1345 */ 1346 public void setMaxConcurrentOpsPerConnection(Integer value) { 1347 impl.setPropertyValue(INSTANCE.getMaxConcurrentOpsPerConnectionPropertyDefinition(), value); 1348 } 1349 1350 1351 1352 /** 1353 * {@inheritDoc} 1354 */ 1355 public long getMaxRequestSize() { 1356 return impl.getPropertyValue(INSTANCE.getMaxRequestSizePropertyDefinition()); 1357 } 1358 1359 1360 1361 /** 1362 * {@inheritDoc} 1363 */ 1364 public void setMaxRequestSize(Long value) { 1365 impl.setPropertyValue(INSTANCE.getMaxRequestSizePropertyDefinition(), value); 1366 } 1367 1368 1369 1370 /** 1371 * {@inheritDoc} 1372 */ 1373 public Integer getNumRequestHandlers() { 1374 return impl.getPropertyValue(INSTANCE.getNumRequestHandlersPropertyDefinition()); 1375 } 1376 1377 1378 1379 /** 1380 * {@inheritDoc} 1381 */ 1382 public void setNumRequestHandlers(Integer value) { 1383 impl.setPropertyValue(INSTANCE.getNumRequestHandlersPropertyDefinition(), value); 1384 } 1385 1386 1387 1388 /** 1389 * {@inheritDoc} 1390 */ 1391 public String getSSLCertNickname() { 1392 return impl.getPropertyValue(INSTANCE.getSSLCertNicknamePropertyDefinition()); 1393 } 1394 1395 1396 1397 /** 1398 * {@inheritDoc} 1399 */ 1400 public void setSSLCertNickname(String value) { 1401 impl.setPropertyValue(INSTANCE.getSSLCertNicknamePropertyDefinition(), value); 1402 } 1403 1404 1405 1406 /** 1407 * {@inheritDoc} 1408 */ 1409 public SortedSet<String> getSSLCipherSuite() { 1410 return impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 1411 } 1412 1413 1414 1415 /** 1416 * {@inheritDoc} 1417 */ 1418 public void setSSLCipherSuite(Collection<String> values) { 1419 impl.setPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition(), values); 1420 } 1421 1422 1423 1424 /** 1425 * {@inheritDoc} 1426 */ 1427 public SSLClientAuthPolicy getSSLClientAuthPolicy() { 1428 return impl.getPropertyValue(INSTANCE.getSSLClientAuthPolicyPropertyDefinition()); 1429 } 1430 1431 1432 1433 /** 1434 * {@inheritDoc} 1435 */ 1436 public void setSSLClientAuthPolicy(SSLClientAuthPolicy value) { 1437 impl.setPropertyValue(INSTANCE.getSSLClientAuthPolicyPropertyDefinition(), value); 1438 } 1439 1440 1441 1442 /** 1443 * {@inheritDoc} 1444 */ 1445 public SortedSet<String> getSSLProtocol() { 1446 return impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 1447 } 1448 1449 1450 1451 /** 1452 * {@inheritDoc} 1453 */ 1454 public void setSSLProtocol(Collection<String> values) { 1455 impl.setPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition(), values); 1456 } 1457 1458 1459 1460 /** 1461 * {@inheritDoc} 1462 */ 1463 public String getTrustManagerProvider() { 1464 return impl.getPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition()); 1465 } 1466 1467 1468 1469 /** 1470 * {@inheritDoc} 1471 */ 1472 public void setTrustManagerProvider(String value) { 1473 impl.setPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition(), value); 1474 } 1475 1476 1477 1478 /** 1479 * {@inheritDoc} 1480 */ 1481 public boolean isUseSSL() { 1482 return impl.getPropertyValue(INSTANCE.getUseSSLPropertyDefinition()); 1483 } 1484 1485 1486 1487 /** 1488 * {@inheritDoc} 1489 */ 1490 public void setUseSSL(Boolean value) { 1491 impl.setPropertyValue(INSTANCE.getUseSSLPropertyDefinition(), value); 1492 } 1493 1494 1495 1496 /** 1497 * {@inheritDoc} 1498 */ 1499 public boolean isUseTCPKeepAlive() { 1500 return impl.getPropertyValue(INSTANCE.getUseTCPKeepAlivePropertyDefinition()); 1501 } 1502 1503 1504 1505 /** 1506 * {@inheritDoc} 1507 */ 1508 public void setUseTCPKeepAlive(Boolean value) { 1509 impl.setPropertyValue(INSTANCE.getUseTCPKeepAlivePropertyDefinition(), value); 1510 } 1511 1512 1513 1514 /** 1515 * {@inheritDoc} 1516 */ 1517 public boolean isUseTCPNoDelay() { 1518 return impl.getPropertyValue(INSTANCE.getUseTCPNoDelayPropertyDefinition()); 1519 } 1520 1521 1522 1523 /** 1524 * {@inheritDoc} 1525 */ 1526 public void setUseTCPNoDelay(Boolean value) { 1527 impl.setPropertyValue(INSTANCE.getUseTCPNoDelayPropertyDefinition(), value); 1528 } 1529 1530 1531 1532 /** 1533 * {@inheritDoc} 1534 */ 1535 public ManagedObjectDefinition<? extends HTTPConnectionHandlerCfgClient, ? extends HTTPConnectionHandlerCfg> definition() { 1536 return INSTANCE; 1537 } 1538 1539 1540 1541 /** 1542 * {@inheritDoc} 1543 */ 1544 public PropertyProvider properties() { 1545 return impl; 1546 } 1547 1548 1549 1550 /** 1551 * {@inheritDoc} 1552 */ 1553 public void commit() throws ManagedObjectAlreadyExistsException, 1554 MissingMandatoryPropertiesException, ConcurrentModificationException, 1555 OperationRejectedException, LdapException { 1556 impl.commit(); 1557 } 1558 1559 } 1560 1561 1562 1563 /** 1564 * Managed object server implementation. 1565 */ 1566 private static class HTTPConnectionHandlerCfgServerImpl implements 1567 HTTPConnectionHandlerCfg { 1568 1569 // Private implementation. 1570 private ServerManagedObject<? extends HTTPConnectionHandlerCfg> impl; 1571 1572 // The value of the "accept-backlog" property. 1573 private final int pAcceptBacklog; 1574 1575 // The value of the "allowed-client" property. 1576 private final SortedSet<AddressMask> pAllowedClient; 1577 1578 // The value of the "allow-tcp-reuse-address" property. 1579 private final boolean pAllowTCPReuseAddress; 1580 1581 // The value of the "authentication-required" property. 1582 private final boolean pAuthenticationRequired; 1583 1584 // The value of the "buffer-size" property. 1585 private final long pBufferSize; 1586 1587 // The value of the "config-file" property. 1588 private final String pConfigFile; 1589 1590 // The value of the "denied-client" property. 1591 private final SortedSet<AddressMask> pDeniedClient; 1592 1593 // The value of the "enabled" property. 1594 private final boolean pEnabled; 1595 1596 // The value of the "java-class" property. 1597 private final String pJavaClass; 1598 1599 // The value of the "keep-stats" property. 1600 private final boolean pKeepStats; 1601 1602 // The value of the "key-manager-provider" property. 1603 private final String pKeyManagerProvider; 1604 1605 // The value of the "listen-address" property. 1606 private final SortedSet<InetAddress> pListenAddress; 1607 1608 // The value of the "listen-port" property. 1609 private final int pListenPort; 1610 1611 // The value of the "max-blocked-write-time-limit" property. 1612 private final long pMaxBlockedWriteTimeLimit; 1613 1614 // The value of the "max-concurrent-ops-per-connection" property. 1615 private final Integer pMaxConcurrentOpsPerConnection; 1616 1617 // The value of the "max-request-size" property. 1618 private final long pMaxRequestSize; 1619 1620 // The value of the "num-request-handlers" property. 1621 private final Integer pNumRequestHandlers; 1622 1623 // The value of the "ssl-cert-nickname" property. 1624 private final String pSSLCertNickname; 1625 1626 // The value of the "ssl-cipher-suite" property. 1627 private final SortedSet<String> pSSLCipherSuite; 1628 1629 // The value of the "ssl-client-auth-policy" property. 1630 private final SSLClientAuthPolicy pSSLClientAuthPolicy; 1631 1632 // The value of the "ssl-protocol" property. 1633 private final SortedSet<String> pSSLProtocol; 1634 1635 // The value of the "trust-manager-provider" property. 1636 private final String pTrustManagerProvider; 1637 1638 // The value of the "use-ssl" property. 1639 private final boolean pUseSSL; 1640 1641 // The value of the "use-tcp-keep-alive" property. 1642 private final boolean pUseTCPKeepAlive; 1643 1644 // The value of the "use-tcp-no-delay" property. 1645 private final boolean pUseTCPNoDelay; 1646 1647 1648 1649 // Private constructor. 1650 private HTTPConnectionHandlerCfgServerImpl(ServerManagedObject<? extends HTTPConnectionHandlerCfg> impl) { 1651 this.impl = impl; 1652 this.pAcceptBacklog = impl.getPropertyValue(INSTANCE.getAcceptBacklogPropertyDefinition()); 1653 this.pAllowedClient = impl.getPropertyValues(INSTANCE.getAllowedClientPropertyDefinition()); 1654 this.pAllowTCPReuseAddress = impl.getPropertyValue(INSTANCE.getAllowTCPReuseAddressPropertyDefinition()); 1655 this.pAuthenticationRequired = impl.getPropertyValue(INSTANCE.getAuthenticationRequiredPropertyDefinition()); 1656 this.pBufferSize = impl.getPropertyValue(INSTANCE.getBufferSizePropertyDefinition()); 1657 this.pConfigFile = impl.getPropertyValue(INSTANCE.getConfigFilePropertyDefinition()); 1658 this.pDeniedClient = impl.getPropertyValues(INSTANCE.getDeniedClientPropertyDefinition()); 1659 this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition()); 1660 this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition()); 1661 this.pKeepStats = impl.getPropertyValue(INSTANCE.getKeepStatsPropertyDefinition()); 1662 this.pKeyManagerProvider = impl.getPropertyValue(INSTANCE.getKeyManagerProviderPropertyDefinition()); 1663 this.pListenAddress = impl.getPropertyValues(INSTANCE.getListenAddressPropertyDefinition()); 1664 this.pListenPort = impl.getPropertyValue(INSTANCE.getListenPortPropertyDefinition()); 1665 this.pMaxBlockedWriteTimeLimit = impl.getPropertyValue(INSTANCE.getMaxBlockedWriteTimeLimitPropertyDefinition()); 1666 this.pMaxConcurrentOpsPerConnection = impl.getPropertyValue(INSTANCE.getMaxConcurrentOpsPerConnectionPropertyDefinition()); 1667 this.pMaxRequestSize = impl.getPropertyValue(INSTANCE.getMaxRequestSizePropertyDefinition()); 1668 this.pNumRequestHandlers = impl.getPropertyValue(INSTANCE.getNumRequestHandlersPropertyDefinition()); 1669 this.pSSLCertNickname = impl.getPropertyValue(INSTANCE.getSSLCertNicknamePropertyDefinition()); 1670 this.pSSLCipherSuite = impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 1671 this.pSSLClientAuthPolicy = impl.getPropertyValue(INSTANCE.getSSLClientAuthPolicyPropertyDefinition()); 1672 this.pSSLProtocol = impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 1673 this.pTrustManagerProvider = impl.getPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition()); 1674 this.pUseSSL = impl.getPropertyValue(INSTANCE.getUseSSLPropertyDefinition()); 1675 this.pUseTCPKeepAlive = impl.getPropertyValue(INSTANCE.getUseTCPKeepAlivePropertyDefinition()); 1676 this.pUseTCPNoDelay = impl.getPropertyValue(INSTANCE.getUseTCPNoDelayPropertyDefinition()); 1677 } 1678 1679 1680 1681 /** 1682 * {@inheritDoc} 1683 */ 1684 public void addHTTPChangeListener( 1685 ConfigurationChangeListener<HTTPConnectionHandlerCfg> listener) { 1686 impl.registerChangeListener(listener); 1687 } 1688 1689 1690 1691 /** 1692 * {@inheritDoc} 1693 */ 1694 public void removeHTTPChangeListener( 1695 ConfigurationChangeListener<HTTPConnectionHandlerCfg> listener) { 1696 impl.deregisterChangeListener(listener); 1697 } 1698 /** 1699 * {@inheritDoc} 1700 */ 1701 public void addChangeListener( 1702 ConfigurationChangeListener<ConnectionHandlerCfg> listener) { 1703 impl.registerChangeListener(listener); 1704 } 1705 1706 1707 1708 /** 1709 * {@inheritDoc} 1710 */ 1711 public void removeChangeListener( 1712 ConfigurationChangeListener<ConnectionHandlerCfg> listener) { 1713 impl.deregisterChangeListener(listener); 1714 } 1715 1716 1717 1718 /** 1719 * {@inheritDoc} 1720 */ 1721 public int getAcceptBacklog() { 1722 return pAcceptBacklog; 1723 } 1724 1725 1726 1727 /** 1728 * {@inheritDoc} 1729 */ 1730 public SortedSet<AddressMask> getAllowedClient() { 1731 return pAllowedClient; 1732 } 1733 1734 1735 1736 /** 1737 * {@inheritDoc} 1738 */ 1739 public boolean isAllowTCPReuseAddress() { 1740 return pAllowTCPReuseAddress; 1741 } 1742 1743 1744 1745 /** 1746 * {@inheritDoc} 1747 */ 1748 public boolean isAuthenticationRequired() { 1749 return pAuthenticationRequired; 1750 } 1751 1752 1753 1754 /** 1755 * {@inheritDoc} 1756 */ 1757 public long getBufferSize() { 1758 return pBufferSize; 1759 } 1760 1761 1762 1763 /** 1764 * {@inheritDoc} 1765 */ 1766 public String getConfigFile() { 1767 return pConfigFile; 1768 } 1769 1770 1771 1772 /** 1773 * {@inheritDoc} 1774 */ 1775 public SortedSet<AddressMask> getDeniedClient() { 1776 return pDeniedClient; 1777 } 1778 1779 1780 1781 /** 1782 * {@inheritDoc} 1783 */ 1784 public boolean isEnabled() { 1785 return pEnabled; 1786 } 1787 1788 1789 1790 /** 1791 * {@inheritDoc} 1792 */ 1793 public String getJavaClass() { 1794 return pJavaClass; 1795 } 1796 1797 1798 1799 /** 1800 * {@inheritDoc} 1801 */ 1802 public boolean isKeepStats() { 1803 return pKeepStats; 1804 } 1805 1806 1807 1808 /** 1809 * {@inheritDoc} 1810 */ 1811 public String getKeyManagerProvider() { 1812 return pKeyManagerProvider; 1813 } 1814 1815 1816 1817 /** 1818 * {@inheritDoc} 1819 */ 1820 public DN getKeyManagerProviderDN() { 1821 String value = getKeyManagerProvider(); 1822 if (value == null) return null; 1823 return INSTANCE.getKeyManagerProviderPropertyDefinition().getChildDN(value); 1824 } 1825 1826 1827 1828 /** 1829 * {@inheritDoc} 1830 */ 1831 public SortedSet<InetAddress> getListenAddress() { 1832 return pListenAddress; 1833 } 1834 1835 1836 1837 /** 1838 * {@inheritDoc} 1839 */ 1840 public int getListenPort() { 1841 return pListenPort; 1842 } 1843 1844 1845 1846 /** 1847 * {@inheritDoc} 1848 */ 1849 public long getMaxBlockedWriteTimeLimit() { 1850 return pMaxBlockedWriteTimeLimit; 1851 } 1852 1853 1854 1855 /** 1856 * {@inheritDoc} 1857 */ 1858 public Integer getMaxConcurrentOpsPerConnection() { 1859 return pMaxConcurrentOpsPerConnection; 1860 } 1861 1862 1863 1864 /** 1865 * {@inheritDoc} 1866 */ 1867 public long getMaxRequestSize() { 1868 return pMaxRequestSize; 1869 } 1870 1871 1872 1873 /** 1874 * {@inheritDoc} 1875 */ 1876 public Integer getNumRequestHandlers() { 1877 return pNumRequestHandlers; 1878 } 1879 1880 1881 1882 /** 1883 * {@inheritDoc} 1884 */ 1885 public String getSSLCertNickname() { 1886 return pSSLCertNickname; 1887 } 1888 1889 1890 1891 /** 1892 * {@inheritDoc} 1893 */ 1894 public SortedSet<String> getSSLCipherSuite() { 1895 return pSSLCipherSuite; 1896 } 1897 1898 1899 1900 /** 1901 * {@inheritDoc} 1902 */ 1903 public SSLClientAuthPolicy getSSLClientAuthPolicy() { 1904 return pSSLClientAuthPolicy; 1905 } 1906 1907 1908 1909 /** 1910 * {@inheritDoc} 1911 */ 1912 public SortedSet<String> getSSLProtocol() { 1913 return pSSLProtocol; 1914 } 1915 1916 1917 1918 /** 1919 * {@inheritDoc} 1920 */ 1921 public String getTrustManagerProvider() { 1922 return pTrustManagerProvider; 1923 } 1924 1925 1926 1927 /** 1928 * {@inheritDoc} 1929 */ 1930 public DN getTrustManagerProviderDN() { 1931 String value = getTrustManagerProvider(); 1932 if (value == null) return null; 1933 return INSTANCE.getTrustManagerProviderPropertyDefinition().getChildDN(value); 1934 } 1935 1936 1937 1938 /** 1939 * {@inheritDoc} 1940 */ 1941 public boolean isUseSSL() { 1942 return pUseSSL; 1943 } 1944 1945 1946 1947 /** 1948 * {@inheritDoc} 1949 */ 1950 public boolean isUseTCPKeepAlive() { 1951 return pUseTCPKeepAlive; 1952 } 1953 1954 1955 1956 /** 1957 * {@inheritDoc} 1958 */ 1959 public boolean isUseTCPNoDelay() { 1960 return pUseTCPNoDelay; 1961 } 1962 1963 1964 1965 /** 1966 * {@inheritDoc} 1967 */ 1968 public Class<? extends HTTPConnectionHandlerCfg> configurationClass() { 1969 return HTTPConnectionHandlerCfg.class; 1970 } 1971 1972 1973 1974 /** 1975 * {@inheritDoc} 1976 */ 1977 public DN dn() { 1978 return impl.getDN(); 1979 } 1980 1981 } 1982}