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