Class BindResponseDecorator

    • Constructor Detail

      • BindResponseDecorator

        public BindResponseDecorator​(LdapApiService codec,
                                     BindResponse decoratedMessage)
        Makes a BindResponse a MessageDecorator.
        Parameters:
        codec - The LDAP service instance
        decoratedMessage - the decorated BindResponse
    • Method Detail

      • getServerSaslCreds

        public byte[] getServerSaslCreds()
        Gets the optional property holding SASL authentication response parameters that are SASL mechanism specific. Will return null if the authentication is simple.
        Specified by:
        getServerSaslCreds in interface BindResponse
        Returns:
        the sasl mech. specific credentials or null of auth. is simple
      • setServerSaslCreds

        public void setServerSaslCreds​(byte[] serverSaslCreds)
        Sets the optional property holding SASL authentication response paramters that are SASL mechanism specific. Leave null if authentication mode is simple.
        Specified by:
        setServerSaslCreds in interface BindResponse
        Parameters:
        serverSaslCreds - the sasl auth. mech. specific credentials
      • computeLength

        public int computeLength()
        Compute the BindResponse length
        BindResponse :
         0x61 L1 
           | 
           +--> LdapResult
           +--> [serverSaslCreds] 
           
         L1 = Length(LdapResult) [ + Length(serverSaslCreds) ] 
         Length(BindResponse) = Length(0x61) + Length(L1) + L1
         
        Specified by:
        computeLength in interface Asn1Object
        Returns:
        The object's computed length
      • encode

        public ByteBuffer encode​(ByteBuffer buffer)
                          throws EncoderException
        Encode the BindResponse message to a PDU.
        BindResponse :
         LdapResult.encode 
         [0x87 LL serverSaslCreds]
         
        Specified by:
        encode in interface Asn1Object
        Parameters:
        buffer - The buffer where to put the PDU
        Returns:
        The encoded response
        Throws:
        EncoderException - when encoding operations fail