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).

  • 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 the BatchClock time.
    • getId

      public String getId()
    • getJobFullName

      public String getJobFullName()
    • getAction

      public ActivationRequest.Action getAction()
    • getReason

      public String getReason()
    • getRequester

      public String getRequester()
    • getApprovers

      public List<String> getApprovers()
      The designated approver set (D-37), in designation order.
    • isDesignatedApprover

      public boolean isDesignatedApprover(String userId)
      Whether userId is a member of the designated set.
    • getDecidedBy

      public String getDecidedBy()
      The user who closed the request: the approver who approved or rejected it, or the user who cancelled it (e2e-03 DEF-13); null while undecided.
    • isSelfApproved

      public boolean isSelfApproved()
      Whether the deciding approver was the requester (administrator self-approval, SPEC item 2).
    • getApproverChanges

      public List<ActivationRequest.ApproverChange> getApproverChanges()
    • isExpiringNotified

      public boolean isExpiringNotified()
    • getStatus

      public RequestStatus getStatus()
    • getCreatedAt

      public Instant getCreatedAt()
    • getDecidedAt

      public Instant getDecidedAt()
    • getDecisionComment

      public String getDecisionComment()
    • setStatus

      public void setStatus(RequestStatus status)
      Only the policy service may transition the status.
    • setDecidedAt

      public void setDecidedAt(Instant decidedAt)
    • setDecisionComment

      public void setDecisionComment(String decisionComment)
    • setApprovers

      public void setApprovers(List<String> approvers)
      Only the policy service changes the designated set.
    • setDecidedBy

      public void setDecidedBy(String decidedBy)
      Only the policy service records the deciding approver.
    • setSelfApproved

      public void setSelfApproved(boolean selfApproved)
    • addApproverChange

      public void addApproverChange(ActivationRequest.ApproverChange change)
      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.