Class NexusOperationExecutionDescription

java.lang.Object
io.temporal.client.NexusOperationExecutionMetadata
io.temporal.client.NexusOperationExecutionDescription

@Experimental public final class NexusOperationExecutionDescription extends NexusOperationExecutionMetadata
Detailed information about a standalone Nexus operation execution, returned by UntypedNexusOperationHandle.describe().
  • Constructor Details

    • NexusOperationExecutionDescription

      public NexusOperationExecutionDescription(io.temporal.api.workflowservice.v1.DescribeNexusOperationExecutionResponse response, DataConverter dataConverter, String namespace)
  • Method Details

    • getRawResponse

      @Nonnull public io.temporal.api.workflowservice.v1.DescribeNexusOperationExecutionResponse getRawResponse()
      Underlying proto response. Exposed while the Nexus SDK surface is still experimental.
    • getRawInfo

      @Nonnull public io.temporal.api.nexus.v1.NexusOperationExecutionInfo getRawInfo()
      The raw protobuf info returned by the server for this operation execution.
    • getAttempt

      public int getAttempt()
      Current attempt number for the start request (starts at 1).
    • getRunState

      @Nonnull public io.temporal.api.enums.v1.PendingNexusOperationState getRunState()
      Detailed run state (e.g. scheduled, started, backing off). Only meaningful when NexusOperationExecutionMetadata.getStatus() is NEXUS_OPERATION_EXECUTION_STATUS_RUNNING.
    • getScheduleToCloseTimeout

      @Nullable public Duration getScheduleToCloseTimeout()
      Total time the caller is willing to wait for the operation to complete, including retries.
    • getScheduleToStartTimeout

      @Nullable public Duration getScheduleToStartTimeout()
      Maximum time the start request may wait before being delivered to the handler.
    • getStartToCloseTimeout

      @Nullable public Duration getStartToCloseTimeout()
      Maximum time for a single start-request attempt.
    • getExpirationTime

      @Nullable public Instant getExpirationTime()
      Scheduled time plus schedule-to-close timeout.
    • getLastAttemptCompleteTime

      @Nullable public Instant getLastAttemptCompleteTime()
      Time the last start-request attempt completed (succeeded or failed).
    • getLastAttemptFailure

      @Nullable public Exception getLastAttemptFailure()
      Failure from the last start-request attempt. null if no failure has occurred.
    • getNextAttemptScheduleTime

      @Nullable public Instant getNextAttemptScheduleTime()
      Time when the next start-request attempt will be scheduled.
    • getCancellationInfo

      @Nullable public NexusOperationCancellationInfo getCancellationInfo()
      Cancellation details if cancellation was requested; null otherwise.
    • getBlockedReason

      @Nullable public String getBlockedReason()
      Additional context for why the operation is blocked. Set only when getRunState() is BLOCKED.
    • getHandlerRequestId

      @Nullable public String getHandlerRequestId()
      Server-generated request ID used as an idempotency token when submitting the start request to the operation handler.
    • getOperationToken

      @Nullable public String getOperationToken()
      Operation token returned by the handler; set only for asynchronous operations after start.
    • getIdentity

      @Nullable public String getIdentity()
      Identity of the client that started this operation.
    • getStaticSummary

      @Nullable public String getStaticSummary()
      Fixed summary attached when the operation was started, decoded from UserMetadata. Decoded on each call; cache the result if called frequently.
    • getStaticDetails

      @Nullable public String getStaticDetails()
      Fixed details attached when the operation was started, decoded from UserMetadata. Decoded on each call; cache the result if called frequently.
    • hasInput

      public boolean hasInput()
      Whether the operation input payload is present on this description. Set only when UntypedNexusOperationHandle.describe() was called with includeInput=true.
    • getInput

      public <V> Optional<V> getInput(Class<V> valueType)
      Deserializes the operation input into the given type. Returns Optional.empty() if no input is present (either the operation was started without one or includeInput was false on the describe call).
      Parameters:
      valueType - the class to deserialize the input into
    • getInput

      public <V> Optional<V> getInput(Class<V> valueType, Type genericType)
      Deserializes the operation input into the given generic type. Returns Optional.empty() if no input is present.
      Parameters:
      valueType - the class to deserialize the input into
      genericType - the generic type for deserialization; may equal valueType
    • hasResult

      public boolean hasResult()
      Whether the operation's success result is present. Set only when UntypedNexusOperationHandle.describe() was called with includeOutcome=true and the operation completed successfully.
    • getResult

      public <V> Optional<V> getResult(Class<V> valueType)
      Deserializes the operation's success result. Returns Optional.empty() if no result is present (operation still running, completed with a failure, or includeOutcome was false).
      Parameters:
      valueType - the class to deserialize the result into
    • getResult

      public <V> Optional<V> getResult(Class<V> valueType, Type genericType)
      Deserializes the operation's success result into the given generic type. Returns Optional.empty() if no result is present.
      Parameters:
      valueType - the class to deserialize the result into
      genericType - the generic type for deserialization; may equal valueType
    • getFailure

      @Nullable public Exception getFailure()
      Operation failure as a thrown-style exception. Returns null if the operation did not complete with a failure or if includeOutcome was false on the describe call.