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