Class A2aReleaseTaskMapper

java.lang.Object
com.xebialabs.xlrelease.a2a.server.A2aReleaseTaskMapper

public class A2aReleaseTaskMapper extends Object
The Phase-1 heart of "Release as an A2A server": a release is an A2A task, live.

The A2A task id of a release-backed task is the release id itself, so there is no correlation store to keep consistent or lose on restart — GetTask resolves the release and derives the task state from what the release is doing right now:

  • an active gate or manual task → TASK_STATE_INPUT_REQUIRED, the A2A-native statement that a human is in the loop, with the waiting item named in the status message;
  • otherwise in progress / paused → TASK_STATE_WORKING;
  • planned → TASK_STATE_SUBMITTED; completed → TASK_STATE_COMPLETED with the release summary as the result artifact; aborted → TASK_STATE_CANCELED; failed/failing → TASK_STATE_FAILED.

Lookups run as the authenticated caller, so visibility is the caller's Release permissions — the same governance as the UI, not a side door.

  • Constructor Summary

    Constructors
    Constructor
    Description
    A2aReleaseTaskMapper(com.xebialabs.xlrelease.api.v1.ReleaseApi releaseApi)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.a2aproject.sdk.spec.Task
    cancel(String releaseId, String reason)
    Aborts the backing release — the inbound half of the cascading stop — and returns the task view after the abort.
    org.a2aproject.sdk.spec.Task
    liveTask(String releaseId, String contextId)
    The live A2A task for a release, resolved and mapped at call time.
    boolean
    Whether an A2A task id plausibly names a release (vs a stored synchronous-skill task id) — the canonical Ids.isReleaseId(java.lang.String) predicate, not a private re-invention of it: folder segments may contain characters a stricter regex would reject, and a live release must never fall through to the store's "task may have expired" answer.
    summarize(com.xebialabs.xlrelease.domain.Release release)
    Human-readable release summary — the artifact text for terminal states and status queries.
    org.a2aproject.sdk.spec.Task
    taskOf(com.xebialabs.xlrelease.domain.Release release)
    The A2A task for an already-loaded release — the event-driven path (push notifications), where the release arrives on the event and no permission-checked lookup is needed or wanted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • A2aReleaseTaskMapper

      public A2aReleaseTaskMapper(com.xebialabs.xlrelease.api.v1.ReleaseApi releaseApi)
  • Method Details

    • looksLikeReleaseId

      public boolean looksLikeReleaseId(String taskId)
      Whether an A2A task id plausibly names a release (vs a stored synchronous-skill task id) — the canonical Ids.isReleaseId(java.lang.String) predicate, not a private re-invention of it: folder segments may contain characters a stricter regex would reject, and a live release must never fall through to the store's "task may have expired" answer. The store's UUID keyspace can never satisfy this predicate, so the two routes stay disjoint.
    • liveTask

      public org.a2aproject.sdk.spec.Task liveTask(String releaseId, String contextId)
      The live A2A task for a release, resolved and mapped at call time.
      Parameters:
      contextId - the A2A context to report — the client-supplied one when the exchange has one (the spec requires a server to adopt it), or null to default to the release id
    • cancel

      public org.a2aproject.sdk.spec.Task cancel(String releaseId, String reason)
      Aborts the backing release — the inbound half of the cascading stop — and returns the task view after the abort. A release already in a terminal state cannot be aborted; the host API throws and the servlet maps that to the spec's TaskNotCancelable error.
    • taskOf

      public org.a2aproject.sdk.spec.Task taskOf(com.xebialabs.xlrelease.domain.Release release)
      The A2A task for an already-loaded release — the event-driven path (push notifications), where the release arrives on the event and no permission-checked lookup is needed or wanted.
    • summarize

      public String summarize(com.xebialabs.xlrelease.domain.Release release)
      Human-readable release summary — the artifact text for terminal states and status queries.