Class LinkConverter

java.lang.Object
io.temporal.internal.common.LinkConverter

public class LinkConverter extends Object
Converts between Link (used on history events and RPCs) and Link (the Nexus wire form: a URL plus a type string).

The following link types are supported, each with a fixed URL shape:

   WorkflowEvent    temporal:///namespaces/{ns}/workflows/{workflowId}/{runId}/history
   Workflow         temporal:///namespaces/{ns}/workflows/{workflowId}/{runId}
   NexusOperation   temporal:///namespaces/{ns}/nexus-operations/{operationId}/{runId}/details
   Activity         temporal:///namespaces/{ns}/activities/{activityId}/{runId}/details
   Callback         temporal:///namespaces/{ns}/{executionType}/{businessId}/{runId}/callbacks/{requestId}
 

Whoever decodes one of these URLs — the receiving server, or this class when a link arrives here — applies standard URL semantics: path segments are percent-decoded and query values are form-decoded. The two rules differ on +, so the codecs here are deliberately asymmetric — see encodePathSegment(java.lang.String) and decodeQuery(java.lang.String).

Every method returns null rather than throwing when a link is malformed. Links are decorative metadata attached to a Nexus call, so a bad one must never fail the call carrying it.

  • Method Details

    • linkToNexusLink

      @Nullable public static io.temporal.api.nexus.v1.Link linkToNexusLink(io.temporal.api.common.v1.Link commonLink)
      Dispatches on the oneof variant of commonLink. Returns null if no variant is set.
    • workflowEventToNexusLink

      public static io.temporal.api.nexus.v1.Link workflowEventToNexusLink(io.temporal.api.common.v1.Link.WorkflowEvent we)
    • workflowLinkToNexusLink

      public static io.temporal.api.nexus.v1.Link workflowLinkToNexusLink(io.temporal.api.common.v1.Link.Workflow w)
    • nexusOperationToNexusLink

      public static io.temporal.api.nexus.v1.Link nexusOperationToNexusLink(io.temporal.api.common.v1.Link.NexusOperation no)
    • activityToNexusLink

      public static io.temporal.api.nexus.v1.Link activityToNexusLink(io.temporal.api.common.v1.Link.Activity activity)
    • callbackToNexusLink

      @Nullable public static io.temporal.api.nexus.v1.Link callbackToNexusLink(io.temporal.api.common.v1.Link.Callback cb)
    • nexusLinkToLink

      @Nullable public static io.temporal.api.common.v1.Link nexusLinkToLink(io.temporal.api.nexus.v1.Link nexusLink)
      Dispatches on Link.getType().
    • nexusLinkToWorkflowEvent

      @Nullable public static io.temporal.api.common.v1.Link nexusLinkToWorkflowEvent(io.temporal.api.nexus.v1.Link nexusLink)
    • nexusLinkToWorkflowLink

      @Nullable public static io.temporal.api.common.v1.Link nexusLinkToWorkflowLink(io.temporal.api.nexus.v1.Link nexusLink)
    • nexusLinkToNexusOperation

      @Nullable public static io.temporal.api.common.v1.Link nexusLinkToNexusOperation(io.temporal.api.nexus.v1.Link nexusLink)
    • nexusLinkToActivity

      @Nullable public static io.temporal.api.common.v1.Link nexusLinkToActivity(io.temporal.api.nexus.v1.Link nexusLink)
    • nexusLinkToCallback

      @Nullable public static io.temporal.api.common.v1.Link nexusLinkToCallback(io.temporal.api.nexus.v1.Link nexusLink)
      Inverse of callbackToNexusLink(io.temporal.api.common.v1.Link.Callback). A missing component path decodes to an empty one.