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