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