Interface SaslClientContext

  • All Superinterfaces:
    SaslContext

    public interface SaslClientContext
    extends SaslContext
    SASL Client operating context used by an Engine that has been configured as a SASL client or that has initialed the SASL exchange by being the first to initiate the AMQP header exchange.
    • Method Detail

      • setListener

        SaslClientContext setListener​(SaslClientListener listener)
        Sets the SaslClientListener that will be used to driver the client side SASL negotiations with a connected "server". As the server initiates or responds to the various phases of the SASL negotiation the SaslClientListener will be notified and allowed to respond.
        Parameters:
        listener - The SaslClientListener to use for SASL negotiations, cannot be null.
        Returns:
        this client context.
      • sendSASLHeader

        SaslClientContext sendSASLHeader()
                                  throws EngineStateException
        Sends the AMQP Header indicating the desire for SASL negotiations to be commenced on this connection. The hosting application my wish to start SASL negotiations prior to opening a Connection in order to validation authentication state out of band of the normal open process.
        Returns:
        this client context.
        Throws:
        EngineStateException - if the Engine has been shut down or a failure occurs processing this header.
      • sendChosenMechanism

        SaslClientContext sendChosenMechanism​(Symbol mechanism,
                                              java.lang.String host,
                                              ProtonBuffer initialResponse)
                                       throws EngineStateException
        Sends a response to the SASL server indicating the chosen mechanism for this client and the host name that this client is identifying itself as.
        Parameters:
        mechanism - The chosen mechanism selected from the list the server provided.
        host - The host name that the client is identified as or null if none selected.
        initialResponse - The initial response data sent as defined by the chosen mechanism or null if none required.
        Returns:
        this client context.
        Throws:
        EngineStateException - if the Engine has been shut down or a failure occurs processing this mechanism.
      • sendResponse

        SaslClientContext sendResponse​(ProtonBuffer response)
                                throws EngineStateException
        Sends a response to a server side challenge that comprises the challenge / response exchange for the chosen SASL mechanism.
        Parameters:
        response - The response bytes to be sent to the server for this cycle.
        Returns:
        this client context.
        Throws:
        EngineStateException - if the Engine has been shut down or a failure occurs processing this response.
      • saslFailure

        SaslClientContext saslFailure​(javax.security.sasl.SaslException failure)
        Allows the client implementation to fail the SASL negotiation process due to some unrecoverable error. Failing the process will signal the engine that the SASL process has failed and place the engine in a failed state as well as notify the registered error handler for the Engine.
        Parameters:
        failure - The exception to report to the Engine that describes the failure.
        Returns:
        this client context.