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