Interface EngineSaslDriver

All Known Implementing Classes:
ProtonEngineNoOpSaslDriver

public interface EngineSaslDriver
Driver for the Engine that exposes SASL state and configuration.

When configured for SASL authentication the SASL driver provides a view of the current state of the authentication and allows for configuration of the SASL layer prior to the start of the authentication process. Once authentication is complete the driver provides a means of determining the outcome of process.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The SASL driver state used to determine at what point the current SASL negotiation process is currently in.
  • Method Summary

    Modifier and Type
    Method
    Description
    Configure this EngineSaslDriver to operate in client mode and return the associated SaslClientContext instance that should be used to complete the SASL negotiation with the server end.
    int
     
    Provides a low level outcome value for the SASL authentication process.
    Returns a SaslState that indicates the current operating state of the SASL negotiation process or conversely if no SASL layer is configured this method should return the disabled state.
    Configure this EngineSaslDriver to operate in server mode and return the associated SaslServerContext instance that should be used to complete the SASL negotiation with the client end.
    void
    setMaxFrameSize(int maxFrameSize)
    Set the maximum frame size the remote can send before an error is indicated.
  • Method Details

    • client

      Configure this EngineSaslDriver to operate in client mode and return the associated SaslClientContext instance that should be used to complete the SASL negotiation with the server end.
      Returns:
      the SASL client context.
      Throws:
      IllegalStateException - if the engine is already in server mode or the engine has not been configure with SASL support.
    • server

      Configure this EngineSaslDriver to operate in server mode and return the associated SaslServerContext instance that should be used to complete the SASL negotiation with the client end.
      Returns:
      the SASL server context.
      Throws:
      IllegalStateException - if the engine is already in client mode or the engine has not been configure with SASL support.
    • getSaslState

      Returns a SaslState that indicates the current operating state of the SASL negotiation process or conversely if no SASL layer is configured this method should return the disabled state. This method must never return a null result.
      Returns:
      the current state of SASL Authentication.
    • getSaslOutcome

      SaslOutcome getSaslOutcome()
      Provides a low level outcome value for the SASL authentication process.

      If the SASL exchange is ongoing or the SASL layer was skipped because a particular engine configuration allows such behavior then this method should return null to indicate no SASL outcome is available.

      Returns:
      the SASL outcome code that results from authentication
    • getMaxFrameSize

      int getMaxFrameSize()
      Returns:
      the currently configured max frame size allowed for SASL frames.
    • setMaxFrameSize

      void setMaxFrameSize(int maxFrameSize)
      Set the maximum frame size the remote can send before an error is indicated.

      The AMQP specification defines a default of 512 bytes for this value however in some cases this value is to small for the data needed in some SASL mechanisms. This allows the user to configure a larger acceptable value, the lowest possible value remains the default 512 bytes.

      Parameters:
      maxFrameSize - The maximum allowed frame size from the remote sender.