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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringgetActivatedBy()of a job created while run control was off (D-45); seeUPGRADE.static final StringgetActivatedBy()of a job that existed when the plugin version was first installed. -
Method Summary
Modifier and TypeMethodDescriptionstatic ActivationStateAn activated state, granted bybythroughrequestId(nullfor the upgrade seeding).static ActivationStateAsactivated(String, String, Instant, String), bound to the item's directory marker.The same state under another full name (rename or move keeps the activation).The approver who activated the job, orUPGRADE;nullif it never was.The approver of the hold, ornullif the job is not on hold.The directory marker this state is bound to, ornull(S-13-09).The request that set this state last, ornullfor the upgrade seeding.static ActivationStateA never-activated job put on hold (a HOLD approved for a job without a stored state).This state put on hold bybythroughrequestId: not activated, keeping who activated it last for the record.booleanstatic ActivationStatenotActivated(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.
-
Field Details
-
UPGRADE
getActivatedBy()of a job that existed when the plugin version was first installed. Parenthesised so it can never be taken for a user id (security-13 S-13-10).- See Also:
-
UNCONTROLLED
getActivatedBy()of a job created while run control was off (D-45); seeUPGRADE.- See Also:
-
-
Method Details
-
activated
public static ActivationState activated(String jobFullName, String by, Instant at, String requestId) An activated state, granted bybythroughrequestId(nullfor the upgrade seeding). -
activated
public static ActivationState activated(String jobFullName, String by, Instant at, String requestId, String itemIdentity) Asactivated(String, String, Instant, String), bound to the item's directory marker. -
heldBy
This state put on hold bybythroughrequestId: not activated, keeping who activated it last for the record. -
held
A never-activated job put on hold (a HOLD approved for a job without a stored state). -
notActivated
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
The same state under another full name (rename or move keeps the activation). -
getJobFullName
-
isActivated
public boolean isActivated() -
getActivatedBy
The approver who activated the job, orUPGRADE;nullif it never was. -
getActivatedAt
-
getRequestId
The request that set this state last, ornullfor the upgrade seeding. -
getDeactivatedBy
The approver of the hold, ornullif the job is not on hold. -
getDeactivatedAt
-
getItemIdentity
The directory marker this state is bound to, ornull(S-13-09).
-