Class A2aPushNotificationSender
java.lang.Object
com.xebialabs.xlrelease.a2a.callback.A2aPushNotificationSender
The inbound counterpart of the callback servlet: when a release backing an A2A task changes
state, POST the mapped task to the webhook its remote caller registered — so external agents
stop polling
GetTask the same way our tasks stopped polling them.
Event-driven off the release event bus, with three deliberate guards:
- registry first: every task event in the system passes through here, so the cheap map lookup decides before anything else runs;
- state-change dedupe: a notification goes out only when the mapped A2A state actually changed — a release full of quick script tasks does not spam its watcher;
- allowlist-gated POSTs: a webhook URL is caller-supplied, which is the textbook
SSRF vector — targets must be covered by the same agent allowlist as outbound calls
(
A2aAllowlistPolicy), or the registration is refused at delivery time and dropped.
Delivery is best-effort and fire-and-forget on the auxiliary executor: a failed POST is logged and the caller falls back to polling, which stays correct by design. Terminal states unregister the webhook after the final notification.
-
Constructor Summary
ConstructorsConstructorDescriptionA2aPushNotificationSender(A2aPushNotificationRegistry registry, A2aReleaseTaskMapper mapper, com.xebialabs.xlrelease.events.XLReleaseEventBus eventBus, ExecutorService auxiliaryExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidonReleaseAborted(com.xebialabs.xlrelease.domain.events.ReleaseAbortedEvent event) voidonReleaseCompleted(com.xebialabs.xlrelease.domain.events.ReleaseCompletedEvent event) voidonReleaseFailed(com.xebialabs.xlrelease.domain.events.ReleaseFailedEvent event) voidonTaskExecution(com.xebialabs.xlrelease.domain.events.TaskExecutionEvent event)
-
Constructor Details
-
A2aPushNotificationSender
public A2aPushNotificationSender(A2aPushNotificationRegistry registry, A2aReleaseTaskMapper mapper, com.xebialabs.xlrelease.events.XLReleaseEventBus eventBus, ExecutorService auxiliaryExecutor)
-
-
Method Details
-
onTaskExecution
public void onTaskExecution(com.xebialabs.xlrelease.domain.events.TaskExecutionEvent event) -
onReleaseCompleted
public void onReleaseCompleted(com.xebialabs.xlrelease.domain.events.ReleaseCompletedEvent event) -
onReleaseFailed
public void onReleaseFailed(com.xebialabs.xlrelease.domain.events.ReleaseFailedEvent event) -
onReleaseAborted
public void onReleaseAborted(com.xebialabs.xlrelease.domain.events.ReleaseAbortedEvent event)
-