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