com.unboundid.ldap.sdk.unboundidds.controls
Class PasswordValidationDetailsResponseControl

java.lang.Object
  extended by com.unboundid.ldap.sdk.Control
      extended by com.unboundid.ldap.sdk.unboundidds.controls.PasswordValidationDetailsResponseControl
All Implemented Interfaces:
DecodeableControl, java.io.Serializable

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class PasswordValidationDetailsResponseControl
extends Control
implements DecodeableControl

NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.
This class provides an implementation for a response control that can be returned by the server in the response for add, modify, and password modify requests that include the password validation details request control. This response control will provide details about the password quality requirements that are in effect for the operation and whether the password included in the request satisfies each of those requirements.

This response control has an OID of 1.3.6.1.4.1.30221.2.5.41, a criticality of false, and a value with the provided encoding:
   PasswordValidationDetailsResponse ::= SEQUENCE {
        validationResult            CHOICE {
             validationDetails             [0] SEQUENCE OF
                  PasswordQualityRequirementValidationResult,
             noPasswordProvided            [1] NULL,
             multiplePasswordsProvided     [2] NULL,
             noValidationAttempted         [3] NULL,
             ... },
        missingCurrentPassword     [3] BOOLEAN DEFAULT FALSE,
        mustChangePassword         [4] BOOLEAN DEFAULT FALSE,
        secondsUntilExpiration     [5] INTEGER OPTIONAL,
        ... }
 

See Also:
Serialized Form

Field Summary
static java.lang.String PASSWORD_VALIDATION_DETAILS_RESPONSE_OID
          The OID (1.3.6.1.4.1.30221.2.5.41) for the password validation details response control.
 
Constructor Summary
PasswordValidationDetailsResponseControl(PasswordValidationDetailsResponseType responseType, java.util.Collection<PasswordQualityRequirementValidationResult> validationResults, boolean missingCurrentPassword, boolean mustChangePassword, java.lang.Integer secondsUntilExpiration)
          Creates a password validation details response control with the provided information.
PasswordValidationDetailsResponseControl(java.lang.String oid, boolean isCritical, ASN1OctetString value)
          Creates a new password validation details response control by decoding the provided generic control information.
 
Method Summary
 PasswordValidationDetailsResponseControl decodeControl(java.lang.String oid, boolean isCritical, ASN1OctetString value)
          Creates a new instance of this decodeable control from the provided information.
static PasswordValidationDetailsResponseControl get(LDAPResult result)
          Extracts a password validation details response control from the provided result.
 java.lang.String getControlName()
          Retrieves the user-friendly name for this control, if available.
 PasswordValidationDetailsResponseType getResponseType()
          Retrieves the response type for this password validation details response control.
 java.lang.Integer getSecondsUntilExpiration()
          Retrieves the maximum length of time, in seconds, that the newly-set password will be considered valid.
 java.util.List<PasswordQualityRequirementValidationResult> getValidationResults()
          Retrieves a list of the results obtained when attempting to validate the proposed password against the password quality requirements in effect for the operation.
 boolean missingCurrentPassword()
          Indicates whether the associated operation is a self password change that requires the user to provide his/her current password when setting a new password, but no current password was provided.
 boolean mustChangePassword()
          Indicates whether the user will be required to immediately change his/her password after the associated add or administrative reset is complete.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP control to the provided buffer.
 
Methods inherited from class com.unboundid.ldap.sdk.Control
decode, decode, decodeControls, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, toString, writeTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PASSWORD_VALIDATION_DETAILS_RESPONSE_OID

public static final java.lang.String PASSWORD_VALIDATION_DETAILS_RESPONSE_OID
The OID (1.3.6.1.4.1.30221.2.5.41) for the password validation details response control.

See Also:
Constant Field Values
Constructor Detail

PasswordValidationDetailsResponseControl

public PasswordValidationDetailsResponseControl(PasswordValidationDetailsResponseType responseType,
                                                java.util.Collection<PasswordQualityRequirementValidationResult> validationResults,
                                                boolean missingCurrentPassword,
                                                boolean mustChangePassword,
                                                java.lang.Integer secondsUntilExpiration)
Creates a password validation details response control with the provided information.

Parameters:
responseType - The response type for this password validation details response control. This must not be null.
validationResults - A list of the results obtained when validating the password against the password quality requirements. This must be null or empty if the responseType element has a value other than VALIDATION_DETAILS.
missingCurrentPassword - Indicates whether the associated operation is a self change that failed (or would have failed if not for additional validation failures) because the user did not provide his/her current password as required.
mustChangePassword - Indicates whether the associated operation is an add or administrative reset that will require the user to change his/her password immediately after authenticating before allowing them to perform any other operation in the server.
secondsUntilExpiration - The maximum length of time, in seconds, that the newly-set password will be considered valid. This may be null if the new password will be considered valid indefinitely.

PasswordValidationDetailsResponseControl

public PasswordValidationDetailsResponseControl(java.lang.String oid,
                                                boolean isCritical,
                                                ASN1OctetString value)
                                         throws LDAPException
Creates a new password validation details response control by decoding the provided generic control information.

Parameters:
oid - The OID for the control.
isCritical - Indicates whether the control should be considered critical.
value - The value for the control.
Throws:
LDAPException - If the provided information cannot be decoded to create a password validation details response control.
Method Detail

getResponseType

public PasswordValidationDetailsResponseType getResponseType()
Retrieves the response type for this password validation details response control.

Returns:
The response type for this password validation details response control.

getValidationResults

public java.util.List<PasswordQualityRequirementValidationResult> getValidationResults()
Retrieves a list of the results obtained when attempting to validate the proposed password against the password quality requirements in effect for the operation.

Returns:
A list of the results obtained when attempting to validate the proposed password against the password quality requirements in effect for the operation, or an empty list if no validation results are available.

missingCurrentPassword

public boolean missingCurrentPassword()
Indicates whether the associated operation is a self password change that requires the user to provide his/her current password when setting a new password, but no current password was provided.

Returns:
true if the associated operation is a self password change that requires the user to provide his/her current password when setting a new password but none was required, or false if the associated operation was not a self change, or if the user's current password was provided.

mustChangePassword

public boolean mustChangePassword()
Indicates whether the user will be required to immediately change his/her password after the associated add or administrative reset is complete.

Returns:
true if the associated operation is an add or administrative reset and the user will be required to change his/her password before being allowed to perform any other operation, or false if the associated operation was not am add or an administrative reset, or if the user will not be required to immediately change his/her password.

getSecondsUntilExpiration

public java.lang.Integer getSecondsUntilExpiration()
Retrieves the maximum length of time, in seconds, that the newly-set password will be considered valid. If mustChangePassword() returns true, then this value will be the length of time that the user has to perform a self password change before the account becomes locked. If mustChangePassword() returns false, then this value will be the length of time until the password expires.

Returns:
The maximum length of time, in seconds, that the newly-set password will be considered valid, or null if the new password will be valid indefinitely.

decodeControl

public PasswordValidationDetailsResponseControl decodeControl(java.lang.String oid,
                                                              boolean isCritical,
                                                              ASN1OctetString value)
                                                       throws LDAPException
Creates a new instance of this decodeable control from the provided information.

Specified by:
decodeControl in interface DecodeableControl
Parameters:
oid - The OID for the control.
isCritical - Indicates whether the control should be marked critical.
value - The encoded value for the control. This may be null if no value was provided.
Returns:
The decoded representation of this control.
Throws:
LDAPException - If the provided information cannot be decoded as a valid instance of this decodeable control.

get

public static PasswordValidationDetailsResponseControl get(LDAPResult result)
                                                    throws LDAPException
Extracts a password validation details response control from the provided result.

Parameters:
result - The result from which to retrieve the password validation details response control.
Returns:
The password validation details response control contained in the provided result, or null if the result did not contain a password validation details response control.
Throws:
LDAPException - If a problem is encountered while attempting to decode the password validation details response control contained in the provided result.

getControlName

public java.lang.String getControlName()
Retrieves the user-friendly name for this control, if available. If no user-friendly name has been defined, then the OID will be returned.

Overrides:
getControlName in class Control
Returns:
The user-friendly name for this control, or the OID if no user-friendly name is available.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided buffer.

Overrides:
toString in class Control
Parameters:
buffer - The buffer to which to append the string representation of this buffer.