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.DN;
024import org.forgerock.opendj.ldap.schema.AttributeType;
025import org.opends.server.admin.AdministratorAction;
026import org.opends.server.admin.AggregationPropertyDefinition;
027import org.opends.server.admin.AliasDefaultBehaviorProvider;
028import org.opends.server.admin.AttributeTypePropertyDefinition;
029import org.opends.server.admin.BooleanPropertyDefinition;
030import org.opends.server.admin.ClassPropertyDefinition;
031import org.opends.server.admin.client.AuthorizationException;
032import org.opends.server.admin.client.CommunicationException;
033import org.opends.server.admin.client.ConcurrentModificationException;
034import org.opends.server.admin.client.ManagedObject;
035import org.opends.server.admin.client.MissingMandatoryPropertiesException;
036import org.opends.server.admin.client.OperationRejectedException;
037import org.opends.server.admin.condition.Conditions;
038import org.opends.server.admin.DefaultBehaviorProvider;
039import org.opends.server.admin.DefinedDefaultBehaviorProvider;
040import org.opends.server.admin.DNPropertyDefinition;
041import org.opends.server.admin.DurationPropertyDefinition;
042import org.opends.server.admin.EnumPropertyDefinition;
043import org.opends.server.admin.GenericConstraint;
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.std.client.LDAPPassThroughAuthenticationPolicyCfgClient;
052import org.opends.server.admin.std.client.PasswordStorageSchemeCfgClient;
053import org.opends.server.admin.std.client.TrustManagerProviderCfgClient;
054import org.opends.server.admin.std.server.AuthenticationPolicyCfg;
055import org.opends.server.admin.std.server.LDAPPassThroughAuthenticationPolicyCfg;
056import org.opends.server.admin.std.server.PasswordStorageSchemeCfg;
057import org.opends.server.admin.std.server.TrustManagerProviderCfg;
058import org.opends.server.admin.StringPropertyDefinition;
059import org.opends.server.admin.Tag;
060import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
061
062
063
064/**
065 * An interface for querying the LDAP Pass Through Authentication
066 * Policy managed object definition meta information.
067 * <p>
068 * An authentication policy for users whose credentials are managed by
069 * a remote LDAP directory service.
070 */
071public final class LDAPPassThroughAuthenticationPolicyCfgDefn extends ManagedObjectDefinition<LDAPPassThroughAuthenticationPolicyCfgClient, LDAPPassThroughAuthenticationPolicyCfg> {
072
073  // The singleton configuration definition instance.
074  private static final LDAPPassThroughAuthenticationPolicyCfgDefn INSTANCE = new LDAPPassThroughAuthenticationPolicyCfgDefn();
075
076
077
078  /**
079   * Defines the set of permissable values for the "mapping-policy" property.
080   * <p>
081   * Specifies the mapping algorithm for obtaining the bind DN from
082   * the user's entry.
083   */
084  public static enum MappingPolicy {
085
086    /**
087     * Bind to the remote LDAP directory service using a DN obtained
088     * from an attribute in the user's entry. This policy will check
089     * each attribute named in the "mapped-attribute" property. If more
090     * than one attribute or value is present then the first one will
091     * be used.
092     */
093    MAPPED_BIND("mapped-bind"),
094
095
096
097    /**
098     * Bind to the remote LDAP directory service using the DN of an
099     * entry obtained using a search against the remote LDAP directory
100     * service. The search filter will comprise of an equality matching
101     * filter whose attribute type is the "mapped-attribute" property,
102     * and whose assertion value is the attribute value obtained from
103     * the user's entry. If more than one attribute or value is present
104     * then the filter will be composed of multiple equality filters
105     * combined using a logical OR (union).
106     */
107    MAPPED_SEARCH("mapped-search"),
108
109
110
111    /**
112     * Bind to the remote LDAP directory service using the DN of the
113     * user's entry in this directory server.
114     */
115    UNMAPPED("unmapped");
116
117
118
119    // String representation of the value.
120    private final String name;
121
122
123
124    // Private constructor.
125    private MappingPolicy(String name) { this.name = name; }
126
127
128
129    /**
130     * {@inheritDoc}
131     */
132    public String toString() { return name; }
133
134  }
135
136
137
138  // The "cached-password-storage-scheme" property definition.
139  private static final AggregationPropertyDefinition<PasswordStorageSchemeCfgClient, PasswordStorageSchemeCfg> PD_CACHED_PASSWORD_STORAGE_SCHEME;
140
141
142
143  // The "cached-password-ttl" property definition.
144  private static final DurationPropertyDefinition PD_CACHED_PASSWORD_TTL;
145
146
147
148  // The "connection-timeout" property definition.
149  private static final DurationPropertyDefinition PD_CONNECTION_TIMEOUT;
150
151
152
153  // The "java-class" property definition.
154  private static final ClassPropertyDefinition PD_JAVA_CLASS;
155
156
157
158  // The "mapped-attribute" property definition.
159  private static final AttributeTypePropertyDefinition PD_MAPPED_ATTRIBUTE;
160
161
162
163  // The "mapped-search-base-dn" property definition.
164  private static final DNPropertyDefinition PD_MAPPED_SEARCH_BASE_DN;
165
166
167
168  // The "mapped-search-bind-dn" property definition.
169  private static final DNPropertyDefinition PD_MAPPED_SEARCH_BIND_DN;
170
171
172
173  // The "mapped-search-bind-password" property definition.
174  private static final StringPropertyDefinition PD_MAPPED_SEARCH_BIND_PASSWORD;
175
176
177
178  // The "mapped-search-bind-password-environment-variable" property definition.
179  private static final StringPropertyDefinition PD_MAPPED_SEARCH_BIND_PASSWORD_ENVIRONMENT_VARIABLE;
180
181
182
183  // The "mapped-search-bind-password-file" property definition.
184  private static final StringPropertyDefinition PD_MAPPED_SEARCH_BIND_PASSWORD_FILE;
185
186
187
188  // The "mapped-search-bind-password-property" property definition.
189  private static final StringPropertyDefinition PD_MAPPED_SEARCH_BIND_PASSWORD_PROPERTY;
190
191
192
193  // The "mapping-policy" property definition.
194  private static final EnumPropertyDefinition<MappingPolicy> PD_MAPPING_POLICY;
195
196
197
198  // The "primary-remote-ldap-server" property definition.
199  private static final StringPropertyDefinition PD_PRIMARY_REMOTE_LDAP_SERVER;
200
201
202
203  // The "secondary-remote-ldap-server" property definition.
204  private static final StringPropertyDefinition PD_SECONDARY_REMOTE_LDAP_SERVER;
205
206
207
208  // The "source-address" property definition.
209  private static final IPAddressPropertyDefinition PD_SOURCE_ADDRESS;
210
211
212
213  // The "ssl-cipher-suite" property definition.
214  private static final StringPropertyDefinition PD_SSL_CIPHER_SUITE;
215
216
217
218  // The "ssl-protocol" property definition.
219  private static final StringPropertyDefinition PD_SSL_PROTOCOL;
220
221
222
223  // The "trust-manager-provider" property definition.
224  private static final AggregationPropertyDefinition<TrustManagerProviderCfgClient, TrustManagerProviderCfg> PD_TRUST_MANAGER_PROVIDER;
225
226
227
228  // The "use-password-caching" property definition.
229  private static final BooleanPropertyDefinition PD_USE_PASSWORD_CACHING;
230
231
232
233  // The "use-ssl" property definition.
234  private static final BooleanPropertyDefinition PD_USE_SSL;
235
236
237
238  // The "use-tcp-keep-alive" property definition.
239  private static final BooleanPropertyDefinition PD_USE_TCP_KEEP_ALIVE;
240
241
242
243  // The "use-tcp-no-delay" property definition.
244  private static final BooleanPropertyDefinition PD_USE_TCP_NO_DELAY;
245
246
247
248  // Build the "cached-password-storage-scheme" property definition.
249  static {
250      AggregationPropertyDefinition.Builder<PasswordStorageSchemeCfgClient, PasswordStorageSchemeCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "cached-password-storage-scheme");
251      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "cached-password-storage-scheme"));
252      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
253      builder.setParentPath("/");
254      builder.setRelationDefinition("password-storage-scheme");
255      builder.setTargetIsEnabledCondition(Conditions.contains("enabled", "true"));
256      PD_CACHED_PASSWORD_STORAGE_SCHEME = builder.getInstance();
257      INSTANCE.registerPropertyDefinition(PD_CACHED_PASSWORD_STORAGE_SCHEME);
258      INSTANCE.registerConstraint(PD_CACHED_PASSWORD_STORAGE_SCHEME.getSourceConstraint());
259  }
260
261
262
263  // Build the "cached-password-ttl" property definition.
264  static {
265      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "cached-password-ttl");
266      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "cached-password-ttl"));
267      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("8 hours");
268      builder.setDefaultBehaviorProvider(provider);
269      builder.setBaseUnit("s");
270      PD_CACHED_PASSWORD_TTL = builder.getInstance();
271      INSTANCE.registerPropertyDefinition(PD_CACHED_PASSWORD_TTL);
272  }
273
274
275
276  // Build the "connection-timeout" property definition.
277  static {
278      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "connection-timeout");
279      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "connection-timeout"));
280      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("3 seconds");
281      builder.setDefaultBehaviorProvider(provider);
282      builder.setBaseUnit("ms");
283      builder.setLowerLimit("0");
284      PD_CONNECTION_TIMEOUT = builder.getInstance();
285      INSTANCE.registerPropertyDefinition(PD_CONNECTION_TIMEOUT);
286  }
287
288
289
290  // Build the "java-class" property definition.
291  static {
292      ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
293      builder.setOption(PropertyOption.MANDATORY);
294      builder.setOption(PropertyOption.ADVANCED);
295      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "java-class"));
296      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.extensions.LDAPPassThroughAuthenticationPolicyFactory");
297      builder.setDefaultBehaviorProvider(provider);
298      builder.addInstanceOf("org.opends.server.api.AuthenticationPolicyFactory");
299      PD_JAVA_CLASS = builder.getInstance();
300      INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
301  }
302
303
304
305  // Build the "mapped-attribute" property definition.
306  static {
307      AttributeTypePropertyDefinition.Builder builder = AttributeTypePropertyDefinition.createBuilder(INSTANCE, "mapped-attribute");
308      builder.setOption(PropertyOption.MULTI_VALUED);
309      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-attribute"));
310      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<AttributeType>());
311      PD_MAPPED_ATTRIBUTE = builder.getInstance();
312      INSTANCE.registerPropertyDefinition(PD_MAPPED_ATTRIBUTE);
313  }
314
315
316
317  // Build the "mapped-search-base-dn" property definition.
318  static {
319      DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "mapped-search-base-dn");
320      builder.setOption(PropertyOption.MULTI_VALUED);
321      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-search-base-dn"));
322      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<DN>());
323      PD_MAPPED_SEARCH_BASE_DN = builder.getInstance();
324      INSTANCE.registerPropertyDefinition(PD_MAPPED_SEARCH_BASE_DN);
325  }
326
327
328
329  // Build the "mapped-search-bind-dn" property definition.
330  static {
331      DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "mapped-search-bind-dn");
332      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-search-bind-dn"));
333      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<DN>(INSTANCE, "mapped-search-bind-dn"));
334      PD_MAPPED_SEARCH_BIND_DN = builder.getInstance();
335      INSTANCE.registerPropertyDefinition(PD_MAPPED_SEARCH_BIND_DN);
336  }
337
338
339
340  // Build the "mapped-search-bind-password" property definition.
341  static {
342      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "mapped-search-bind-password");
343      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-search-bind-password"));
344      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
345      PD_MAPPED_SEARCH_BIND_PASSWORD = builder.getInstance();
346      INSTANCE.registerPropertyDefinition(PD_MAPPED_SEARCH_BIND_PASSWORD);
347  }
348
349
350
351  // Build the "mapped-search-bind-password-environment-variable" property definition.
352  static {
353      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "mapped-search-bind-password-environment-variable");
354      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-search-bind-password-environment-variable"));
355      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
356      PD_MAPPED_SEARCH_BIND_PASSWORD_ENVIRONMENT_VARIABLE = builder.getInstance();
357      INSTANCE.registerPropertyDefinition(PD_MAPPED_SEARCH_BIND_PASSWORD_ENVIRONMENT_VARIABLE);
358  }
359
360
361
362  // Build the "mapped-search-bind-password-file" property definition.
363  static {
364      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "mapped-search-bind-password-file");
365      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-search-bind-password-file"));
366      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
367      PD_MAPPED_SEARCH_BIND_PASSWORD_FILE = builder.getInstance();
368      INSTANCE.registerPropertyDefinition(PD_MAPPED_SEARCH_BIND_PASSWORD_FILE);
369  }
370
371
372
373  // Build the "mapped-search-bind-password-property" property definition.
374  static {
375      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "mapped-search-bind-password-property");
376      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapped-search-bind-password-property"));
377      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
378      PD_MAPPED_SEARCH_BIND_PASSWORD_PROPERTY = builder.getInstance();
379      INSTANCE.registerPropertyDefinition(PD_MAPPED_SEARCH_BIND_PASSWORD_PROPERTY);
380  }
381
382
383
384  // Build the "mapping-policy" property definition.
385  static {
386      EnumPropertyDefinition.Builder<MappingPolicy> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "mapping-policy");
387      builder.setOption(PropertyOption.MANDATORY);
388      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mapping-policy"));
389      DefaultBehaviorProvider<MappingPolicy> provider = new DefinedDefaultBehaviorProvider<MappingPolicy>("unmapped");
390      builder.setDefaultBehaviorProvider(provider);
391      builder.setEnumClass(MappingPolicy.class);
392      PD_MAPPING_POLICY = builder.getInstance();
393      INSTANCE.registerPropertyDefinition(PD_MAPPING_POLICY);
394  }
395
396
397
398  // Build the "primary-remote-ldap-server" property definition.
399  static {
400      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "primary-remote-ldap-server");
401      builder.setOption(PropertyOption.MULTI_VALUED);
402      builder.setOption(PropertyOption.MANDATORY);
403      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "primary-remote-ldap-server"));
404      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
405      builder.setPattern("^.+:[0-9]+$", "HOST:PORT");
406      PD_PRIMARY_REMOTE_LDAP_SERVER = builder.getInstance();
407      INSTANCE.registerPropertyDefinition(PD_PRIMARY_REMOTE_LDAP_SERVER);
408  }
409
410
411
412  // Build the "secondary-remote-ldap-server" property definition.
413  static {
414      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "secondary-remote-ldap-server");
415      builder.setOption(PropertyOption.MULTI_VALUED);
416      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "secondary-remote-ldap-server"));
417      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "secondary-remote-ldap-server"));
418      builder.setPattern("^.+:[0-9]+$", "HOST:PORT");
419      PD_SECONDARY_REMOTE_LDAP_SERVER = builder.getInstance();
420      INSTANCE.registerPropertyDefinition(PD_SECONDARY_REMOTE_LDAP_SERVER);
421  }
422
423
424
425  // Build the "source-address" property definition.
426  static {
427      IPAddressPropertyDefinition.Builder builder = IPAddressPropertyDefinition.createBuilder(INSTANCE, "source-address");
428      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "source-address"));
429      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<InetAddress>(INSTANCE, "source-address"));
430      PD_SOURCE_ADDRESS = builder.getInstance();
431      INSTANCE.registerPropertyDefinition(PD_SOURCE_ADDRESS);
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.setOption(PropertyOption.ADVANCED);
441      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-cipher-suite"));
442      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cipher-suite"));
443      PD_SSL_CIPHER_SUITE = builder.getInstance();
444      INSTANCE.registerPropertyDefinition(PD_SSL_CIPHER_SUITE);
445  }
446
447
448
449  // Build the "ssl-protocol" property definition.
450  static {
451      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-protocol");
452      builder.setOption(PropertyOption.MULTI_VALUED);
453      builder.setOption(PropertyOption.ADVANCED);
454      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-protocol"));
455      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-protocol"));
456      PD_SSL_PROTOCOL = builder.getInstance();
457      INSTANCE.registerPropertyDefinition(PD_SSL_PROTOCOL);
458  }
459
460
461
462  // Build the "trust-manager-provider" property definition.
463  static {
464      AggregationPropertyDefinition.Builder<TrustManagerProviderCfgClient, TrustManagerProviderCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "trust-manager-provider");
465      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-manager-provider"));
466      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "trust-manager-provider"));
467      builder.setParentPath("/");
468      builder.setRelationDefinition("trust-manager-provider");
469      builder.setTargetNeedsEnablingCondition(Conditions.and(Conditions.contains("use-ssl", "true")));
470      builder.setTargetIsEnabledCondition(Conditions.contains("enabled", "true"));
471      PD_TRUST_MANAGER_PROVIDER = builder.getInstance();
472      INSTANCE.registerPropertyDefinition(PD_TRUST_MANAGER_PROVIDER);
473      INSTANCE.registerConstraint(PD_TRUST_MANAGER_PROVIDER.getSourceConstraint());
474  }
475
476
477
478  // Build the "use-password-caching" property definition.
479  static {
480      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-password-caching");
481      builder.setOption(PropertyOption.MANDATORY);
482      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "use-password-caching"));
483      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
484      builder.setDefaultBehaviorProvider(provider);
485      PD_USE_PASSWORD_CACHING = builder.getInstance();
486      INSTANCE.registerPropertyDefinition(PD_USE_PASSWORD_CACHING);
487  }
488
489
490
491  // Build the "use-ssl" property definition.
492  static {
493      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-ssl");
494      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "use-ssl"));
495      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
496      builder.setDefaultBehaviorProvider(provider);
497      PD_USE_SSL = builder.getInstance();
498      INSTANCE.registerPropertyDefinition(PD_USE_SSL);
499  }
500
501
502
503  // Build the "use-tcp-keep-alive" property definition.
504  static {
505      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-tcp-keep-alive");
506      builder.setOption(PropertyOption.ADVANCED);
507      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "use-tcp-keep-alive"));
508      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
509      builder.setDefaultBehaviorProvider(provider);
510      PD_USE_TCP_KEEP_ALIVE = builder.getInstance();
511      INSTANCE.registerPropertyDefinition(PD_USE_TCP_KEEP_ALIVE);
512  }
513
514
515
516  // Build the "use-tcp-no-delay" property definition.
517  static {
518      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "use-tcp-no-delay");
519      builder.setOption(PropertyOption.ADVANCED);
520      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "use-tcp-no-delay"));
521      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
522      builder.setDefaultBehaviorProvider(provider);
523      PD_USE_TCP_NO_DELAY = builder.getInstance();
524      INSTANCE.registerPropertyDefinition(PD_USE_TCP_NO_DELAY);
525  }
526
527
528
529  // Register the tags associated with this managed object definition.
530  static {
531    INSTANCE.registerTag(Tag.valueOf("user-management"));
532  }
533
534
535
536  // Register the constraints associated with this managed object definition.
537  static {
538    INSTANCE.registerConstraint(new GenericConstraint(INSTANCE, 1, Conditions.implies(Conditions.or(Conditions.contains("mapping-policy", "mapped-bind"), Conditions.contains("mapping-policy", "mapped-search")), Conditions.isPresent("mapped-attribute"))));
539    INSTANCE.registerConstraint(new GenericConstraint(INSTANCE, 2, Conditions.implies(Conditions.contains("mapping-policy", "mapped-search"), Conditions.isPresent("mapped-search-base-dn"))));
540    INSTANCE.registerConstraint(new GenericConstraint(INSTANCE, 3, Conditions.implies(Conditions.and(Conditions.contains("mapping-policy", "mapped-search"), Conditions.isPresent("mapped-search-bind-dn")), Conditions.or(Conditions.isPresent("mapped-search-bind-password"), Conditions.isPresent("mapped-search-bind-password-property"), Conditions.isPresent("mapped-search-bind-password-environment-variable"), Conditions.isPresent("mapped-search-bind-password-file")))));
541    INSTANCE.registerConstraint(new GenericConstraint(INSTANCE, 4, Conditions.implies(Conditions.contains("use-password-caching", "true"), Conditions.isPresent("cached-password-storage-scheme"))));
542  }
543
544
545
546  /**
547   * Get the LDAP Pass Through Authentication Policy configuration
548   * definition singleton.
549   *
550   * @return Returns the LDAP Pass Through Authentication Policy
551   *         configuration definition singleton.
552   */
553  public static LDAPPassThroughAuthenticationPolicyCfgDefn getInstance() {
554    return INSTANCE;
555  }
556
557
558
559  /**
560   * Private constructor.
561   */
562  private LDAPPassThroughAuthenticationPolicyCfgDefn() {
563    super("ldap-pass-through-authentication-policy", AuthenticationPolicyCfgDefn.getInstance());
564  }
565
566
567
568  /**
569   * {@inheritDoc}
570   */
571  public LDAPPassThroughAuthenticationPolicyCfgClient createClientConfiguration(
572      ManagedObject<? extends LDAPPassThroughAuthenticationPolicyCfgClient> impl) {
573    return new LDAPPassThroughAuthenticationPolicyCfgClientImpl(impl);
574  }
575
576
577
578  /**
579   * {@inheritDoc}
580   */
581  public LDAPPassThroughAuthenticationPolicyCfg createServerConfiguration(
582      ServerManagedObject<? extends LDAPPassThroughAuthenticationPolicyCfg> impl) {
583    return new LDAPPassThroughAuthenticationPolicyCfgServerImpl(impl);
584  }
585
586
587
588  /**
589   * {@inheritDoc}
590   */
591  public Class<LDAPPassThroughAuthenticationPolicyCfg> getServerConfigurationClass() {
592    return LDAPPassThroughAuthenticationPolicyCfg.class;
593  }
594
595
596
597  /**
598   * Get the "cached-password-storage-scheme" property definition.
599   * <p>
600   * Specifies the name of a password storage scheme which should be
601   * used for encoding cached passwords.
602   * <p>
603   * Changing the password storage scheme will cause all existing
604   * cached passwords to be discarded.
605   *
606   * @return Returns the "cached-password-storage-scheme" property definition.
607   */
608  public AggregationPropertyDefinition<PasswordStorageSchemeCfgClient, PasswordStorageSchemeCfg> getCachedPasswordStorageSchemePropertyDefinition() {
609    return PD_CACHED_PASSWORD_STORAGE_SCHEME;
610  }
611
612
613
614  /**
615   * Get the "cached-password-ttl" property definition.
616   * <p>
617   * Specifies the maximum length of time that a locally cached
618   * password may be used for authentication before it is refreshed
619   * from the remote LDAP service.
620   * <p>
621   * This property represents a cache timeout. Increasing the timeout
622   * period decreases the frequency that bind operations are delegated
623   * to the remote LDAP service, but increases the risk of users
624   * authenticating using stale passwords. Note that authentication
625   * attempts which fail because the provided password does not match
626   * the locally cached password will always be retried against the
627   * remote LDAP service.
628   *
629   * @return Returns the "cached-password-ttl" property definition.
630   */
631  public DurationPropertyDefinition getCachedPasswordTTLPropertyDefinition() {
632    return PD_CACHED_PASSWORD_TTL;
633  }
634
635
636
637  /**
638   * Get the "connection-timeout" property definition.
639   * <p>
640   * Specifies the timeout used when connecting to remote LDAP
641   * directory servers, performing SSL negotiation, and for individual
642   * search and bind requests.
643   * <p>
644   * If the timeout expires then the current operation will be aborted
645   * and retried against another LDAP server if one is available.
646   *
647   * @return Returns the "connection-timeout" property definition.
648   */
649  public DurationPropertyDefinition getConnectionTimeoutPropertyDefinition() {
650    return PD_CONNECTION_TIMEOUT;
651  }
652
653
654
655  /**
656   * Get the "java-class" property definition.
657   * <p>
658   * Specifies the fully-qualified name of the Java class which
659   * provides the LDAP Pass Through Authentication Policy
660   * implementation.
661   *
662   * @return Returns the "java-class" property definition.
663   */
664  public ClassPropertyDefinition getJavaClassPropertyDefinition() {
665    return PD_JAVA_CLASS;
666  }
667
668
669
670  /**
671   * Get the "mapped-attribute" property definition.
672   * <p>
673   * Specifies one or more attributes in the user's entry whose
674   * value(s) will determine the bind DN used when authenticating to
675   * the remote LDAP directory service. This property is mandatory when
676   * using the "mapped-bind" or "mapped-search" mapping policies.
677   * <p>
678   * At least one value must be provided. All values must refer to the
679   * name or OID of an attribute type defined in the directory server
680   * schema. At least one of the named attributes must exist in a
681   * user's local entry in order for authentication to proceed. When
682   * multiple attributes or values are found in the user's entry then
683   * the behavior is determined by the mapping policy.
684   *
685   * @return Returns the "mapped-attribute" property definition.
686   */
687  public AttributeTypePropertyDefinition getMappedAttributePropertyDefinition() {
688    return PD_MAPPED_ATTRIBUTE;
689  }
690
691
692
693  /**
694   * Get the "mapped-search-base-dn" property definition.
695   * <p>
696   * Specifies the set of base DNs below which to search for users in
697   * the remote LDAP directory service. This property is mandatory when
698   * using the "mapped-search" mapping policy.
699   * <p>
700   * If multiple values are given, searches are performed below all
701   * specified base DNs.
702   *
703   * @return Returns the "mapped-search-base-dn" property definition.
704   */
705  public DNPropertyDefinition getMappedSearchBaseDNPropertyDefinition() {
706    return PD_MAPPED_SEARCH_BASE_DN;
707  }
708
709
710
711  /**
712   * Get the "mapped-search-bind-dn" property definition.
713   * <p>
714   * Specifies the bind DN which should be used to perform user
715   * searches in the remote LDAP directory service.
716   *
717   * @return Returns the "mapped-search-bind-dn" property definition.
718   */
719  public DNPropertyDefinition getMappedSearchBindDNPropertyDefinition() {
720    return PD_MAPPED_SEARCH_BIND_DN;
721  }
722
723
724
725  /**
726   * Get the "mapped-search-bind-password" property definition.
727   * <p>
728   * Specifies the bind password which should be used to perform user
729   * searches in the remote LDAP directory service.
730   *
731   * @return Returns the "mapped-search-bind-password" property definition.
732   */
733  public StringPropertyDefinition getMappedSearchBindPasswordPropertyDefinition() {
734    return PD_MAPPED_SEARCH_BIND_PASSWORD;
735  }
736
737
738
739  /**
740   * Get the "mapped-search-bind-password-environment-variable" property definition.
741   * <p>
742   * Specifies the name of an environment variable containing the bind
743   * password which should be used to perform user searches in the
744   * remote LDAP directory service.
745   *
746   * @return Returns the "mapped-search-bind-password-environment-variable" property definition.
747   */
748  public StringPropertyDefinition getMappedSearchBindPasswordEnvironmentVariablePropertyDefinition() {
749    return PD_MAPPED_SEARCH_BIND_PASSWORD_ENVIRONMENT_VARIABLE;
750  }
751
752
753
754  /**
755   * Get the "mapped-search-bind-password-file" property definition.
756   * <p>
757   * Specifies the name of a file containing the bind password which
758   * should be used to perform user searches in the remote LDAP
759   * directory service.
760   *
761   * @return Returns the "mapped-search-bind-password-file" property definition.
762   */
763  public StringPropertyDefinition getMappedSearchBindPasswordFilePropertyDefinition() {
764    return PD_MAPPED_SEARCH_BIND_PASSWORD_FILE;
765  }
766
767
768
769  /**
770   * Get the "mapped-search-bind-password-property" property definition.
771   * <p>
772   * Specifies the name of a Java property containing the bind
773   * password which should be used to perform user searches in the
774   * remote LDAP directory service.
775   *
776   * @return Returns the "mapped-search-bind-password-property" property definition.
777   */
778  public StringPropertyDefinition getMappedSearchBindPasswordPropertyPropertyDefinition() {
779    return PD_MAPPED_SEARCH_BIND_PASSWORD_PROPERTY;
780  }
781
782
783
784  /**
785   * Get the "mapping-policy" property definition.
786   * <p>
787   * Specifies the mapping algorithm for obtaining the bind DN from
788   * the user's entry.
789   *
790   * @return Returns the "mapping-policy" property definition.
791   */
792  public EnumPropertyDefinition<MappingPolicy> getMappingPolicyPropertyDefinition() {
793    return PD_MAPPING_POLICY;
794  }
795
796
797
798  /**
799   * Get the "primary-remote-ldap-server" property definition.
800   * <p>
801   * Specifies the primary list of remote LDAP servers which should be
802   * used for pass through authentication.
803   * <p>
804   * If more than one LDAP server is specified then operations may be
805   * distributed across them. If all of the primary LDAP servers are
806   * unavailable then operations will fail-over to the set of secondary
807   * LDAP servers, if defined.
808   *
809   * @return Returns the "primary-remote-ldap-server" property definition.
810   */
811  public StringPropertyDefinition getPrimaryRemoteLDAPServerPropertyDefinition() {
812    return PD_PRIMARY_REMOTE_LDAP_SERVER;
813  }
814
815
816
817  /**
818   * Get the "secondary-remote-ldap-server" property definition.
819   * <p>
820   * Specifies the secondary list of remote LDAP servers which should
821   * be used for pass through authentication in the event that the
822   * primary LDAP servers are unavailable.
823   * <p>
824   * If more than one LDAP server is specified then operations may be
825   * distributed across them. Operations will be rerouted to the
826   * primary LDAP servers as soon as they are determined to be
827   * available.
828   *
829   * @return Returns the "secondary-remote-ldap-server" property definition.
830   */
831  public StringPropertyDefinition getSecondaryRemoteLDAPServerPropertyDefinition() {
832    return PD_SECONDARY_REMOTE_LDAP_SERVER;
833  }
834
835
836
837  /**
838   * Get the "source-address" property definition.
839   * <p>
840   * If specified, the server will bind to the address before
841   * connecting to the remote server.
842   * <p>
843   * The address must be one assigned to an existing network
844   * interface.
845   *
846   * @return Returns the "source-address" property definition.
847   */
848  public IPAddressPropertyDefinition getSourceAddressPropertyDefinition() {
849    return PD_SOURCE_ADDRESS;
850  }
851
852
853
854  /**
855   * Get the "ssl-cipher-suite" property definition.
856   * <p>
857   * Specifies the names of the SSL cipher suites that are allowed for
858   * use in SSL based LDAP connections.
859   *
860   * @return Returns the "ssl-cipher-suite" property definition.
861   */
862  public StringPropertyDefinition getSSLCipherSuitePropertyDefinition() {
863    return PD_SSL_CIPHER_SUITE;
864  }
865
866
867
868  /**
869   * Get the "ssl-protocol" property definition.
870   * <p>
871   * Specifies the names of the SSL protocols which are allowed for
872   * use in SSL based LDAP connections.
873   *
874   * @return Returns the "ssl-protocol" property definition.
875   */
876  public StringPropertyDefinition getSSLProtocolPropertyDefinition() {
877    return PD_SSL_PROTOCOL;
878  }
879
880
881
882  /**
883   * Get the "trust-manager-provider" property definition.
884   * <p>
885   * Specifies the name of the trust manager that should be used when
886   * negotiating SSL connections with remote LDAP directory servers.
887   *
888   * @return Returns the "trust-manager-provider" property definition.
889   */
890  public AggregationPropertyDefinition<TrustManagerProviderCfgClient, TrustManagerProviderCfg> getTrustManagerProviderPropertyDefinition() {
891    return PD_TRUST_MANAGER_PROVIDER;
892  }
893
894
895
896  /**
897   * Get the "use-password-caching" property definition.
898   * <p>
899   * Indicates whether passwords should be cached locally within the
900   * user's entry.
901   *
902   * @return Returns the "use-password-caching" property definition.
903   */
904  public BooleanPropertyDefinition getUsePasswordCachingPropertyDefinition() {
905    return PD_USE_PASSWORD_CACHING;
906  }
907
908
909
910  /**
911   * Get the "use-ssl" property definition.
912   * <p>
913   * Indicates whether the LDAP Pass Through Authentication Policy
914   * should use SSL.
915   * <p>
916   * If enabled, the LDAP Pass Through Authentication Policy will use
917   * SSL to encrypt communication with the clients.
918   *
919   * @return Returns the "use-ssl" property definition.
920   */
921  public BooleanPropertyDefinition getUseSSLPropertyDefinition() {
922    return PD_USE_SSL;
923  }
924
925
926
927  /**
928   * Get the "use-tcp-keep-alive" property definition.
929   * <p>
930   * Indicates whether LDAP connections should use TCP keep-alive.
931   * <p>
932   * If enabled, the SO_KEEPALIVE socket option is used to indicate
933   * that TCP keepalive messages should periodically be sent to the
934   * client to verify that the associated connection is still valid.
935   * This may also help prevent cases in which intermediate network
936   * hardware could silently drop an otherwise idle client connection,
937   * provided that the keepalive interval configured in the underlying
938   * operating system is smaller than the timeout enforced by the
939   * network hardware.
940   *
941   * @return Returns the "use-tcp-keep-alive" property definition.
942   */
943  public BooleanPropertyDefinition getUseTCPKeepAlivePropertyDefinition() {
944    return PD_USE_TCP_KEEP_ALIVE;
945  }
946
947
948
949  /**
950   * Get the "use-tcp-no-delay" property definition.
951   * <p>
952   * Indicates whether LDAP connections should use TCP no-delay.
953   * <p>
954   * If enabled, the TCP_NODELAY socket option is used to ensure that
955   * response messages to the client are sent immediately rather than
956   * potentially waiting to determine whether additional response
957   * messages can be sent in the same packet. In most cases, using the
958   * TCP_NODELAY socket option provides better performance and lower
959   * response times, but disabling it may help for some cases in which
960   * the server sends a large number of entries to a client in response
961   * to a search request.
962   *
963   * @return Returns the "use-tcp-no-delay" property definition.
964   */
965  public BooleanPropertyDefinition getUseTCPNoDelayPropertyDefinition() {
966    return PD_USE_TCP_NO_DELAY;
967  }
968
969
970
971  /**
972   * Managed object client implementation.
973   */
974  private static class LDAPPassThroughAuthenticationPolicyCfgClientImpl implements
975    LDAPPassThroughAuthenticationPolicyCfgClient {
976
977    // Private implementation.
978    private ManagedObject<? extends LDAPPassThroughAuthenticationPolicyCfgClient> impl;
979
980
981
982    // Private constructor.
983    private LDAPPassThroughAuthenticationPolicyCfgClientImpl(
984        ManagedObject<? extends LDAPPassThroughAuthenticationPolicyCfgClient> impl) {
985      this.impl = impl;
986    }
987
988
989
990    /**
991     * {@inheritDoc}
992     */
993    public String getCachedPasswordStorageScheme() {
994      return impl.getPropertyValue(INSTANCE.getCachedPasswordStorageSchemePropertyDefinition());
995    }
996
997
998
999    /**
1000     * {@inheritDoc}
1001     */
1002    public void setCachedPasswordStorageScheme(String value) {
1003      impl.setPropertyValue(INSTANCE.getCachedPasswordStorageSchemePropertyDefinition(), value);
1004    }
1005
1006
1007
1008    /**
1009     * {@inheritDoc}
1010     */
1011    public long getCachedPasswordTTL() {
1012      return impl.getPropertyValue(INSTANCE.getCachedPasswordTTLPropertyDefinition());
1013    }
1014
1015
1016
1017    /**
1018     * {@inheritDoc}
1019     */
1020    public void setCachedPasswordTTL(Long value) {
1021      impl.setPropertyValue(INSTANCE.getCachedPasswordTTLPropertyDefinition(), value);
1022    }
1023
1024
1025
1026    /**
1027     * {@inheritDoc}
1028     */
1029    public long getConnectionTimeout() {
1030      return impl.getPropertyValue(INSTANCE.getConnectionTimeoutPropertyDefinition());
1031    }
1032
1033
1034
1035    /**
1036     * {@inheritDoc}
1037     */
1038    public void setConnectionTimeout(Long value) {
1039      impl.setPropertyValue(INSTANCE.getConnectionTimeoutPropertyDefinition(), value);
1040    }
1041
1042
1043
1044    /**
1045     * {@inheritDoc}
1046     */
1047    public String getJavaClass() {
1048      return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
1049    }
1050
1051
1052
1053    /**
1054     * {@inheritDoc}
1055     */
1056    public void setJavaClass(String value) {
1057      impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
1058    }
1059
1060
1061
1062    /**
1063     * {@inheritDoc}
1064     */
1065    public SortedSet<AttributeType> getMappedAttribute() {
1066      return impl.getPropertyValues(INSTANCE.getMappedAttributePropertyDefinition());
1067    }
1068
1069
1070
1071    /**
1072     * {@inheritDoc}
1073     */
1074    public void setMappedAttribute(Collection<AttributeType> values) {
1075      impl.setPropertyValues(INSTANCE.getMappedAttributePropertyDefinition(), values);
1076    }
1077
1078
1079
1080    /**
1081     * {@inheritDoc}
1082     */
1083    public SortedSet<DN> getMappedSearchBaseDN() {
1084      return impl.getPropertyValues(INSTANCE.getMappedSearchBaseDNPropertyDefinition());
1085    }
1086
1087
1088
1089    /**
1090     * {@inheritDoc}
1091     */
1092    public void setMappedSearchBaseDN(Collection<DN> values) {
1093      impl.setPropertyValues(INSTANCE.getMappedSearchBaseDNPropertyDefinition(), values);
1094    }
1095
1096
1097
1098    /**
1099     * {@inheritDoc}
1100     */
1101    public DN getMappedSearchBindDN() {
1102      return impl.getPropertyValue(INSTANCE.getMappedSearchBindDNPropertyDefinition());
1103    }
1104
1105
1106
1107    /**
1108     * {@inheritDoc}
1109     */
1110    public void setMappedSearchBindDN(DN value) {
1111      impl.setPropertyValue(INSTANCE.getMappedSearchBindDNPropertyDefinition(), value);
1112    }
1113
1114
1115
1116    /**
1117     * {@inheritDoc}
1118     */
1119    public String getMappedSearchBindPassword() {
1120      return impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordPropertyDefinition());
1121    }
1122
1123
1124
1125    /**
1126     * {@inheritDoc}
1127     */
1128    public void setMappedSearchBindPassword(String value) {
1129      impl.setPropertyValue(INSTANCE.getMappedSearchBindPasswordPropertyDefinition(), value);
1130    }
1131
1132
1133
1134    /**
1135     * {@inheritDoc}
1136     */
1137    public String getMappedSearchBindPasswordEnvironmentVariable() {
1138      return impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordEnvironmentVariablePropertyDefinition());
1139    }
1140
1141
1142
1143    /**
1144     * {@inheritDoc}
1145     */
1146    public void setMappedSearchBindPasswordEnvironmentVariable(String value) {
1147      impl.setPropertyValue(INSTANCE.getMappedSearchBindPasswordEnvironmentVariablePropertyDefinition(), value);
1148    }
1149
1150
1151
1152    /**
1153     * {@inheritDoc}
1154     */
1155    public String getMappedSearchBindPasswordFile() {
1156      return impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordFilePropertyDefinition());
1157    }
1158
1159
1160
1161    /**
1162     * {@inheritDoc}
1163     */
1164    public void setMappedSearchBindPasswordFile(String value) {
1165      impl.setPropertyValue(INSTANCE.getMappedSearchBindPasswordFilePropertyDefinition(), value);
1166    }
1167
1168
1169
1170    /**
1171     * {@inheritDoc}
1172     */
1173    public String getMappedSearchBindPasswordProperty() {
1174      return impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordPropertyPropertyDefinition());
1175    }
1176
1177
1178
1179    /**
1180     * {@inheritDoc}
1181     */
1182    public void setMappedSearchBindPasswordProperty(String value) {
1183      impl.setPropertyValue(INSTANCE.getMappedSearchBindPasswordPropertyPropertyDefinition(), value);
1184    }
1185
1186
1187
1188    /**
1189     * {@inheritDoc}
1190     */
1191    public MappingPolicy getMappingPolicy() {
1192      return impl.getPropertyValue(INSTANCE.getMappingPolicyPropertyDefinition());
1193    }
1194
1195
1196
1197    /**
1198     * {@inheritDoc}
1199     */
1200    public void setMappingPolicy(MappingPolicy value) {
1201      impl.setPropertyValue(INSTANCE.getMappingPolicyPropertyDefinition(), value);
1202    }
1203
1204
1205
1206    /**
1207     * {@inheritDoc}
1208     */
1209    public SortedSet<String> getPrimaryRemoteLDAPServer() {
1210      return impl.getPropertyValues(INSTANCE.getPrimaryRemoteLDAPServerPropertyDefinition());
1211    }
1212
1213
1214
1215    /**
1216     * {@inheritDoc}
1217     */
1218    public void setPrimaryRemoteLDAPServer(Collection<String> values) {
1219      impl.setPropertyValues(INSTANCE.getPrimaryRemoteLDAPServerPropertyDefinition(), values);
1220    }
1221
1222
1223
1224    /**
1225     * {@inheritDoc}
1226     */
1227    public SortedSet<String> getSecondaryRemoteLDAPServer() {
1228      return impl.getPropertyValues(INSTANCE.getSecondaryRemoteLDAPServerPropertyDefinition());
1229    }
1230
1231
1232
1233    /**
1234     * {@inheritDoc}
1235     */
1236    public void setSecondaryRemoteLDAPServer(Collection<String> values) {
1237      impl.setPropertyValues(INSTANCE.getSecondaryRemoteLDAPServerPropertyDefinition(), values);
1238    }
1239
1240
1241
1242    /**
1243     * {@inheritDoc}
1244     */
1245    public InetAddress getSourceAddress() {
1246      return impl.getPropertyValue(INSTANCE.getSourceAddressPropertyDefinition());
1247    }
1248
1249
1250
1251    /**
1252     * {@inheritDoc}
1253     */
1254    public void setSourceAddress(InetAddress value) {
1255      impl.setPropertyValue(INSTANCE.getSourceAddressPropertyDefinition(), value);
1256    }
1257
1258
1259
1260    /**
1261     * {@inheritDoc}
1262     */
1263    public SortedSet<String> getSSLCipherSuite() {
1264      return impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition());
1265    }
1266
1267
1268
1269    /**
1270     * {@inheritDoc}
1271     */
1272    public void setSSLCipherSuite(Collection<String> values) {
1273      impl.setPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition(), values);
1274    }
1275
1276
1277
1278    /**
1279     * {@inheritDoc}
1280     */
1281    public SortedSet<String> getSSLProtocol() {
1282      return impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition());
1283    }
1284
1285
1286
1287    /**
1288     * {@inheritDoc}
1289     */
1290    public void setSSLProtocol(Collection<String> values) {
1291      impl.setPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition(), values);
1292    }
1293
1294
1295
1296    /**
1297     * {@inheritDoc}
1298     */
1299    public String getTrustManagerProvider() {
1300      return impl.getPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition());
1301    }
1302
1303
1304
1305    /**
1306     * {@inheritDoc}
1307     */
1308    public void setTrustManagerProvider(String value) {
1309      impl.setPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition(), value);
1310    }
1311
1312
1313
1314    /**
1315     * {@inheritDoc}
1316     */
1317    public boolean isUsePasswordCaching() {
1318      return impl.getPropertyValue(INSTANCE.getUsePasswordCachingPropertyDefinition());
1319    }
1320
1321
1322
1323    /**
1324     * {@inheritDoc}
1325     */
1326    public void setUsePasswordCaching(boolean value) {
1327      impl.setPropertyValue(INSTANCE.getUsePasswordCachingPropertyDefinition(), value);
1328    }
1329
1330
1331
1332    /**
1333     * {@inheritDoc}
1334     */
1335    public boolean isUseSSL() {
1336      return impl.getPropertyValue(INSTANCE.getUseSSLPropertyDefinition());
1337    }
1338
1339
1340
1341    /**
1342     * {@inheritDoc}
1343     */
1344    public void setUseSSL(Boolean value) {
1345      impl.setPropertyValue(INSTANCE.getUseSSLPropertyDefinition(), value);
1346    }
1347
1348
1349
1350    /**
1351     * {@inheritDoc}
1352     */
1353    public boolean isUseTCPKeepAlive() {
1354      return impl.getPropertyValue(INSTANCE.getUseTCPKeepAlivePropertyDefinition());
1355    }
1356
1357
1358
1359    /**
1360     * {@inheritDoc}
1361     */
1362    public void setUseTCPKeepAlive(Boolean value) {
1363      impl.setPropertyValue(INSTANCE.getUseTCPKeepAlivePropertyDefinition(), value);
1364    }
1365
1366
1367
1368    /**
1369     * {@inheritDoc}
1370     */
1371    public boolean isUseTCPNoDelay() {
1372      return impl.getPropertyValue(INSTANCE.getUseTCPNoDelayPropertyDefinition());
1373    }
1374
1375
1376
1377    /**
1378     * {@inheritDoc}
1379     */
1380    public void setUseTCPNoDelay(Boolean value) {
1381      impl.setPropertyValue(INSTANCE.getUseTCPNoDelayPropertyDefinition(), value);
1382    }
1383
1384
1385
1386    /**
1387     * {@inheritDoc}
1388     */
1389    public ManagedObjectDefinition<? extends LDAPPassThroughAuthenticationPolicyCfgClient, ? extends LDAPPassThroughAuthenticationPolicyCfg> definition() {
1390      return INSTANCE;
1391    }
1392
1393
1394
1395    /**
1396     * {@inheritDoc}
1397     */
1398    public PropertyProvider properties() {
1399      return impl;
1400    }
1401
1402
1403
1404    /**
1405     * {@inheritDoc}
1406     */
1407    public void commit() throws ManagedObjectAlreadyExistsException,
1408        MissingMandatoryPropertiesException, ConcurrentModificationException,
1409        OperationRejectedException, AuthorizationException,
1410        CommunicationException {
1411      impl.commit();
1412    }
1413
1414
1415
1416    /** {@inheritDoc} */
1417    public String toString() {
1418      return impl.toString();
1419    }
1420  }
1421
1422
1423
1424  /**
1425   * Managed object server implementation.
1426   */
1427  private static class LDAPPassThroughAuthenticationPolicyCfgServerImpl implements
1428    LDAPPassThroughAuthenticationPolicyCfg {
1429
1430    // Private implementation.
1431    private ServerManagedObject<? extends LDAPPassThroughAuthenticationPolicyCfg> impl;
1432
1433    // The value of the "cached-password-storage-scheme" property.
1434    private final String pCachedPasswordStorageScheme;
1435
1436    // The value of the "cached-password-ttl" property.
1437    private final long pCachedPasswordTTL;
1438
1439    // The value of the "connection-timeout" property.
1440    private final long pConnectionTimeout;
1441
1442    // The value of the "java-class" property.
1443    private final String pJavaClass;
1444
1445    // The value of the "mapped-attribute" property.
1446    private final SortedSet<AttributeType> pMappedAttribute;
1447
1448    // The value of the "mapped-search-base-dn" property.
1449    private final SortedSet<DN> pMappedSearchBaseDN;
1450
1451    // The value of the "mapped-search-bind-dn" property.
1452    private final DN pMappedSearchBindDN;
1453
1454    // The value of the "mapped-search-bind-password" property.
1455    private final String pMappedSearchBindPassword;
1456
1457    // The value of the "mapped-search-bind-password-environment-variable" property.
1458    private final String pMappedSearchBindPasswordEnvironmentVariable;
1459
1460    // The value of the "mapped-search-bind-password-file" property.
1461    private final String pMappedSearchBindPasswordFile;
1462
1463    // The value of the "mapped-search-bind-password-property" property.
1464    private final String pMappedSearchBindPasswordProperty;
1465
1466    // The value of the "mapping-policy" property.
1467    private final MappingPolicy pMappingPolicy;
1468
1469    // The value of the "primary-remote-ldap-server" property.
1470    private final SortedSet<String> pPrimaryRemoteLDAPServer;
1471
1472    // The value of the "secondary-remote-ldap-server" property.
1473    private final SortedSet<String> pSecondaryRemoteLDAPServer;
1474
1475    // The value of the "source-address" property.
1476    private final InetAddress pSourceAddress;
1477
1478    // The value of the "ssl-cipher-suite" property.
1479    private final SortedSet<String> pSSLCipherSuite;
1480
1481    // The value of the "ssl-protocol" property.
1482    private final SortedSet<String> pSSLProtocol;
1483
1484    // The value of the "trust-manager-provider" property.
1485    private final String pTrustManagerProvider;
1486
1487    // The value of the "use-password-caching" property.
1488    private final boolean pUsePasswordCaching;
1489
1490    // The value of the "use-ssl" property.
1491    private final boolean pUseSSL;
1492
1493    // The value of the "use-tcp-keep-alive" property.
1494    private final boolean pUseTCPKeepAlive;
1495
1496    // The value of the "use-tcp-no-delay" property.
1497    private final boolean pUseTCPNoDelay;
1498
1499
1500
1501    // Private constructor.
1502    private LDAPPassThroughAuthenticationPolicyCfgServerImpl(ServerManagedObject<? extends LDAPPassThroughAuthenticationPolicyCfg> impl) {
1503      this.impl = impl;
1504      this.pCachedPasswordStorageScheme = impl.getPropertyValue(INSTANCE.getCachedPasswordStorageSchemePropertyDefinition());
1505      this.pCachedPasswordTTL = impl.getPropertyValue(INSTANCE.getCachedPasswordTTLPropertyDefinition());
1506      this.pConnectionTimeout = impl.getPropertyValue(INSTANCE.getConnectionTimeoutPropertyDefinition());
1507      this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
1508      this.pMappedAttribute = impl.getPropertyValues(INSTANCE.getMappedAttributePropertyDefinition());
1509      this.pMappedSearchBaseDN = impl.getPropertyValues(INSTANCE.getMappedSearchBaseDNPropertyDefinition());
1510      this.pMappedSearchBindDN = impl.getPropertyValue(INSTANCE.getMappedSearchBindDNPropertyDefinition());
1511      this.pMappedSearchBindPassword = impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordPropertyDefinition());
1512      this.pMappedSearchBindPasswordEnvironmentVariable = impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordEnvironmentVariablePropertyDefinition());
1513      this.pMappedSearchBindPasswordFile = impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordFilePropertyDefinition());
1514      this.pMappedSearchBindPasswordProperty = impl.getPropertyValue(INSTANCE.getMappedSearchBindPasswordPropertyPropertyDefinition());
1515      this.pMappingPolicy = impl.getPropertyValue(INSTANCE.getMappingPolicyPropertyDefinition());
1516      this.pPrimaryRemoteLDAPServer = impl.getPropertyValues(INSTANCE.getPrimaryRemoteLDAPServerPropertyDefinition());
1517      this.pSecondaryRemoteLDAPServer = impl.getPropertyValues(INSTANCE.getSecondaryRemoteLDAPServerPropertyDefinition());
1518      this.pSourceAddress = impl.getPropertyValue(INSTANCE.getSourceAddressPropertyDefinition());
1519      this.pSSLCipherSuite = impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition());
1520      this.pSSLProtocol = impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition());
1521      this.pTrustManagerProvider = impl.getPropertyValue(INSTANCE.getTrustManagerProviderPropertyDefinition());
1522      this.pUsePasswordCaching = impl.getPropertyValue(INSTANCE.getUsePasswordCachingPropertyDefinition());
1523      this.pUseSSL = impl.getPropertyValue(INSTANCE.getUseSSLPropertyDefinition());
1524      this.pUseTCPKeepAlive = impl.getPropertyValue(INSTANCE.getUseTCPKeepAlivePropertyDefinition());
1525      this.pUseTCPNoDelay = impl.getPropertyValue(INSTANCE.getUseTCPNoDelayPropertyDefinition());
1526    }
1527
1528
1529
1530    /**
1531     * {@inheritDoc}
1532     */
1533    public void addLDAPPassThroughChangeListener(
1534        ConfigurationChangeListener<LDAPPassThroughAuthenticationPolicyCfg> listener) {
1535      impl.registerChangeListener(listener);
1536    }
1537
1538
1539
1540    /**
1541     * {@inheritDoc}
1542     */
1543    public void removeLDAPPassThroughChangeListener(
1544        ConfigurationChangeListener<LDAPPassThroughAuthenticationPolicyCfg> listener) {
1545      impl.deregisterChangeListener(listener);
1546    }
1547    /**
1548     * {@inheritDoc}
1549     */
1550    public void addChangeListener(
1551        ConfigurationChangeListener<AuthenticationPolicyCfg> listener) {
1552      impl.registerChangeListener(listener);
1553    }
1554
1555
1556
1557    /**
1558     * {@inheritDoc}
1559     */
1560    public void removeChangeListener(
1561        ConfigurationChangeListener<AuthenticationPolicyCfg> listener) {
1562      impl.deregisterChangeListener(listener);
1563    }
1564
1565
1566
1567    /**
1568     * {@inheritDoc}
1569     */
1570    public String getCachedPasswordStorageScheme() {
1571      return pCachedPasswordStorageScheme;
1572    }
1573
1574
1575
1576    /**
1577     * {@inheritDoc}
1578     */
1579    public DN getCachedPasswordStorageSchemeDN() {
1580      String value = getCachedPasswordStorageScheme();
1581      if (value == null) return null;
1582      return INSTANCE.getCachedPasswordStorageSchemePropertyDefinition().getChildDN(value);
1583    }
1584
1585
1586
1587    /**
1588     * {@inheritDoc}
1589     */
1590    public long getCachedPasswordTTL() {
1591      return pCachedPasswordTTL;
1592    }
1593
1594
1595
1596    /**
1597     * {@inheritDoc}
1598     */
1599    public long getConnectionTimeout() {
1600      return pConnectionTimeout;
1601    }
1602
1603
1604
1605    /**
1606     * {@inheritDoc}
1607     */
1608    public String getJavaClass() {
1609      return pJavaClass;
1610    }
1611
1612
1613
1614    /**
1615     * {@inheritDoc}
1616     */
1617    public SortedSet<AttributeType> getMappedAttribute() {
1618      return pMappedAttribute;
1619    }
1620
1621
1622
1623    /**
1624     * {@inheritDoc}
1625     */
1626    public SortedSet<DN> getMappedSearchBaseDN() {
1627      return pMappedSearchBaseDN;
1628    }
1629
1630
1631
1632    /**
1633     * {@inheritDoc}
1634     */
1635    public DN getMappedSearchBindDN() {
1636      return pMappedSearchBindDN;
1637    }
1638
1639
1640
1641    /**
1642     * {@inheritDoc}
1643     */
1644    public String getMappedSearchBindPassword() {
1645      return pMappedSearchBindPassword;
1646    }
1647
1648
1649
1650    /**
1651     * {@inheritDoc}
1652     */
1653    public String getMappedSearchBindPasswordEnvironmentVariable() {
1654      return pMappedSearchBindPasswordEnvironmentVariable;
1655    }
1656
1657
1658
1659    /**
1660     * {@inheritDoc}
1661     */
1662    public String getMappedSearchBindPasswordFile() {
1663      return pMappedSearchBindPasswordFile;
1664    }
1665
1666
1667
1668    /**
1669     * {@inheritDoc}
1670     */
1671    public String getMappedSearchBindPasswordProperty() {
1672      return pMappedSearchBindPasswordProperty;
1673    }
1674
1675
1676
1677    /**
1678     * {@inheritDoc}
1679     */
1680    public MappingPolicy getMappingPolicy() {
1681      return pMappingPolicy;
1682    }
1683
1684
1685
1686    /**
1687     * {@inheritDoc}
1688     */
1689    public SortedSet<String> getPrimaryRemoteLDAPServer() {
1690      return pPrimaryRemoteLDAPServer;
1691    }
1692
1693
1694
1695    /**
1696     * {@inheritDoc}
1697     */
1698    public SortedSet<String> getSecondaryRemoteLDAPServer() {
1699      return pSecondaryRemoteLDAPServer;
1700    }
1701
1702
1703
1704    /**
1705     * {@inheritDoc}
1706     */
1707    public InetAddress getSourceAddress() {
1708      return pSourceAddress;
1709    }
1710
1711
1712
1713    /**
1714     * {@inheritDoc}
1715     */
1716    public SortedSet<String> getSSLCipherSuite() {
1717      return pSSLCipherSuite;
1718    }
1719
1720
1721
1722    /**
1723     * {@inheritDoc}
1724     */
1725    public SortedSet<String> getSSLProtocol() {
1726      return pSSLProtocol;
1727    }
1728
1729
1730
1731    /**
1732     * {@inheritDoc}
1733     */
1734    public String getTrustManagerProvider() {
1735      return pTrustManagerProvider;
1736    }
1737
1738
1739
1740    /**
1741     * {@inheritDoc}
1742     */
1743    public DN getTrustManagerProviderDN() {
1744      String value = getTrustManagerProvider();
1745      if (value == null) return null;
1746      return INSTANCE.getTrustManagerProviderPropertyDefinition().getChildDN(value);
1747    }
1748
1749
1750
1751    /**
1752     * {@inheritDoc}
1753     */
1754    public boolean isUsePasswordCaching() {
1755      return pUsePasswordCaching;
1756    }
1757
1758
1759
1760    /**
1761     * {@inheritDoc}
1762     */
1763    public boolean isUseSSL() {
1764      return pUseSSL;
1765    }
1766
1767
1768
1769    /**
1770     * {@inheritDoc}
1771     */
1772    public boolean isUseTCPKeepAlive() {
1773      return pUseTCPKeepAlive;
1774    }
1775
1776
1777
1778    /**
1779     * {@inheritDoc}
1780     */
1781    public boolean isUseTCPNoDelay() {
1782      return pUseTCPNoDelay;
1783    }
1784
1785
1786
1787    /**
1788     * {@inheritDoc}
1789     */
1790    public Class<? extends LDAPPassThroughAuthenticationPolicyCfg> configurationClass() {
1791      return LDAPPassThroughAuthenticationPolicyCfg.class;
1792    }
1793
1794
1795
1796    /**
1797     * {@inheritDoc}
1798     */
1799    public DN dn() {
1800      return impl.getDN();
1801    }
1802
1803
1804
1805    /** {@inheritDoc} */
1806    public String toString() {
1807      return impl.toString();
1808    }
1809  }
1810}