Class RunSelector

java.lang.Object
hudson.model.AbstractDescribableImpl<RunSelector>
org.jenkinsci.plugins.runselector.RunSelector
All Implemented Interfaces:
ExtensionPoint, Describable<RunSelector>
Direct Known Subclasses:
AbstractSpecificRunSelector, FallbackRunSelector, ParameterizedRunSelector, StatusRunSelector, TriggeringRunSelector

public abstract class RunSelector extends AbstractDescribableImpl<RunSelector> implements ExtensionPoint
Extension point for enumerating builds to copy artifacts from. Subclasses should override getNextBuild(Job, RunSelectorContext). use RunSelectorDescriptor for its descriptor.
Author:
Alan Harder
  • Constructor Details

    • RunSelector

      public RunSelector()
  • Method Details

    • select

      @CheckForNull public Run<?,?> select(@NonNull Job<?,?> job, @NonNull RunSelectorContext context) throws IOException, InterruptedException
      Parameters:
      job - the job to pick a build from.
      context - context for the current execution of runselector.
      Returns:
      the build matches this selectors and conditions stored in the context.
      Throws:
      IOException - if an error occurs while performing the operation.
      InterruptedException - if any thread interrupts the current thread.
    • getNextBuild

      @CheckForNull public Run<?,?> getNextBuild(@NonNull Job<?,?> job, @NonNull RunSelectorContext context) throws IOException, InterruptedException
      Override this method to implement RunSelector. Use RunSelectorContext.getLastMatchBuild() to continue enumerating builds. Or you can save the execution state with RunSelectorContext.addExtension(Object)
      Parameters:
      job - the job to pick a build from.
      context - context for the current execution of runselector.
      Returns:
      the build matches this selector.
      Throws:
      IOException - if an error occurs while performing the operation.
      InterruptedException - if any thread interrupts the current thread.
    • getDisplayName

      public String getDisplayName()
      Returns the display name for this selector. You can override this to output configurations of this selector in verbose logs.
      Returns:
      the display name for this selector.