Interface Session

All Known Implementing Classes:
ServiceSession

public interface Session
The Session object represents a simple WebSocket session that contains the connection handshake details and the actual socket. In order to determine how the session should be interacted with the protocol is conveniently exposed, however all attributes of the original HTTP request are available.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    This is used as a shortcut for acquiring attributes for the response.
    This can be used to retrieve the response attributes.
    Provides a FrameChannel that can be used to communicate with the connected client.
    Provides the Request used to initiate the session.
    Provides the Response used to establish the session with the remote client.
  • Method Details

    • getAttributes

      Map getAttributes()
      This can be used to retrieve the response attributes. These can be used to keep state with the response when it is passed to other systems for processing. Attributes act as a convenient model for storing objects associated with the response. This also inherits attributes associated with the client connection.
      Returns:
      the attributes of that have been set on the request
    • getAttribute

      Object getAttribute(Object key)
      This is used as a shortcut for acquiring attributes for the response. This avoids acquiring the attribute Map in order to retrieve the attribute directly from that object. The attributes contain data specific to the response.
      Parameters:
      key - this is the key of the attribute to acquire
      Returns:
      this returns the attribute for the specified name
    • getChannel

      FrameChannel getChannel()
      Provides a FrameChannel that can be used to communicate with the connected client. Communication is full duplex and also asynchronous through the use of a FrameListener that can be registered with the channel.
      Returns:
      a web socket for full duplex communication
    • getRequest

      Request getRequest()
      Provides the Request used to initiate the session. This is useful in establishing the identity of the user, acquiring an security information and also for determining the request path that was used, which be used to establish context.
      Returns:
      the request used to initiate the session
    • getResponse

      Response getResponse()
      Provides the Response used to establish the session with the remote client. This is useful in establishing the protocol used to create the session and also for determining various other useful contextual information.
      Returns:
      the response used to establish the session