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