Class RunRequest
requests/run/<id>.xml.
D-72, D-74: parameters is the masked display map derived from the submitted
ParameterValues once at submission, the only form in which a request's
parameters are shown or written anywhere else. The typed values themselves are not part of this
object: the store keeps them in their own file (requests/run/<id>.values.xml), read only
to approve, submit, recover or dispose of the request, and deleted when the approved run starts
or the request ends.
Timestamps are persisted as epoch milliseconds (long) because the Jenkins XStream
class filter does not allow java.time.Instant; the accessors expose Instant.
Status transitions must only be performed by the policy services
(policy.RunRequestService); other code must not call setStatus(io.jenkins.plugins.batchcontrol.model.RequestStatus).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne approver change entry: (previous set, new set, changed by, at) (SPEC item 3, D-37). -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic RunRequestcreate(String jobFullName, Map<String, String> parameters, String reason, String requester, String approver) Single-approver form ofcreate(String, Map, String, String, List).static RunRequestcreate(String jobFullName, Map<String, String> parameters, String reason, String requester, List<String> approvers) Creates a new PENDING request with a random UUID id (D-68) and its creation time fromBatchClock, holding the masked display mapparameters(D-72).Compatibility view (D-37): the first designated approver, ornullwith none.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.The instant the approved build started, ornullif not executed (or stored before).Base instant for the approved-run timeout; falls back togetDecidedAt().getId()The masked display map (D-72): a sensitive value is********, a file value[file] <original file name>.D-72b (7): when the queue item of the approved run was cancelled, ornull.The instant the consumption ticket was claimed, ornullif still unused.booleanisDesignatedApprover(String userId) WhetheruserIdis a member of the designated set.booleanWhether the D-36 EXPIRING notification was already sent.booleanvoidsetApprovers(List<String> approvers) Only the policy services change the designated set.voidsetDecidedAt(Instant decidedAt) voidsetDecidedBy(String decidedBy) Only the policy services record the deciding approver.voidsetDecisionComment(String decisionComment) voidsetExecutedAt(Instant executedAt) voidsetExecutedRunId(String executedRunId) voidsetExpiringNotified(boolean expiringNotified) Only the policy services mark the D-36 EXPIRING notification as sent.voidsetExpiryBase(Instant expiryBase) voidsetIncidentId(String incidentId) voidsetInvalidationReason(String invalidationReason) voidsetQueueCancelledAt(Instant queueCancelledAt) Only the policy service records the cancellation of the approved run's queue item.voidsetQueuedAt(Instant queuedAt) Only the policy service claims (non-null) or re-issues (null) the ticket.voidsetSelfApproved(boolean selfApproved) voidsetStatus(RequestStatus status) Only the policy services may transition the status.
-
Method Details
-
create
public static RunRequest create(String jobFullName, Map<String, String> parameters, String reason, String requester, List<String> approvers) Creates a new PENDING request with a random UUID id (D-68) and its creation time fromBatchClock, holding the masked display mapparameters(D-72). The typed values the map was derived from are stored next to it by the store (D-74). -
create
public static RunRequest create(String jobFullName, Map<String, String> parameters, String reason, String requester, String approver) Single-approver form ofcreate(String, Map, String, String, List). -
getId
-
getJobFullName
-
getParameters
The masked display map (D-72): a sensitive value is********, a file value[file] <original file name>. A defensive copy; it never changes after creation. -
getReason
-
getRequester
-
getApprovers
The designated approver set (D-37), in designation order. -
getApprover
Compatibility view (D-37): the first designated approver, ornullwith none. New code usesgetApprovers()andgetDecidedBy(). -
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. -
isExpiringNotified
public boolean isExpiringNotified()Whether the D-36 EXPIRING notification was already sent. -
getStatus
-
getCreatedAt
-
getDecidedAt
-
getDecisionComment
-
isSelfApproved
public boolean isSelfApproved() -
getApproverChanges
-
getIncidentId
-
getExecutedRunId
-
setStatus
Only the policy services may transition the status. -
setApprovers
Only the policy services change the designated set. -
setDecidedBy
Only the policy services record the deciding approver. -
setExpiringNotified
public void setExpiringNotified(boolean expiringNotified) Only the policy services mark the D-36 EXPIRING notification as sent. -
setDecidedAt
-
setDecisionComment
-
setSelfApproved
public void setSelfApproved(boolean selfApproved) -
addApproverChange
-
setIncidentId
-
setExecutedRunId
-
getExecutedAt
The instant the approved build started, ornullif not executed (or stored before). -
setExecutedAt
-
getQueuedAt
The instant the consumption ticket was claimed, ornullif still unused. -
setQueuedAt
Only the policy service claims (non-null) or re-issues (null) the ticket. -
getExpiryBase
Base instant for the approved-run timeout; falls back togetDecidedAt(). -
setExpiryBase
-
getInvalidationReason
-
getQueueCancelledAt
D-72b (7): when the queue item of the approved run was cancelled, ornull. The request stays APPROVED until the approved-run timeout ends it; it is never submitted again. -
setQueueCancelledAt
Only the policy service records the cancellation of the approved run's queue item. -
setInvalidationReason
-