Class NotificationDispatcher
BatchControlNotifier on a background thread (D-36).
Callers (the policy services and the expiry work) call it after the state change is
persisted. Nothing here can fail or delay the calling request: building the notification,
submission and every notifier call are guarded, and failures are only logged.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringD-75 (1), S-39-04: the fixed sentence of a notice whose window followed its item to a name the recipient may not read; the notice then names the approved name instead. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidactivation(NotificationEvent event, ActivationRequest request) Event for an activation or hold request (SPEC item 6a).static voidactivationEnded(NotificationEvent event, ActivationRequest request, boolean wasPending, String reason) AsrunEnded(io.jenkins.plugins.batchcontrol.ops.NotificationEvent, io.jenkins.plugins.batchcontrol.model.RunRequest, boolean, java.lang.String)for an activation or hold request.static voidgrant(NotificationEvent event, GrantRequest request) Event for a change (grant) request.static voidgrantApproved(GrantRequest request, String endedAtOnceBecause) NotificationEvent.APPROVEDfor a change request, sent to its requester.static voidgrantEnded(NotificationEvent event, GrantRequest request, boolean wasPending, String reason) static voidgrantExpiring(Grant grant, GrantRequest request) NotificationEvent.GRANT_EXPIRINGfor an active window, sent to its holder.static voidrun(NotificationEvent event, RunRequest request) Event for a run request.static voidrunEnded(NotificationEvent event, RunRequest request, boolean wasPending, String reason) D-54:NotificationEvent.CANCELLED,NotificationEvent.EXPIREDorNotificationEvent.INVALIDATEDfor a run request that ended without a decision.static voidshutdown()Stops the notifier thread when Jenkins shuts down: no new work is accepted, pending notifications are discarded, and a running delivery gets a short grace period before it is interrupted.
-
Field Details
-
MOVED_NOTICE
D-75 (1), S-39-04: the fixed sentence of a notice whose window followed its item to a name the recipient may not read; the notice then names the approved name instead. A fixed sentence from the plugin, never user input (it is shown with the other notices, D-38a).- See Also:
-
-
Method Details
-
shutdown
Stops the notifier thread when Jenkins shuts down: no new work is accepted, pending notifications are discarded, and a running delivery gets a short grace period before it is interrupted. The next Jenkins session in the same JVM (tests) gets a fresh executor. -
run
Event for a run request. Recipients follow the D-36 rule for the event. -
grant
Event for a change (grant) request. Recipients follow the D-36 rule for the event. -
grantApproved
NotificationEvent.APPROVEDfor a change request, sent to its requester.Owner decision 2026-10-06 (D-71c (3), D-75 (2)): when the window ended at once because its item was deleted after the approval checked it and before the window was registered, the notice is still APPROVED (no other notice type) and carries one more details line, first, saying so:
Window: ended at once — <reason>.- Parameters:
endedAtOnceBecause- why the window ended at registration (for exampleGrant.REVOKED_ITEM_DELETED), ornullwhen it is in effect
-
activation
Event for an activation or hold request (SPEC item 6a). Recipients follow the D-36 rule for the event; the kind isNotification.KIND_ACTIVATION. -
runEnded
public static void runEnded(NotificationEvent event, RunRequest request, boolean wasPending, @CheckForNull String reason) D-54:NotificationEvent.CANCELLED,NotificationEvent.EXPIREDorNotificationEvent.INVALIDATEDfor a run request that ended without a decision.- Parameters:
wasPending- whether the request was PENDING when it ended (its approvers are told)reason- why it ended, shown in the message; may benull
-
grantEnded
public static void grantEnded(NotificationEvent event, GrantRequest request, boolean wasPending, @CheckForNull String reason) -
activationEnded
public static void activationEnded(NotificationEvent event, ActivationRequest request, boolean wasPending, @CheckForNull String reason) AsrunEnded(io.jenkins.plugins.batchcontrol.ops.NotificationEvent, io.jenkins.plugins.batchcontrol.model.RunRequest, boolean, java.lang.String)for an activation or hold request. -
grantExpiring
NotificationEvent.GRANT_EXPIRINGfor an active window, sent to its holder.D-75 (1), security-39 S-39-04: the window follows its item when an administrator renames or moves it (D-74 (3)), possibly into a folder its holder cannot read. The notice therefore names the item's current full name only when the holder may read the item now (
recipientMayRead(java.lang.String, java.lang.String), checked as the holder); otherwise it names the approved name (the request's scope) with the fixedMOVED_NOTICE. A window whose name did not change is named as before, without any check. This is the only notice that names a window's current scope: every other change request notice names the request's own scope, which is the approved name and never follows the item.- Parameters:
request- the change request the window came from, ornullwhen it cannot be read; then the approved name is unknown, and a window whose current item the holder cannot read is not named at all: the notice is not sent (logged)
-