Class ActivationItem

java.lang.Object
io.jenkins.plugins.batchcontrol.action.ActivationItem
All Implemented Interfaces:
ModelObject

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class ActivationItem extends Object implements ModelObject
One activation or hold request at /batch-control/activations/<id>/ (SPEC item 6a), the URL the notifications link to: detail view plus the state-changing POST endpoints approve, reject, cancel and changeApprover, following RequestItem.

Every endpoint is @RequirePOST with its permission check on the next line; the business rules (designated approver only, self-approval, requester-or-Manage cancel, requester-only approver change, atomic transitions) are enforced by ActivationService.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doApprove(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String comment)
    POST approve with an optional comment.
    void
    doCancel(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp)
    POST cancel; Request on the request's item (D-38b) or Manage, and the service enforces requester-or-Manage.
    void
    doChangeApprover(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp)
    POST changeApprover with the repeated approvers field (D-26, D-37).
    void
    doReject(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String comment)
    POST reject with a comment (the service refuses an empty one).
    format(Instant instant)
    Jelly helper: human-readable timestamp.
    The refusal of form form on this request, or an empty one (DEF-09, Jelly).
    S-13-08: ACTIVATE and HOLD worded so they cannot be mistaken for each other.
    Approver candidates for the change-approver form (global list ∩ job restriction).
     
     
    Root-relative URL of the job or computed folder (D-46c) when the viewer may read it, else null (plain text).
     
    Permissions for this screen's l:layout (the same set its section gate checks).
    boolean
    View gating for the cancel link; the service enforces requester-or-Manage.
    boolean
    View gating for the change-approver form; the service enforces requester-only.
    boolean
    View gating for the decision forms: a designated approver holding Approve (D-29, D-37).
    boolean
    isDesignated(String approver)
    Whether the change-approver picker starts with this candidate checked.
    boolean
    Whether the request asks to put the job on hold (the view words the decision accordingly).
    boolean
     
    join(List<String> approvers)
    Jelly helper: an approver set for display (a1, a2).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getRequest

      public ActivationRequest getRequest()
    • getId

      public String getId()
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
    • getActionLabel

      public String getActionLabel()
      S-13-08: ACTIVATE and HOLD worded so they cannot be mistaken for each other.
    • getViewPermissions

      public Permission[] getViewPermissions()
      Permissions for this screen's l:layout (the same set its section gate checks).
    • format

      public String format(@CheckForNull Instant instant)
      Jelly helper: human-readable timestamp.
    • join

      public String join(@CheckForNull List<String> approvers)
      Jelly helper: an approver set for display (a1, a2).
    • getJobUrl

      @CheckForNull public String getJobUrl()
      Root-relative URL of the job or computed folder (D-46c) when the viewer may read it, else null (plain text).
    • isPending

      public boolean isPending()
    • isHold

      public boolean isHold()
      Whether the request asks to put the job on hold (the view words the decision accordingly).
    • isCanDecide

      public boolean isCanDecide()
      View gating for the decision forms: a designated approver holding Approve (D-29, D-37).
    • isCanCancel

      public boolean isCanCancel()
      View gating for the cancel link; the service enforces requester-or-Manage.
    • isCanChangeApprover

      public boolean isCanChangeApprover()
      View gating for the change-approver form; the service enforces requester-only.
    • getApproverOptions

      public List<String> getApproverOptions()
      Approver candidates for the change-approver form (global list ∩ job restriction).
    • isDesignated

      public boolean isDesignated(String approver)
      Whether the change-approver picker starts with this candidate checked.
    • doApprove

      public void doApprove(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String comment) throws IOException, jakarta.servlet.ServletException
      POST approve with an optional comment.
      Throws:
      IOException
      jakarta.servlet.ServletException
    • doReject

      public void doReject(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String comment) throws IOException, jakarta.servlet.ServletException
      POST reject with a comment (the service refuses an empty one).
      Throws:
      IOException
      jakarta.servlet.ServletException
    • doCancel

      public void doCancel(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException
      POST cancel; Request on the request's item (D-38b) or Manage, and the service enforces requester-or-Manage.
      Throws:
      IOException
      jakarta.servlet.ServletException
    • doChangeApprover

      public void doChangeApprover(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException
      POST changeApprover with the repeated approvers field (D-26, D-37).
      Throws:
      IOException
      jakarta.servlet.ServletException
    • formErrors

      public FormErrors formErrors(String form)
      The refusal of form form on this request, or an empty one (DEF-09, Jelly).