Пример #1
0
 /**
  * Returns the {@link Promotion} object that represents the successful promotion.
  *
  * @return null if the promotion has never been successful, or if it was but the record is already
  *     lost.
  */
 public Promotion getSuccessfulPromotion(JobPropertyImpl jp) {
   if (promotion >= 0) {
     PromotionProcess p = jp.getItem(name);
     if (p != null) return p.getBuildByNumber(promotion);
   }
   return null;
 }
Пример #2
0
 /** Gets the last successful {@link Promotion}. */
 public Promotion getLastFailed() {
   PromotionProcess p = getProcess();
   for (Integer n : Iterators.reverse(promotionAttempts)) {
     Promotion b = p.getBuildByNumber(n);
     if (b != null && b.getResult() != Result.SUCCESS) return b;
   }
   return null;
 }
Пример #3
0
 /** Gets all the promotion builds. */
 public List<Promotion> getPromotionBuilds() {
   PromotionProcess p = getProcess();
   List<Promotion> builds = new ArrayList<Promotion>();
   for (Integer n : Iterators.reverse(promotionAttempts)) {
     Promotion b = p.getBuildByNumber(n);
     if (b != null) {
       builds.add(b);
     }
   }
   return builds;
 }