Class GeneratedPassword

  • All Implemented Interfaces:
    java.io.Serializable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class GeneratedPassword
    extends java.lang.Object
    implements java.io.Serializable
    This class defines a data structure that holds information about a password generated by the server and returned to the client in a GeneratePasswordExtendedResult.
    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.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      GeneratedPassword​(byte[] password, boolean validationAttempted, java.util.List<java.lang.String> validationErrors)
      Creates a generated password object with the provided information.
      GeneratedPassword​(java.lang.String password, boolean validationAttempted, java.util.List<java.lang.String> validationErrors)
      Creates a generated password object with the provided information.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static GeneratedPassword decode​(ASN1Element element)
      Decodes the provided ASN.1 element as a generated password object.
      ASN1Sequence encode()
      Encodes this generated password to a sequence suitable for inclusion in the value of a GeneratePasswordExtendedResult.
      byte[] getPasswordBytes()
      Retrieves the bytes that comprise the server-generated password.
      java.lang.String getPasswordString()
      Retrieves a string representation of the server-generated password.
      java.util.List<java.lang.String> getValidationErrors()
      Retrieves a list of problems identified while the server was validating the quality of the generated password.
      java.lang.String toString()
      Retrieves a string representation of this generated password object.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of this generated password object to the provided buffer.
      boolean validationAttempted()
      Indicates whether the server attempted to validate the quality of the generated password.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GeneratedPassword

        public GeneratedPassword​(java.lang.String password,
                                 boolean validationAttempted,
                                 java.util.List<java.lang.String> validationErrors)
        Creates a generated password object with the provided information.
        Parameters:
        password - The password that was generated. It must not be @code null} or empty.
        validationAttempted - Indicates whether the server attempted to validate the quality of the generated password.
        validationErrors - An optional list of messages with information about any problems identified while the server was validating the quality of the generated password.
      • GeneratedPassword

        public GeneratedPassword​(byte[] password,
                                 boolean validationAttempted,
                                 java.util.List<java.lang.String> validationErrors)
        Creates a generated password object with the provided information.
        Parameters:
        password - The password that was generated. It must not be @code null} or empty.
        validationAttempted - Indicates whether the server attempted to validate the quality of the generated password.
        validationErrors - An optional list of messages with information about any problems identified while the server was validating the quality of the generated password.
    • Method Detail

      • getPasswordString

        public java.lang.String getPasswordString()
        Retrieves a string representation of the server-generated password.
        Returns:
        A string representation of the server-generated password.
      • getPasswordBytes

        public byte[] getPasswordBytes()
        Retrieves the bytes that comprise the server-generated password.
        Returns:
        The bytes that comprise the server-generated password.
      • validationAttempted

        public boolean validationAttempted()
        Indicates whether the server attempted to validate the quality of the generated password.
        Returns:
        true if the server attempted to validate the quality of the generated password, or false if not.
      • getValidationErrors

        public java.util.List<java.lang.String> getValidationErrors()
        Retrieves a list of problems identified while the server was validating the quality of the generated password.
        Returns:
        A list of problems identified while the server was validating the quality of the generated password, or an empty list if no validation was attempted or if the generated password satisfied all of the requirements for all of the appropriate password validators.
      • encode

        public ASN1Sequence encode()
        Encodes this generated password to a sequence suitable for inclusion in the value of a GeneratePasswordExtendedResult.
        Returns:
        An ASN.1 sequence containing an encoded representation of this generated password object.
      • decode

        public static GeneratedPassword decode​(ASN1Element element)
                                        throws LDAPException
        Decodes the provided ASN.1 element as a generated password object.
        Parameters:
        element - The ASN.1 element to be decoded. It must not be null.
        Returns:
        The generated password object that was decoded.
        Throws:
        LDAPException - If a problem is encountered while decoding the provided element as a generated password.
      • toString

        public java.lang.String toString()
        Retrieves a string representation of this generated password object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this generated password object.
      • toString

        public void toString​(java.lang.StringBuilder buffer)
        Appends a string representation of this generated password object to the provided buffer.
        Parameters:
        buffer - The buffer to which the information should be appended.