Class AliasProvider
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<AliasProvider>
-
- org.jenkinsci.plugins.buildaliassetter.AliasProvider
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<AliasProvider>
- Direct Known Subclasses:
TokenMacroAliasProvider
public abstract class AliasProvider extends AbstractDescribableImpl<AliasProvider> implements ExtensionPoint
Provide custom aliases to be attached to the build. This extension point allows plugin to create new sources of build aliases.- Author:
- ogondza
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AliasProvider.Descriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description AliasProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract List<String>
names(AbstractBuild<?,?> build, BuildListener listener)
Get build aliases to be attached to the build Aliases not conforming to the BuildAliasSetter#validateAlias(String) are not going to be attached and an error will be reported.static FormValidation
validateAlias(String aliasCandidate)
Validate custom alias Aliases that does not conform to this contract will not be attached to the build.-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
names
public abstract List<String> names(AbstractBuild<?,?> build, BuildListener listener) throws IOException, InterruptedException
Get build aliases to be attached to the build Aliases not conforming to the BuildAliasSetter#validateAlias(String) are not going to be attached and an error will be reported.- Returns:
- A list of aliases. Possibly empty, never null.
- Throws:
IOException
InterruptedException
- See Also:
validateAlias(String)
-
validateAlias
public static FormValidation validateAlias(String aliasCandidate)
Validate custom alias Aliases that does not conform to this contract will not be attached to the build.AliasProvider
implementations might use this method from their doCheckXXX methods to provide early feedback. This implementation ensures that an alias can not possibly collide with the build number (it must not be an integer) and buildin permalink ("lastBuild", "lastSuccessfulBuild", etc.).- Returns:
- null if valid,
FormValidation
describing the cause otherwise.
-
-