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