Class PasswordPolicyResponseControl


  • public class PasswordPolicyResponseControl
    extends Control
    This class implements the password policy response control defined in draft-behera-ldap-password-policy. The value may have zero, one, or two elements, which may include flags to indicate a warning and/or an error.
    • Field Detail

      • TYPE_WARNING_ELEMENT

        public static final byte TYPE_WARNING_ELEMENT
        The BER type value for the warning element of the control value.
        See Also:
        Constant Field Values
      • TYPE_ERROR_ELEMENT

        public static final byte TYPE_ERROR_ELEMENT
        The BER type value for the error element of the control value.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PasswordPolicyResponseControl

        public PasswordPolicyResponseControl()
        Creates a new instance of the password policy response control with the default OID and criticality, and without either a warning or an error flag.
      • PasswordPolicyResponseControl

        public PasswordPolicyResponseControl​(PasswordPolicyWarningType warningType,
                                             int warningValue,
                                             PasswordPolicyErrorType errorType)
        Creates a new instance of this password policy response control with the default OID and criticality, and with the provided warning and/or error flag information.
        Parameters:
        warningType - The warning type to use for this password policy response control, or null if there should not be a warning flag.
        warningValue - The warning value to use for this password policy response control, if applicable.
        errorType - The error type to use for this password policy response control, or null if there should not be an error flag.
      • PasswordPolicyResponseControl

        public PasswordPolicyResponseControl​(boolean isCritical,
                                             PasswordPolicyWarningType warningType,
                                             int warningValue,
                                             PasswordPolicyErrorType errorType)
        Creates a new instance of the password policy request control with the provided information.
        Parameters:
        isCritical - Indicates whether support for this control should be considered a critical part of the client processing.
        warningType - The warning type to use for this password policy response control, or null if there should not be a warning flag.
        warningValue - The warning value to use for this password policy response control, if applicable.
        errorType - The error type to use for this password policy response control, or null if there should not be an error flag.
    • Method Detail

      • writeValue

        protected void writeValue​(ASN1Writer writer)
                           throws IOException
        Writes this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.
        Specified by:
        writeValue in class Control
        Parameters:
        writer - The ASN.1 writer to use.
        Throws:
        IOException - If a problem occurs while writing to the stream.
      • getWarningType

        public PasswordPolicyWarningType getWarningType()
        Retrieves the password policy warning type contained in this control.
        Returns:
        The password policy warning type contained in this control, or null if there is no warning type.
      • getWarningValue

        public int getWarningValue()
        Retrieves the password policy warning value for this control. The value is undefined if there is no warning type.
        Returns:
        The password policy warning value for this control.
      • getErrorType

        public PasswordPolicyErrorType getErrorType()
        Retrieves the password policy error type contained in this control.
        Returns:
        The password policy error type contained in this control, or null if there is no error type.
      • toString

        public void toString​(StringBuilder buffer)
        Description copied from class: Control
        Appends a string representation of this control to the provided buffer.
        Overrides:
        toString in class Control
        Parameters:
        buffer - The buffer to which the information should be appended.