Class 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
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the display name for this selector.Run<?, ?> getNextBuild(Job<?, ?> job, RunSelectorContext context) Override this method to implementRunSelector.Run<?, ?> select(Job<?, ?> job, RunSelectorContext context) Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
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, InterruptedExceptionOverride this method to implementRunSelector. UseRunSelectorContext.getLastMatchBuild()to continue enumerating builds. Or you can save the execution state withRunSelectorContext.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
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.
-