org.jenkinsci.plugins.buildaliassetter
Class AliasProvider

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<AliasProvider>
      extended by org.jenkinsci.plugins.buildaliassetter.AliasProvider
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<AliasProvider>
Direct Known Subclasses:
TokenMacroAliasProvider

public abstract class AliasProvider
extends hudson.model.AbstractDescribableImpl<AliasProvider>
implements hudson.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
static class AliasProvider.Descriptor
           
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
AliasProvider()
           
 
Method Summary
abstract  List<String> names(hudson.model.AbstractBuild<?,?> build, hudson.model.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 hudson.util.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasProvider

public AliasProvider()
Method Detail

names

public abstract List<String> names(hudson.model.AbstractBuild<?,?> build,
                                   hudson.model.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 hudson.util.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.


Copyright © 2004-2013. All Rights Reserved.