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

public abstract class AbstractUserCauseRestriction extends JobRestriction
Abstract class, which defines the logic of UserCause-based restrictions.
Since:
0.4
Author:
Christopher Suarez, Oleg Nenashev
See Also:
  • Constructor Details

    • AbstractUserCauseRestriction

      public AbstractUserCauseRestriction(boolean checkUpstreamProjects)
  • Method Details

    • isCheckUpstreamProjects

      public final boolean isCheckUpstreamProjects()
    • acceptsUser

      protected abstract boolean acceptsUser(@CheckForNull String userId)
      Check if the method accepts the specified user. The user will be automatically extracted by the logic in AbstractUserCauseRestriction.
      Parameters:
      userId - User id
      Returns:
      true if the restriction accepts the user
    • canTake

      public boolean canTake(Queue.BuildableItem item)
      Description copied from class: JobRestriction
      Check if the Queue item can be taken. This method is being used to check if the Node 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 class JobRestriction
      Parameters:
      item - An item to be checked
      Returns:
      true if the node can take the item
    • canTake

      public boolean canTake(Run run)
      Description copied from class: JobRestriction
      Check if the Job can be executed according to the specified Run. If the job cannot be executed, it will be aborted by the plugin.
      Specified by:
      canTake in class JobRestriction
      Parameters:
      run - A Run to be checked
      Returns:
      true if the build can be executed