Class TemporalOperationStartContext

java.lang.Object
io.temporal.nexus.TemporalOperationStartContext

@Experimental public final class TemporalOperationStartContext extends Object
Context for a Nexus start operation request, passed to TemporalOperationHandler.StartHandler alongside the TemporalNexusClient and input.
  • Method Details

    • getService

      public String getService()
      Returns the service name for this operation.
    • getOperation

      public String getOperation()
      Returns the operation name.
    • getHeaders

      public Map<String,String> getHeaders()
      Returns the headers for this operation request. The returned map is case-insensitive.
    • getDeadline

      public @Nullable Instant 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

      public String getRequestId()
      Returns the request ID for this operation.
    • getCallbackUrl

      public @Nullable String 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

      public Map<String,String> getCallbackHeaders()
      Headers to use on the callback if getCallbackUrl() is used.
    • getLinks

      public List<io.nexusrpc.Link> 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

      public @Nullable String 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.