hudson.plugins.promoted_builds
Class Status

java.lang.Object
  extended by hudson.plugins.promoted_builds.Status

public final class Status
extends java.lang.Object

Promotion status of a build wrt a specific PromotionProcess.

Author:
Kohsuke Kawaguchi
See Also:
PromotedBuildAction.statuses

Field Summary
 java.lang.String name
          Matches with AbstractItem.name.
 java.util.Calendar timestamp
          When did the build qualify for a promotion?
 
Constructor Summary
Status(PromotionProcess process, java.util.Collection<? extends PromotionBadge> badges)
           
 
Method Summary
 void doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Schedules a new build.
 java.util.List<PromotionBadge> getBadges()
          Gets the badges indicating how did a build qualify for a promotion.
 java.lang.String getDelayString(hudson.model.AbstractBuild<?,?> owner)
          Gets the string that says how long did it toook for this build to be promoted.
 Promotion getLastFailed()
          Gets the last successful Promotion.
 Promotion getLastSuccessful()
          Gets the last successful Promotion.
 java.lang.String getName()
           
 PromotedBuildAction getParent()
          Gets the parent Status that owns this object.
 PromotionProcess getProcess()
          Gets the PromotionProcess that this object deals with.
 java.util.List<Promotion> getPromotionBuilds()
          Gets all the promotion builds.
 Promotion getSuccessfulPromotion(JobPropertyImpl jp)
          Returns the Promotion object that represents the successful promotion.
 hudson.model.AbstractBuild<?,?> getTarget()
          Gets the build that was qualified for a promotion.
 java.lang.String getTimestampString()
          Gets the string that says how long since this promotion had happened.
 boolean isFor(PromotionProcess process)
           
 boolean isInQueue()
          Returns true if the promotion for this is pending in the queue, waiting to be executed.
 boolean isPromotionAttempted()
          Returns true if at least one Promotion activity is attempted.
 boolean isPromotionSuccessful()
          Returns true if the promotion was successfully completed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
Matches with AbstractItem.name.


timestamp

public final java.util.Calendar timestamp
When did the build qualify for a promotion?

Constructor Detail

Status

public Status(PromotionProcess process,
              java.util.Collection<? extends PromotionBadge> badges)
Method Detail

getName

public java.lang.String getName()

getParent

public PromotedBuildAction getParent()
Gets the parent Status that owns this object.


getProcess

public PromotionProcess getProcess()
Gets the PromotionProcess that this object deals with.


getTarget

public hudson.model.AbstractBuild<?,?> getTarget()
Gets the build that was qualified for a promotion.


getTimestampString

public java.lang.String getTimestampString()
Gets the string that says how long since this promotion had happened.

Returns:
string like "3 minutes" "1 day" etc.

getDelayString

public java.lang.String getDelayString(hudson.model.AbstractBuild<?,?> owner)
Gets the string that says how long did it toook for this build to be promoted.


isFor

public boolean isFor(PromotionProcess process)

getSuccessfulPromotion

public Promotion getSuccessfulPromotion(JobPropertyImpl jp)
Returns the Promotion object that represents the successful promotion.

Returns:
null if the promotion has never been successful, or if it was but the record is already lost.

isPromotionSuccessful

public boolean isPromotionSuccessful()
Returns true if the promotion was successfully completed.


isPromotionAttempted

public boolean isPromotionAttempted()
Returns true if at least one Promotion activity is attempted. False if none is executed yet (this includes the case where it's in the queue.)


isInQueue

public boolean isInQueue()
Returns true if the promotion for this is pending in the queue, waiting to be executed.


getBadges

public java.util.List<PromotionBadge> getBadges()
Gets the badges indicating how did a build qualify for a promotion.


getLastSuccessful

public Promotion getLastSuccessful()
Gets the last successful Promotion.


getLastFailed

public Promotion getLastFailed()
Gets the last successful Promotion.


getPromotionBuilds

public java.util.List<Promotion> getPromotionBuilds()
Gets all the promotion builds.


doBuild

public void doBuild(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException,
                    javax.servlet.ServletException
Schedules a new build.

Throws:
java.io.IOException
javax.servlet.ServletException


Copyright © 2010. All Rights Reserved.