Class JobRestriction
java.lang.Object
com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestriction
- All Implemented Interfaces:
ExtensionPoint
,Describable<JobRestriction>
,Serializable
- Direct Known Subclasses:
AbstractUserCauseRestriction
,AndJobRestriction
,AnyJobRestriction
,JobClassNameRestriction
,MultipleAndJobRestriction
,MultipleOrJobRestriction
,NotJobRestriction
,OrJobRestriction
,RegexNameRestriction
public abstract class JobRestriction
extends Object
implements ExtensionPoint, Describable<JobRestriction>, Serializable
The extension point, which allows to restrict job executions.
- Author:
- Oleg Nenashev
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionall()
Get list of all registeredJobRestriction
s.static List<JobRestrictionDescriptor>
Returns list ofJobRestrictionDescriptor
s.abstract boolean
canTake
(Queue.BuildableItem item) Check if theQueue
item can be taken.abstract boolean
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
JobRestriction
public JobRestriction()
-
-
Method Details
-
canTake
Check if theQueue
item can be taken. This method is being used to check if theNode
can take the specified job. If the job cannot be taken, Jenkins will try to launch the job on other nodes.- Parameters:
item
- An item to be checked- Returns:
- true if the node can take the item
-
canTake
Check if theJob
can be executed according to the specifiedRun
. If the job cannot be executed, it will be aborted by the plugin.- Parameters:
run
- ARun
to be checked- Returns:
- true if the build can be executed
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<JobRestriction>
-
all
Get list of all registeredJobRestriction
s.- Returns:
- List of
JobRestriction
s.
-
allDescriptors
Returns list ofJobRestrictionDescriptor
s.- Returns:
- List of available descriptors.
- Since:
- 0.2
-