Class TemporalOperationStartContext
java.lang.Object
io.temporal.nexus.TemporalOperationStartContext
Context for a Nexus start operation request, passed to
TemporalOperationHandler.StartHandler alongside the TemporalNexusClient and input.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Add a listener for method cancellation.voidaddResponseLinks(io.nexusrpc.Link... links) Associates links with the current operation to be propagated back to the caller.Headers to use on the callback ifgetCallbackUrl()is used.@Nullable StringOptional callback URL for asynchronous operations to deliver results to.@Nullable InstantReturns the deadline for the operation handler method.Returns the headers for this operation request.List<io.nexusrpc.Link> getLinks()Links sent by the caller.@Nullable StringReason the handler method was cancelled, or null if not cancelled.Returns the operation name.Returns the request ID for this operation.Returns the service name for this operation.booleanTrue if the handler method has been cancelled.voidremoveMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Remove a method cancellation listener, if present.
-
Method Details
-
getService
Returns the service name for this operation. -
getOperation
Returns the operation name. -
getHeaders
-
getDeadline
Returns the deadline for the operation handler method. This is the time by which the method should complete. This is not the operation's deadline. -
getRequestId
Returns the request ID for this operation. -
getCallbackUrl
Optional callback URL for asynchronous operations to deliver results to. If present and the implementation is asynchronous, the implementation should ensure this callback is invoked with the result upon completion. -
getCallbackHeaders
Headers to use on the callback ifgetCallbackUrl()is used. -
getLinks
Links sent by the caller. Handlers may use these as metadata on associated resources. -
isMethodCancelled
public boolean isMethodCancelled()True if the handler method has been cancelled. Note, this is method cancellation, unrelated to operation cancellation. -
getMethodCancellationReason
Reason the handler method was cancelled, or null if not cancelled. Note, this is method cancellation, unrelated to operation cancellation. -
addMethodCancellationListener
public void addMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Add a listener for method cancellation. The listener is invoked immediately before this method returns if the method is already cancelled. The listener must not block and must not be registered from within another cancellation listener. -
removeMethodCancellationListener
public void removeMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Remove a method cancellation listener, if present. Must not be called from within another cancellation listener. -
addResponseLinks
public void addResponseLinks(io.nexusrpc.Link... links) Associates links with the current operation to be propagated back to the caller. Links are only attached on successful responses.
-