Class A2aReleaseTaskMapper
java.lang.Object
com.xebialabs.xlrelease.a2a.server.A2aReleaseTaskMapper
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_COMPLETEDwith 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 -
Method Summary
Modifier and TypeMethodDescriptionorg.a2aproject.sdk.spec.TaskAborts the backing release — the inbound half of the cascading stop — and returns the task view after the abort.org.a2aproject.sdk.spec.TaskThe live A2A task for a release, resolved and mapped at call time.booleanlooksLikeReleaseId(String taskId) Whether an A2A task id plausibly names a release (vs a stored synchronous-skill task id) — the canonicalIds.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.TasktaskOf(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.
-
Constructor Details
-
A2aReleaseTaskMapper
public A2aReleaseTaskMapper(com.xebialabs.xlrelease.api.v1.ReleaseApi releaseApi)
-
-
Method Details
-
looksLikeReleaseId
Whether an A2A task id plausibly names a release (vs a stored synchronous-skill task id) — the canonicalIds.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
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), ornullto default to the release id
-
cancel
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
Human-readable release summary — the artifact text for terminal states and status queries.
-