Package org.apache.arrow.flight
Class ServerSessionMiddleware
java.lang.Object
org.apache.arrow.flight.ServerSessionMiddleware
- All Implemented Interfaces:
FlightServerMiddleware
Middleware for handling Flight SQL Sessions including session cookie handling.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Factory for managing and accessing ServerSessionMiddleware.static class
A thread-safe container for named SessionOptionValues.Nested classes/interfaces inherited from interface org.apache.arrow.flight.FlightServerMiddleware
FlightServerMiddleware.Key<T extends FlightServerMiddleware>
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the current session.Get the existing or new session value map for this call.boolean
Check if there is an open session associated with this call.void
onBeforeSendingHeaders
(CallHeaders outgoingHeaders) Callback for when the underlying transport is about to send response headers.void
onCallCompleted
(CallStatus status) Callback for when the underlying transport has completed a call.void
onCallErrored
(Throwable err) Callback for when an RPC method implementation throws an uncaught exception.
-
Field Details
-
sessionCookieName
- See Also:
-
-
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
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
-
onBeforeSendingHeaders
Description copied from interface:FlightServerMiddleware
Callback for when the underlying transport is about to send response headers.- Specified by:
onBeforeSendingHeaders
in interfaceFlightServerMiddleware
- Parameters:
outgoingHeaders
- A mutable set of response headers. These can be manipulated to send different headers to the client.
-
onCallCompleted
Description copied from interface:FlightServerMiddleware
Callback for when the underlying transport has completed a call.- Specified by:
onCallCompleted
in interfaceFlightServerMiddleware
- Parameters:
status
- Whether the call completed successfully or not.
-
onCallErrored
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 errorCallStatus
, and will be reported toFlightServerMiddleware.onCallCompleted(CallStatus)
, but not necessarily this method.- Specified by:
onCallErrored
in interfaceFlightServerMiddleware
- Parameters:
err
- The exception that was thrown.
-