Class ServerSessionMiddleware

java.lang.Object
org.apache.arrow.flight.ServerSessionMiddleware
All Implemented Interfaces:
FlightServerMiddleware

public class ServerSessionMiddleware extends Object implements FlightServerMiddleware
Middleware for handling Flight SQL Sessions including session cookie handling.
  • Field Details

  • Method Details

    • hasSession

      public boolean hasSession()
      Check if there is an open session associated with this call.
      Returns:
      True iff there is an open session associated with this call.
    • getSession

      public ServerSessionMiddleware.Session getSession()
      Get the existing or new session value map for this call.
      Returns:
      The session option value map, or null in case of an id generation collision.
    • closeSession

      public void closeSession()
      Close the current session. It is an error to call this without a valid session specified via cookie or equivalent.
    • getCallHeaders

      public CallHeaders getCallHeaders()
    • onBeforeSendingHeaders

      public void onBeforeSendingHeaders(CallHeaders outgoingHeaders)
      Description copied from interface: FlightServerMiddleware
      Callback for when the underlying transport is about to send response headers.
      Specified by:
      onBeforeSendingHeaders in interface FlightServerMiddleware
      Parameters:
      outgoingHeaders - A mutable set of response headers. These can be manipulated to send different headers to the client.
    • onCallCompleted

      public void onCallCompleted(CallStatus status)
      Description copied from interface: FlightServerMiddleware
      Callback for when the underlying transport has completed a call.
      Specified by:
      onCallCompleted in interface FlightServerMiddleware
      Parameters:
      status - Whether the call completed successfully or not.
    • onCallErrored

      public void onCallErrored(Throwable err)
      Description copied from interface: FlightServerMiddleware
      Callback for when an RPC method implementation throws an uncaught exception.

      May be called multiple times, and may be called before or after FlightServerMiddleware.onCallCompleted(CallStatus). Generally, an uncaught exception will end the call with a error CallStatus, and will be reported to FlightServerMiddleware.onCallCompleted(CallStatus), but not necessarily this method.

      Specified by:
      onCallErrored in interface FlightServerMiddleware
      Parameters:
      err - The exception that was thrown.