@ExportedBean(defaultVisibility=999) public class LockableResource extends AbstractDescribableImpl<LockableResource> implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
LockableResource.DescriptorImpl |
| Modifier and Type | Field and Description |
|---|---|
static String |
GROOVY_LABEL_MARKER |
static int |
NOT_QUEUED |
| Constructor and Description |
|---|
LockableResource(String name) |
LockableResource(String name,
String description,
String labels,
String reservedBy)
Deprecated.
Use single-argument constructor instead (since 1.8)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Run<?,?> |
getBuild() |
String |
getBuildName() |
String |
getDescription() |
String |
getLabels() |
String |
getLockCause()
Resolve the lock cause for this resource.
|
String |
getName() |
List<org.jenkinsci.plugins.workflow.steps.StepContext> |
getQueuedContexts()
Deprecated.
Replaced with LockableResourcesManager.queuedContexts (since 1.11)
|
long |
getQueueItemId() |
String |
getQueueItemProject() |
String |
getReservedBy() |
String |
getReservedByEmail() |
Queue.Task |
getTask() |
int |
hashCode() |
boolean |
isEphemeral() |
boolean |
isLocked() |
boolean |
isQueued() |
boolean |
isQueued(long taskId) |
boolean |
isQueuedByTask(long taskId) |
boolean |
isReserved() |
boolean |
isValidLabel(String candidate,
Map<String,Object> params) |
protected Object |
readResolve() |
void |
reset() |
boolean |
scriptMatches(org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript script,
Map<String,Object> params)
Checks if the script matches the requirement.
|
void |
setBuild(Run<?,?> lockedBy) |
void |
setDescription(String description) |
void |
setEphemeral(boolean ephemeral) |
void |
setLabels(String labels) |
void |
setQueued(long queueItemId) |
void |
setQueued(long queueItemId,
String queueProjectName) |
void |
setReservedBy(String userName) |
String |
toString() |
void |
unqueue() |
void |
unReserve() |
getDescriptorpublic static final int NOT_QUEUED
public static final String GROOVY_LABEL_MARKER
@Deprecated public LockableResource(String name, String description, String labels, String reservedBy)
@DataBoundConstructor public LockableResource(String name)
protected Object readResolve()
@Deprecated public List<org.jenkinsci.plugins.workflow.steps.StepContext> getQueuedContexts()
@DataBoundSetter public void setDescription(String description)
@DataBoundSetter public void setLabels(String labels)
@Exported public String getName()
@Exported public String getDescription()
@Exported public String getLabels()
@DataBoundSetter public void setEphemeral(boolean ephemeral)
@Exported public boolean isEphemeral()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class)
public boolean scriptMatches(@NonNull
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript script,
@CheckForNull
Map<String,Object> params)
throws ExecutionException
script - Script to be executedparams - Extra script parameterstrue if the script returns true (resource matches).ExecutionException - Script execution failed (e.g. due to the missing permissions).
Carries info in the cause@Exported public String getReservedBy()
@Exported public boolean isReserved()
@Exported public String getReservedByEmail()
public boolean isQueued()
public boolean isQueued(long taskId)
public boolean isQueuedByTask(long taskId)
public void unqueue()
@Exported public boolean isLocked()
@CheckForNull public String getLockCause()
@WithBridgeMethods(value=hudson.model.AbstractBuild.class, adapterMethod="getAbstractBuild") public Run<?,?> getBuild()
@Exported public String getBuildName()
public void setBuild(Run<?,?> lockedBy)
public Queue.Task getTask()
public long getQueueItemId()
public String getQueueItemProject()
public void setQueued(long queueItemId)
public void setQueued(long queueItemId,
String queueProjectName)
@DataBoundSetter public void setReservedBy(String userName)
public void unReserve()
public void reset()
Copyright © 2013–2021. All rights reserved.