Class LockableResourcesStruct
java.lang.Object
org.jenkins.plugins.lockableresources.queue.LockableResourcesStruct
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionlong -
Constructor Summary
ConstructorsConstructorDescriptionLockableResourcesStruct(List<String> resources) Light-weight constructor for declaring a resource only.LockableResourcesStruct(List<String> resources, String label, int quantity) LockableResourcesStruct(List<String> resources, String label, int quantity, String variable) LockableResourcesStruct(RequiredResourcesProperty property, EnvVars env) -
Method Summary
Modifier and TypeMethodDescriptionstatic LockableResourcesStructforCandidates(List<String> candidates, int quantity) Creates a request forquantityresources picked fromcandidates, in list order.Gets the resource names to pick from.getGroup()org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScriptGets a system Groovy script to be executed in order to determine if theLockableResourcematches the condition.booleanbooleanisResourceRequired(LockableResource resource) Check if the *resource* is required by this struct / queuevoidvoidsetGroupOnly(boolean groupOnly) toString()
-
Field Details
-
required
-
label
-
requiredVar
-
requiredNumber
-
queuedAt
public long queuedAt
-
-
Constructor Details
-
LockableResourcesStruct
-
LockableResourcesStruct
Light-weight constructor for declaring a resource only.- Parameters:
resources- Resources to be required
-
LockableResourcesStruct
-
LockableResourcesStruct
-
-
Method Details
-
isGroupOnly
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isGroupOnly()- Since:
- TODO
-
setGroupOnly
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void setGroupOnly(boolean groupOnly) - Since:
- TODO
-
getGroup
- Since:
- TODO
-
setGroup
- Since:
- TODO
-
forCandidates
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static LockableResourcesStruct forCandidates(List<String> candidates, int quantity) Creates a request forquantityresources picked fromcandidates, in list order. The names are stored, not the resources, so the list is checked again each time the queue is processed.- Parameters:
candidates- Resource names to pick from.quantity- Number of resources to lock, greater than 0.
-
getResourceMatchScript
@CheckForNull public org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript getResourceMatchScript() throws Descriptor.FormExceptionGets a system Groovy script to be executed in order to determine if theLockableResourcematches the condition.- Returns:
- System Groovy Script if defined
- Throws:
Descriptor.FormException- Since:
- 2.1
- See Also:
-
getResourceMatchScriptText
-
getCandidates
@CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<String> getCandidates()Gets the resource names to pick from.- Returns:
- the candidate names in list order, or
nullif this request does not use candidates
-
toString
-
isResourceRequired
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isResourceRequired(LockableResource resource) Check if the *resource* is required by this struct / queue
-