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