java.lang.Object
com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestriction
com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.job.RegexNameRestriction
All Implemented Interfaces:
ExtensionPoint, Describable<JobRestriction>, Serializable

public class RegexNameRestriction extends JobRestriction
Restricts the jobs execution by applying regular expressions to their names.
Author:
Oleg Nenashev
See Also:
  • Constructor Details

    • RegexNameRestriction

      @DataBoundConstructor public RegexNameRestriction(String regexExpression, boolean checkShortName)
  • Method Details

    • getRegexExpression

      public String getRegexExpression()
    • isCheckShortName

      public boolean isCheckShortName()
    • 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
    • canTake

      public boolean canTake(String projectName)