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