Class PasswordPolicyDecorator

    • Constructor Detail

      • PasswordPolicyDecorator

        public PasswordPolicyDecorator​(LdapApiService codec,
                                       boolean hasResponse)
        Creates a new instance of PasswordPolicyDecorator.
        Parameters:
        codec - The LDAP Service to use
        hasResponse - The hasResponse flag
    • Method Detail

      • computeLength

        public int computeLength()
        Compute the object length, which is the sum of all inner length.
        Specified by:
        computeLength in interface Asn1Object
        Returns:
        The object's computed length
      • hasResponse

        public boolean hasResponse()
        Checks whether this Control is the password policy request or the response by carrying with it an IPasswordPolicyResponse object. If it is a request, then no response component will be associated with the control: getResponse() will return null.
        Specified by:
        hasResponse in interface PasswordPolicy
        Returns:
        true if this Control carries a response, false if it is a request
      • setResponse

        public void setResponse​(PasswordPolicyResponse response)
        Sets the response. If null hasResponse() will return null and this will be handled as a password policy request control rather than a response control.
        Specified by:
        setResponse in interface PasswordPolicy
        Parameters:
        response - a valid response object, or null to make this a request
      • setResponse

        public PasswordPolicyResponse setResponse​(boolean hasResponse)
        If true sets the response to a default newly initialized response object. If this was previously a request, it automatically becomes a response. If it was not a request with an already existing response object then that response is replace with a new one and the old is returned. If false then any response object set will be cleared to null. Effectively this will cause hasResponse() to return whatever you plug into it.
        Specified by:
        setResponse in interface PasswordPolicy
        Parameters:
        hasResponse - true to create default response, false to clear it
        Returns:
        the old response object, if one did not exist null is returned