Class SaslImpl

    • Method Detail

      • isDone

        public boolean isDone()
      • recv

        public final int recv​(byte[] bytes,
                              int offset,
                              int size)
        Description copied from interface: Sasl
        Read challenge/response/additional data sent from the peer. Use pending to determine the size of the data.
        Specified by:
        recv in interface Sasl
        Parameters:
        bytes - written with up to size bytes of inbound data.
        offset - the offset in the array to begin writing at
        size - maximum number of bytes that bytes can accept.
        Returns:
        The number of bytes written to bytes, or an error code if < 0.
      • send

        public final int send​(byte[] bytes,
                              int offset,
                              int size)
        Description copied from interface: Sasl
        Send challenge/response/additional data to the peer.
        Specified by:
        send in interface Sasl
        Parameters:
        bytes - The challenge/response data.
        offset - the point within the array at which the data starts at
        size - The number of data octets in bytes.
        Returns:
        The number of octets read from bytes, or an error code if < 0
      • pending

        public int pending()
        Description copied from interface: Sasl
        Determine the size of the bytes available via recv(). Returns the size in bytes available via recv().
        Specified by:
        pending in interface Sasl
        Returns:
        The number of bytes available, zero if no available data.
      • getState

        public Sasl.SaslState getState()
        Description copied from interface: Sasl
        Access the current state of the layer.
        Specified by:
        getState in interface Sasl
        Returns:
        The state of the sasl layer.
      • setMechanisms

        public void setMechanisms​(java.lang.String... mechanisms)
        Description copied from interface: Sasl
        Set the acceptable SASL mechanisms for the layer.
        Specified by:
        setMechanisms in interface Sasl
        Parameters:
        mechanisms - a list of acceptable SASL mechanisms
      • getRemoteMechanisms

        public java.lang.String[] getRemoteMechanisms()
        Description copied from interface: Sasl
        Retrieve the list of SASL mechanisms provided by the remote.
        Specified by:
        getRemoteMechanisms in interface Sasl
        Returns:
        the SASL mechanisms advertised by the remote
      • setMechanism

        public void setMechanism​(Symbol mechanism)
      • getChosenMechanism

        public Symbol getChosenMechanism()
      • setResponse

        public void setResponse​(Binary initialResponse)
      • done

        public void done​(Sasl.SaslOutcome outcome)
        Description copied from interface: Sasl
        Set the outcome of SASL negotiation Used by the server to set the result of the negotiation process.
        Specified by:
        done in interface Sasl
        Parameters:
        outcome - the outcome of the SASL negotiation
      • plain

        public void plain​(java.lang.String username,
                          java.lang.String password)
        Description copied from interface: Sasl
        Configure the SASL layer to use the "PLAIN" mechanism. A utility function to configure a simple client SASL layer using PLAIN authentication.
        Specified by:
        plain in interface Sasl
        Parameters:
        username - credential for the PLAIN authentication mechanism
        password - credential for the PLAIN authentication mechanism
      • getOutcome

        public Sasl.SaslOutcome getOutcome()
        Description copied from interface: Sasl
        Retrieve the outcome of SASL negotiation.
        Specified by:
        getOutcome in interface Sasl
      • client

        public void client()
        Specified by:
        client in interface Sasl
      • server

        public void server()
        Specified by:
        server in interface Sasl
      • allowSkip

        public void allowSkip​(boolean allowSkip)
        Description copied from interface: Sasl
        Set whether servers may accept incoming connections that skip the SASL layer negotiation.
        Specified by:
        allowSkip in interface Sasl
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getHostname

        public java.lang.String getHostname()
        Description copied from interface: Sasl
        Retrieve the hostname indicated by the client when sending its SaslInit.
        Specified by:
        getHostname in interface Sasl
        Returns:
        the hostname indicated by the remote client, or null if none specified.
      • setRemoteHostname

        public void setRemoteHostname​(java.lang.String hostname)
        Description copied from interface: Sasl
        Set the remote hostname to indicate the host being connected to when sending a SaslInit to the server.
        Specified by:
        setRemoteHostname in interface Sasl
      • setListener

        public void setListener​(SaslListener saslListener)
        Description copied from interface: Sasl
        Adds a listener to receive notice of frames having arrived.
        Specified by:
        setListener in interface Sasl