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