Class OperationTokenUtil

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

public class OperationTokenUtil extends Object
  • Method Details

    • loadOperationToken

      public static OperationToken loadOperationToken(String operationToken)
      Load and validate an operation token without asserting the token type. Use this for cancel dispatch where the token type determines the cancel behavior.
      Throws:
      IllegalArgumentException - if the operation token is malformed or has invalid structure
    • loadWorkflowRunOperationToken

      public static OperationToken loadWorkflowRunOperationToken(String operationToken)
      Load a workflow run operation token, asserting that the token type is OperationTokenType.WORKFLOW_RUN.
      Throws:
      IllegalArgumentException - if the operation token is invalid or not a workflow run token
    • loadWorkflowIdFromOperationToken

      public static String loadWorkflowIdFromOperationToken(String operationToken)
      Extract the workflow ID from a workflow run operation token.
      Throws:
      IllegalArgumentException - if the operation token is invalid
    • generateWorkflowRunOperationToken

      public static String generateWorkflowRunOperationToken(String workflowId, String namespace) throws com.fasterxml.jackson.core.JsonProcessingException
      Generate a workflow run operation token from a workflow ID and namespace.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException