Package hudson.plugins.promoted_builds
Class PromotedBuildAction
- java.lang.Object
-
- hudson.plugins.promoted_builds.PromotedBuildAction
-
- All Implemented Interfaces:
Action
,BuildBadgeAction
,ModelObject
@ExportedBean public final class PromotedBuildAction extends Object implements BuildBadgeAction
Action
forAbstractBuild
indicating that it's promoted.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description AbstractBuild<?,?>
owner
-
Constructor Summary
Constructors Constructor Description PromotedBuildAction(AbstractBuild<?,?> owner)
PromotedBuildAction(AbstractBuild<?,?> owner, Status firstStatus)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
add(Status status)
Called when the build is qualified.boolean
canPromote()
Deprecated.For internal code usecanPromote(String)
with the name of the process that will be promoted instead.boolean
canPromote(String processName)
boolean
contains(PromotionProcess process)
Checks if the given criterion is already promoted.boolean
contains(String name)
Checks if the given criterion is already promoted.org.kohsuke.stapler.HttpResponse
doForcePromotion(String name)
Force a promotion.String
getDisplayName()
Status
getDynamic(String name, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
BindsStatus
to URL hierarchy by its name.String
getIconFileName()
AbstractBuild<?,?>
getOwner()
Gets the owning build.List<PromotionProcess>
getPendingPromotions()
Gets list ofPromotionProcess
s that are not yet attained.AbstractProject<?,?>
getProject()
Gets the owning project.Status
getPromotion(String name)
Finds theStatus
that has matchingStatus.name
value.List<Promotion>
getPromotionBuilds(PromotionProcess promotionProcess)
Gets the read-only view of all the promotion builds that this build achieved for a PromotionProcess.PromotionProcess
getPromotionProcess(String name)
Get the specified promotion process by name.List<Status>
getPromotions()
Gets the read-only view of all the promotions that this build achieved.String
getUrlName()
boolean
hasPromotion()
-
-
-
Field Detail
-
owner
public final AbstractBuild<?,?> owner
-
-
Constructor Detail
-
PromotedBuildAction
public PromotedBuildAction(AbstractBuild<?,?> owner)
-
PromotedBuildAction
public PromotedBuildAction(AbstractBuild<?,?> owner, Status firstStatus)
-
-
Method Detail
-
getOwner
public AbstractBuild<?,?> getOwner()
Gets the owning build.
-
getProject
public AbstractProject<?,?> getProject()
Gets the owning project.
-
contains
public boolean contains(PromotionProcess process)
Checks if the given criterion is already promoted.
-
contains
public boolean contains(String name)
Checks if the given criterion is already promoted.
-
add
public boolean add(Status status) throws IOException
Called when the build is qualified.- Throws:
IOException
-
getPromotions
@Exported public List<Status> getPromotions()
Gets the read-only view of all the promotions that this build achieved.
-
getPromotionBuilds
public List<Promotion> getPromotionBuilds(PromotionProcess promotionProcess)
Gets the read-only view of all the promotion builds that this build achieved for a PromotionProcess.
-
hasPromotion
public boolean hasPromotion()
-
canPromote
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("3.0") public boolean canPromote()
Deprecated.For internal code usecanPromote(String)
with the name of the process that will be promoted instead.
-
canPromote
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean canPromote(String processName)
-
getPendingPromotions
public List<PromotionProcess> getPendingPromotions()
Gets list ofPromotionProcess
s that are not yet attained.- Returns:
- can be empty but never null.
-
getPromotionProcess
@CheckForNull public PromotionProcess getPromotionProcess(String name)
Get the specified promotion process by name.- Returns:
- The discovered process of
null
if the promotion cannot be found
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
getDynamic
public Status getDynamic(String name, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
BindsStatus
to URL hierarchy by its name.
-
doForcePromotion
public org.kohsuke.stapler.HttpResponse doForcePromotion(@QueryParameter("name") String name) throws IOException
Force a promotion.- Throws:
IOException
-
-