Class AbstractUserCauseRestriction
java.lang.Object
com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestriction
com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.job.AbstractUserCauseRestriction
- All Implemented Interfaces:
ExtensionPoint
,Describable<JobRestriction>
,Serializable
- Direct Known Subclasses:
StartedByMemberOfGroupRestriction
,StartedByUserRestriction
Abstract class, which defines the logic of UserCause-based restrictions.
- Since:
- 0.4
- Author:
- Christopher Suarez, Oleg Nenashev
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestriction
DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
acceptsUser
(String userId) Check if the method accepts the specified user.boolean
canTake
(Queue.BuildableItem item) Check if theQueue
item can be taken.boolean
final boolean
Methods inherited from class com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestriction
all, allDescriptors, getDescriptor
-
Constructor Details
-
AbstractUserCauseRestriction
public AbstractUserCauseRestriction(boolean checkUpstreamProjects)
-
-
Method Details
-
isCheckUpstreamProjects
public final boolean isCheckUpstreamProjects() -
acceptsUser
Check if the method accepts the specified user. The user will be automatically extracted by the logic inAbstractUserCauseRestriction
.- Parameters:
userId
- User id- Returns:
- true if the restriction accepts the user
-
canTake
Description copied from class:JobRestriction
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.- Specified by:
canTake
in classJobRestriction
- Parameters:
item
- An item to be checked- Returns:
- true if the node can take the item
-
canTake
Description copied from class:JobRestriction
Check if theJob
can be executed according to the specifiedRun
. If the job cannot be executed, it will be aborted by the plugin.- Specified by:
canTake
in classJobRestriction
- Parameters:
run
- ARun
to be checked- Returns:
- true if the build can be executed
-