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