Class InternalNexusOperationContext

java.lang.Object
io.temporal.internal.nexus.InternalNexusOperationContext

public class InternalNexusOperationContext extends Object
  • Constructor Details

    • InternalNexusOperationContext

      public InternalNexusOperationContext(String namespace, String taskQueue, String endpoint, com.uber.m3.tally.Scope metricScope, WorkflowClient client)
  • Method Details

    • getMetricsScope

      public com.uber.m3.tally.Scope getMetricsScope()
    • getWorkflowClient

      public WorkflowClient getWorkflowClient()
    • getTaskQueue

      public String getTaskQueue()
    • getNamespace

      public String getNamespace()
    • getEndpoint

      public String getEndpoint()
    • setOutboundInterceptor

      public void setOutboundInterceptor(NexusOperationOutboundCallsInterceptor outboundCalls)
    • getUserFacingContext

      public NexusOperationContext getUserFacingContext()
    • setNexusOperationMetadata

      public void setNexusOperationMetadata(NexusOperationMetadata metadata)
      Sets metadata for the Temporal primitive backing the current Nexus operation.
    • getNexusOperationMetadata

      public NexusOperationMetadata getNexusOperationMetadata()
    • setSerializationContext

      public void setSerializationContext(NexusSerializationContext serializationContext)
      Sets the serialization context describing the operation this task is for. Called by the task handler once the request variant has been inspected and the service and operation are known.
    • getSerializationContext

      @Nullable public NexusSerializationContext getSerializationContext()
      Serialization context for the operation this task is for, or null if the service and operation are not known yet.
    • setRequestLinks

      public void setRequestLinks(List<io.temporal.api.common.v1.Link> links)
      Set the common.v1.Links extracted from the inbound Nexus task so they can be attached to RPCs issued by the operation handler.
    • getRequestLinks

      @Nonnull public List<io.temporal.api.common.v1.Link> getRequestLinks()
      Links from the inbound Nexus task; empty if none.
    • setRequestId

      public void setRequestId(String requestId)
      Set the request ID of the inbound Nexus task, ambient for the whole invocation.
    • getRequestId

      public String getRequestId()
      The inbound Nexus task's request ID; null if not set.
    • enableSignalDeduplication

      public void enableSignalDeduplication()
      Makes signals reuse getRequestId() and limits them to one; see claimSignal().
    • getSignalRequestId

      @Nullable public String getSignalRequestId()
      The request ID signals must reuse; null outside a Temporal operation start.
    • claimSignal

      public void claimSignal()
      Claims the invocation's single signal. No-op unless enableSignalDeduplication() was called. Callers must releaseSignal() if the signal fails, so the handler can send it again.
    • claimSignalWithStart

      public void claimSignalWithStart(@Nullable String workflowId)
      Like claimSignal(), but also rejects an empty workflow ID: it would be defaulted to a fresh UUID on each retried Nexus task, so the server could not dedupe and would start another workflow.
    • releaseSignal

      public void releaseSignal()
      Frees the signal claimed by claimSignal() after the signal failed.
    • setStartWorkflowResponseLink

      public void setStartWorkflowResponseLink(io.temporal.api.common.v1.Link link)
    • getStartWorkflowResponseLink

      public io.temporal.api.common.v1.Link getStartWorkflowResponseLink()
    • addResponseLink

      public void addResponseLink(io.temporal.api.common.v1.Link link)
      Append a response link returned by an outbound RPC the operation handler issued (e.g. signal, signalWithStart, etc). The task handler drains the list when building the operation's StartOperationResponse.
    • getResponseLinks

      @Nonnull public List<io.temporal.api.common.v1.Link> getResponseLinks()
      Response links from every outbound RPC the handler issued. Returned as an unmodifiable view; callers must not attempt to mutate. Entries are accumulated while the operation handler runs (the call that flows through NexusOperationInboundCallsInterceptor.startOperation(io.temporal.common.interceptors.NexusOperationInboundCallsInterceptor.StartOperationInput)) and are drained afterward by the task handler when building the StartOperationResponse.