@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class GeneratePasswordExtendedRequest extends ExtendedRequest
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
GeneratePasswordRequest ::= SEQUENCE { passwordPolicySelection CHOICE { defaultPolicy [0] NULL, passwordPolicyDN [1] LDAPDN, targetEntryDN [2] LDAPDN, ... }, numberOfPasswords [3] INTEGER DEFAULT 1, validationAttempts [4] INTEGER DEFAULT 5, ... }
GeneratePasswordExtendedResult
response with the
passwords that it generated and other relevant information.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GENERATE_PASSWORD_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.6.62) for the generate password extended
request.
|
TYPE_EXTENDED_REQUEST_OID, TYPE_EXTENDED_REQUEST_VALUE
Constructor and Description |
---|
GeneratePasswordExtendedRequest(Control... controls)
Creates a new generate password extended request with all the default
settings.
|
GeneratePasswordExtendedRequest(ExtendedRequest request)
Creates a new generate password extended request that is decoded from the
provided generic request.
|
Modifier and Type | Method and Description |
---|---|
static GeneratePasswordExtendedRequest |
createDefaultPolicyRequest(int numberOfPasswords,
int numberOfValidationAttempts,
Control... controls)
Creates a generate password extended request that will use the default
password policy (as defined in the server configuration) to determine which
password generator and validators should be used.
|
static GeneratePasswordExtendedRequest |
createPasswordPolicyDNRequest(java.lang.String passwordPolicyDN,
int numberOfPasswords,
int numberOfValidationAttempts,
Control... controls)
Creates a generate password extended request that will use the password
policy defined in the entry with the specified DN to determine which
password generator and validators should be used.
|
static GeneratePasswordExtendedRequest |
createTargetEntryDNRequest(java.lang.String targetEntryDN,
int numberOfPasswords,
int numberOfValidationAttempts,
Control... controls)
Creates a generate password extended request that will use the password
policy that governs the specified entry to determine which
password generator and validators should be used.
|
GeneratePasswordExtendedRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
GeneratePasswordExtendedRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
java.lang.String |
getExtendedRequestName()
Retrieves the user-friendly name for the extended request, if available.
|
int |
getNumberOfPasswords()
Retrieves the number of passwords that the client wants the server to
generate.
|
int |
getNumberOfValidationAttempts()
Retrieves the number of maximum number of attempts that the client wants
the server to make when generating each password in the hope that the
generated password will satisfy the validation criteria specified in the
associated password policy.
|
java.lang.String |
getPasswordPolicyDN()
Retrieves the DN of the entry that defines the password policy that should
be used when generating and validating passwords.
|
GeneratePasswordPolicySelectionType |
getPasswordPolicySelectionType()
Retrieves the password policy selection type for this request.
|
java.lang.String |
getTargetEntryDN()
Retrieves the DN of the target entry whose governing password policy should
be used when generating and validating passwords.
|
protected GeneratePasswordExtendedResult |
process(LDAPConnection connection,
int depth)
Sends this extended request to the directory server over the provided
connection and returns the associated response.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
encodeProtocolOp, getLastMessageID, getOID, getOperationType, getProtocolOpType, getValue, hasValue, responseReceived, toCode, writeTo
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString
@NotNull public static final java.lang.String GENERATE_PASSWORD_REQUEST_OID
public GeneratePasswordExtendedRequest(@Nullable Control... controls)
controls
- The set of controls to include in the request. It may be
null
or empty if there should not be any request
controls.public GeneratePasswordExtendedRequest(@NotNull ExtendedRequest request) throws LDAPException
request
- The extended request to be decoded as a generate password
extended request. It must not be null
.LDAPException
- If the provided extended request cannot be decoded
as a generate password request.@NotNull public static GeneratePasswordExtendedRequest createDefaultPolicyRequest(int numberOfPasswords, int numberOfValidationAttempts, @Nullable Control... controls)
numberOfPasswords
- The number of passwords to generate. The value must be
greater than or equal to one.numberOfValidationAttempts
- The number of attempts that should be made to generate each
password in an attempt to obtain a password that satisfies the
associated set of password validators. The value must be
greater than or equal to zero.controls
- The set of controls to include in the request. It may be
null
or empty if there should not be any request
controls.@NotNull public static GeneratePasswordExtendedRequest createPasswordPolicyDNRequest(@NotNull java.lang.String passwordPolicyDN, int numberOfPasswords, int numberOfValidationAttempts, @Nullable Control... controls)
passwordPolicyDN
- The DN of the entry that defines the password policy to use to
determine which password generator and validators should be
used. It must not be null
.numberOfPasswords
- The number of passwords to generate. The value must be
greater than or equal to one.numberOfValidationAttempts
- The number of attempts that should be made to generate each
password in an attempt to obtain a password that satisfies the
associated set of password validators. The value must be
greater than or equal to zero.controls
- The set of controls to include in the request. It may be
null
or empty if there should not be any request
controls.@NotNull public static GeneratePasswordExtendedRequest createTargetEntryDNRequest(@NotNull java.lang.String targetEntryDN, int numberOfPasswords, int numberOfValidationAttempts, @Nullable Control... controls)
targetEntryDN
- The DN of the entry whose governing password policy should be
used. It must not be null
.numberOfPasswords
- The number of passwords to generate. The value must be
greater than or equal to one.numberOfValidationAttempts
- The number of attempts that should be made to generate each
password in an attempt to obtain a password that satisfies the
associated set of password validators. The value must be
greater than or equal to zero.controls
- The set of controls to include in the request. It may be
null
or empty if there should not be any request
controls.@NotNull public GeneratePasswordPolicySelectionType getPasswordPolicySelectionType()
@Nullable public java.lang.String getPasswordPolicyDN()
GeneratePasswordPolicySelectionType.PASSWORD_POLICY_DN
password
policy selection type.null
if the password policy selection type is anything
other than PASSWORD_POLICY_DN
.@Nullable public java.lang.String getTargetEntryDN()
GeneratePasswordPolicySelectionType.TARGET_ENTRY_DN
password
policy selection type.null
if the password policy selection type is anything
other than TARGET_ENTRY_DN
.public int getNumberOfPasswords()
public int getNumberOfValidationAttempts()
@NotNull protected GeneratePasswordExtendedResult process(@NotNull LDAPConnection connection, int depth) throws LDAPException
process
in class ExtendedRequest
connection
- The connection to use to communicate with the directory
server.depth
- The current referral depth for this request. It should
always be one for the initial request, and should only
be incremented when following referrals.LDAPException
- If a problem occurs while sending the request or
reading the response.@NotNull public GeneratePasswordExtendedRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class ExtendedRequest
@NotNull public GeneratePasswordExtendedRequest duplicate(@Nullable Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class ExtendedRequest
controls
- The set of controls to include in the duplicate request.@NotNull public java.lang.String getExtendedRequestName()
getExtendedRequestName
in class ExtendedRequest
public void toString(@NotNull java.lang.StringBuilder buffer)
toString
in interface ProtocolOp
toString
in interface ReadOnlyLDAPRequest
toString
in class ExtendedRequest
buffer
- The buffer to which to append a string representation of
this request.