Class QueuedContextStruct
java.lang.Object
org.jenkins.plugins.lockableresources.queue.QueuedContextStruct
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority) QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority, String reason, long timeoutForAllocateResource, String timeoutUnit) QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority, String reason, long timeoutForAllocateResource, String timeoutUnit, String shareId) QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority, String reason, long timeoutForAllocateResource, String timeoutUnit, String shareId, long onReleaseDelay, long onCancelDelay) -
Method Summary
Modifier and TypeMethodDescriptionintcompare(QueuedContextStruct other) Run<?, ?> getBuild()Return build, where is the resource used.org.jenkinsci.plugins.workflow.steps.StepContextgetId()longSeconds the resources stay locked after the build is aborted.longSeconds the resources stay locked after the lock block ends normally or fails.intShare id of the waiting lock block, ornullwhen it does not share.longReturns the pre-computed deadline (epoch millis) when this entry times out.longReturns the configured timeout for resource allocation.Returns the time unit for the allocation timeout.booleanChecks whether this queued context has exceeded its allocation timeout.booleanisValid()toString()
-
Field Details
-
candidates
-
-
Constructor Details
-
QueuedContextStruct
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority) -
QueuedContextStruct
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority, String reason, long timeoutForAllocateResource, String timeoutUnit) -
QueuedContextStruct
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority, String reason, long timeoutForAllocateResource, String timeoutUnit, @CheckForNull String shareId) -
QueuedContextStruct
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public QueuedContextStruct(org.jenkinsci.plugins.workflow.steps.StepContext context, List<LockableResourcesStruct> lockableResourcesStruct, String resourceDescription, String variableName, int priority, String reason, long timeoutForAllocateResource, String timeoutUnit, @CheckForNull String shareId, long onReleaseDelay, long onCancelDelay)
-
-
Method Details
-
compare
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public int compare(QueuedContextStruct other) -
getPriority
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public int getPriority() -
getId
-
getContext
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.jenkinsci.plugins.workflow.steps.StepContext getContext() -
getBuild
@CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Run<?,?> getBuild()Return build, where is the resource used. -
isValid
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isValid() -
getResources
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<LockableResourcesStruct> getResources() -
getResourceDescription
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getResourceDescription() -
getVariableName
-
isTimedOut
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isTimedOut()Checks whether this queued context has exceeded its allocation timeout. Uses a pre-computed deadline for performance since this is called on every queue check.- Returns:
- true if a timeout was set and has expired, false otherwise
-
getTimeoutDeadlineMillis
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public long getTimeoutDeadlineMillis()Returns the pre-computed deadline (epoch millis) when this entry times out. 0 means no timeout is configured. -
getTimeoutForAllocateResource
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public long getTimeoutForAllocateResource()Returns the configured timeout for resource allocation. -
getTimeoutUnit
Returns the time unit for the allocation timeout. -
getOnReleaseDelay
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public long getOnReleaseDelay()Seconds the resources stay locked after the lock block ends normally or fails. -
getOnCancelDelay
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public long getOnCancelDelay()Seconds the resources stay locked after the build is aborted. -
getReason
-
toString
-
getLogger
-