Package io.deephaven.server.appmode
Class ApplicationTicketResolver
java.lang.Object
io.deephaven.server.session.PathResolverPrefixedBase
io.deephaven.server.session.TicketResolverBase
io.deephaven.server.appmode.ApplicationTicketResolver
- All Implemented Interfaces:
ApplicationStates
,PathResolver
,TicketResolver
@Singleton
public class ApplicationTicketResolver
extends TicketResolverBase
implements ApplicationStates
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.server.session.TicketResolver
TicketResolver.Authorization
-
Field Summary
Fields inherited from class io.deephaven.server.session.TicketResolverBase
authorization
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.arrow.flight.impl.Flight.FlightDescriptor
descriptorForName
(ApplicationState app, String name) Convenience method to convert from a scoped variable name to Flight.FlightDescriptorSessionState.ExportObject<org.apache.arrow.flight.impl.Flight.FlightInfo>
flightInfoFor
(@Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Retrieve a FlightInfo for a given FlightDescriptor.static org.apache.arrow.flight.impl.Flight.Ticket
flightTicketForName
(ApplicationState app, String name) Convenience method to convert from an application variable name to Flight.Ticketvoid
forAllFlightInfo
(@Nullable SessionState session, Consumer<org.apache.arrow.flight.impl.Flight.FlightInfo> visitor) This invokes the provided visitor for each valid flight descriptor this ticket resolver exposes via flight.final Optional<ApplicationState>
getApplicationState
(String applicationId) getLogNameFor
(ByteBuffer ticket, String logId) Create a human readable string to identify this ticket.void
<T> SessionState.ExportBuilder<T>
publish
(SessionState session, ByteBuffer ticket, String logId, Runnable onPublish) Publish a new result as a flight ticket to an export object future.<T> SessionState.ExportBuilder<T>
publish
(SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId, Runnable onPublish) Publish a new result as a flight descriptor to an export object future.<T> SessionState.ExportObject<T>
resolve
(@Nullable SessionState session, ByteBuffer ticket, String logId) Resolve a flight ticket to an export object future.<T> SessionState.ExportObject<T>
resolve
(@Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Resolve a flight descriptor to an export object future.static Ticket
ticketForName
(ApplicationState app, String name) Convenience method to convert from an application variable name to TicketMethods inherited from class io.deephaven.server.session.TicketResolverBase
ticketRoute
Methods inherited from class io.deephaven.server.session.PathResolverPrefixedBase
flightDescriptorRoute, handlesPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.server.session.TicketResolver
publish
-
Constructor Details
-
ApplicationTicketResolver
-
-
Method Details
-
getApplicationState
- Specified by:
getApplicationState
in interfaceApplicationStates
-
onApplicationLoad
-
resolve
public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, ByteBuffer ticket, String logId) Description copied from interface:TicketResolver
Resolve a flight ticket to an export object future.- Specified by:
resolve
in interfaceTicketResolver
- Type Parameters:
T
- the expected return type of the ticket; this is not validated- Parameters:
session
- the user session contextticket
- (as ByteByffer) the ticket to resolvelogId
- an end-user friendly identification of the ticket should an error occur- Returns:
- an export object; see
SessionState
for lifecycle propagation details
-
resolve
public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Description copied from interface:TicketResolver
Resolve a flight descriptor to an export object future.- Specified by:
resolve
in interfaceTicketResolver
- Type Parameters:
T
- the expected return type of the ticket; this is not validated- Parameters:
session
- the user session contextdescriptor
- the descriptor to resolvelogId
- an end-user friendly identification of the ticket should an error occur- Returns:
- an export object; see
SessionState
for lifecycle propagation details
-
flightInfoFor
public SessionState.ExportObject<org.apache.arrow.flight.impl.Flight.FlightInfo> flightInfoFor(@Nullable @Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Description copied from interface:TicketResolver
Retrieve a FlightInfo for a given FlightDescriptor.- Specified by:
flightInfoFor
in interfaceTicketResolver
descriptor
- the flight descriptor to retrieve a ticket forlogId
- an end-user friendly identification of the ticket should an error occur- Returns:
- a FlightInfo describing this flight
-
publish
public <T> SessionState.ExportBuilder<T> publish(SessionState session, ByteBuffer ticket, String logId, Runnable onPublish) Description copied from interface:TicketResolver
Publish a new result as a flight ticket to an export object future.The user must call
SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>)
to publish the result value.- Specified by:
publish
in interfaceTicketResolver
- Type Parameters:
T
- the type of the result the export will publish- Parameters:
session
- the user session contextticket
- (as ByteByffer) the ticket to publish tologId
- an end-user friendly identification of the ticket should an error occuronPublish
- an optional callback to invoke when the result is published- Returns:
- an export object; see
SessionState
for lifecycle propagation details
-
publish
public <T> SessionState.ExportBuilder<T> publish(SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId, Runnable onPublish) Description copied from interface:TicketResolver
Publish a new result as a flight descriptor to an export object future.The user must call
SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>)
to publish the result value.- Specified by:
publish
in interfaceTicketResolver
- Type Parameters:
T
- the type of the result the export will publish- Parameters:
session
- the user session contextdescriptor
- (as Flight.Descriptor) the descriptor to publish tologId
- an end-user friendly identification of the ticket should an error occuronPublish
- an optional callback to invoke when the result is published- Returns:
- an export object; see
SessionState
for lifecycle propagation details
-
getLogNameFor
Description copied from interface:TicketResolver
Create a human readable string to identify this ticket.- Specified by:
getLogNameFor
in interfaceTicketResolver
- Parameters:
ticket
- the ticket to parselogId
- an end-user friendly identification of the ticket should an error occur- Returns:
- a string that is good for log/error messages
-
forAllFlightInfo
public void forAllFlightInfo(@Nullable @Nullable SessionState session, Consumer<org.apache.arrow.flight.impl.Flight.FlightInfo> visitor) Description copied from interface:TicketResolver
This invokes the provided visitor for each valid flight descriptor this ticket resolver exposes via flight.- Specified by:
forAllFlightInfo
in interfaceTicketResolver
- Parameters:
session
- optional session that the resolver can use to filter which flights a visitor seesvisitor
- the callback to invoke per descriptor path
-
ticketForName
Convenience method to convert from an application variable name to Ticket- Parameters:
app
- the application state that this field is defined inname
- the application variable name to convert- Returns:
- the ticket this descriptor represents
-
flightTicketForName
public static org.apache.arrow.flight.impl.Flight.Ticket flightTicketForName(ApplicationState app, String name) Convenience method to convert from an application variable name to Flight.Ticket- Parameters:
app
- the application state that this field is defined inname
- the application variable name to convert- Returns:
- the ticket this descriptor represents
-
descriptorForName
public static org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptorForName(ApplicationState app, String name) Convenience method to convert from a scoped variable name to Flight.FlightDescriptor- Parameters:
app
- the application state that this field is defined inname
- the application variable name to convert- Returns:
- the flight descriptor this descriptor represents
-