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