Class ActivationState

java.lang.Object
io.jenkins.plugins.batchcontrol.model.ActivationState

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class ActivationState extends Object
Whether a job has been approved to run unattended (SPEC item 6a, D-39). Stored by the plugin at activations/<PathCodec-encoded job full name>.xml, outside the job's configuration, so no configuration write path can change it. Only policy.ActivationService writes it: on an approved ACTIVATE or HOLD request, once at upgrade (UPGRADE), and when a job is created while run control is off (UNCONTROLLED, D-45).

The job full name is stored inside the file as well, because a shortened encoded file name cannot be decoded back (store/PathCodec).

  • Field Details

  • Method Details

    • activated

      public static ActivationState activated(String jobFullName, String by, Instant at, String requestId)
      An activated state, granted by by through requestId (null for the upgrade seeding).
    • activated

      public static ActivationState activated(String jobFullName, String by, Instant at, String requestId, String itemIdentity)
      As activated(String, String, Instant, String), bound to the item's directory marker.
    • heldBy

      public ActivationState heldBy(String by, Instant at, String holdRequestId)
      This state put on hold by by through requestId: not activated, keeping who activated it last for the record.
    • held

      public static ActivationState held(String jobFullName, String by, Instant at, String holdRequestId)
      A never-activated job put on hold (a HOLD approved for a job without a stored state).
    • notActivated

      public static ActivationState notActivated(String jobFullName, String itemIdentity)
      An explicit "not activated" state (security-13 S-13-06): written when an item is created under run control, and when a state file could not be deleted (S-13-05), so a later seeding or a stale file can never make the item activated.
    • copyFor

      public ActivationState copyFor(String newFullName)
      The same state under another full name (rename or move keeps the activation).
    • getJobFullName

      public String getJobFullName()
    • isActivated

      public boolean isActivated()
    • getActivatedBy

      public String getActivatedBy()
      The approver who activated the job, or UPGRADE; null if it never was.
    • getActivatedAt

      public Instant getActivatedAt()
    • getRequestId

      public String getRequestId()
      The request that set this state last, or null for the upgrade seeding.
    • getDeactivatedBy

      public String getDeactivatedBy()
      The approver of the hold, or null if the job is not on hold.
    • getDeactivatedAt

      public Instant getDeactivatedAt()
    • getItemIdentity

      public String getItemIdentity()
      The directory marker this state is bound to, or null (S-13-09).