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 for AbstractBuild indicating that it's promoted.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • PromotedBuildAction

      public PromotedBuildAction(AbstractBuild<?,?> owner)
    • PromotedBuildAction

      public PromotedBuildAction(AbstractBuild<?,?> owner, Status firstStatus)
  • Method Details

    • 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.
    • getPromotion

      @CheckForNull public Status getPromotion(String name)
      Finds the Status that has matching Status.name value. Or null if not found.
    • hasPromotion

      public boolean hasPromotion()
    • canPromote

      @Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("3.0") public boolean canPromote()
      Deprecated.
      For internal code use canPromote(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 of PromotionProcesss 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 interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getDynamic

      public Status getDynamic(String name, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
      Binds Status to URL hierarchy by its name.
    • doForcePromotion

      public org.kohsuke.stapler.HttpResponse doForcePromotion(@QueryParameter("name") String name) throws IOException
      Force a promotion.
      Throws:
      IOException