Class ActivationRequest
java.lang.Object
io.jenkins.plugins.batchcontrol.model.ActivationRequest
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class ActivationRequest
extends Object
A request to put one job into service (
ActivationRequest.Action.ACTIVATE) or to put it on hold
(ActivationRequest.Action.HOLD) (SPEC item 6a, D-39). Persisted as XStream XML at
activation-requests/<id>.xml.
Unlike a grant request, the subject is one specific named job and there is no window: an
approved request changes the job's ActivationState and is then closed.
Timestamps are persisted as epoch milliseconds, like the other request models (the Jenkins
XStream class filter does not allow java.time.Instant).
Status transitions are performed only by policy.ActivationService; other code must
not call setStatus(io.jenkins.plugins.batchcontrol.model.RequestStatus).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat the request asks for.static final classOne approver change entry (D-37); same shape asGrantRequest.ApproverChange. -
Method Summary
Modifier and TypeMethodDescriptionvoidOnly the policy service records approver changes.static ActivationRequestcreate(String jobFullName, ActivationRequest.Action action, String reason, String requester, List<String> approvers) Creates a new PENDING request with a fresh id and theBatchClocktime.The designated approver set (D-37), in designation order.The user who closed the request: the approver who approved or rejected it, or the user who cancelled it (e2e-03 DEF-13);nullwhile undecided.getId()booleanisDesignatedApprover(String userId) WhetheruserIdis a member of the designated set.booleanbooleanWhether the deciding approver was the requester (administrator self-approval, SPEC item 2).voidsetApprovers(List<String> approvers) Only the policy service changes the designated set.voidsetDecidedAt(Instant decidedAt) voidsetDecidedBy(String decidedBy) Only the policy service records the deciding approver.voidsetDecisionComment(String decisionComment) voidsetExpiringNotified(boolean expiringNotified) Only the policy service marks the D-36 EXPIRING notification as sent.voidsetSelfApproved(boolean selfApproved) voidsetStatus(RequestStatus status) Only the policy service may transition the status.
-
Method Details
-
create
public static ActivationRequest create(String jobFullName, ActivationRequest.Action action, String reason, String requester, List<String> approvers) Creates a new PENDING request with a fresh id and theBatchClocktime. -
getId
-
getJobFullName
-
getAction
-
getReason
-
getRequester
-
getApprovers
The designated approver set (D-37), in designation order. -
isDesignatedApprover
WhetheruserIdis a member of the designated set. -
getDecidedBy
The user who closed the request: the approver who approved or rejected it, or the user who cancelled it (e2e-03 DEF-13);nullwhile undecided. -
isSelfApproved
public boolean isSelfApproved()Whether the deciding approver was the requester (administrator self-approval, SPEC item 2). -
getApproverChanges
-
isExpiringNotified
public boolean isExpiringNotified() -
getStatus
-
getCreatedAt
-
getDecidedAt
-
getDecisionComment
-
setStatus
Only the policy service may transition the status. -
setDecidedAt
-
setDecisionComment
-
setApprovers
Only the policy service changes the designated set. -
setDecidedBy
Only the policy service records the deciding approver. -
setSelfApproved
public void setSelfApproved(boolean selfApproved) -
addApproverChange
Only the policy service records approver changes. -
setExpiringNotified
public void setExpiringNotified(boolean expiringNotified) Only the policy service marks the D-36 EXPIRING notification as sent.
-