com.progress.hudson.FailedBuildsQueue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of schedule-failed-builds Show documentation
Show all versions of schedule-failed-builds Show documentation
This plugin allows you to trigger a build N minutes after a build failed.
The newest version!
package com.progress.hudson;
import java.util.HashMap;
import hudson.model.AbstractBuild;
import hudson.model.BuildableItem;
/**
* Helper class to keep track of failed builds
*
* @author Stefan Fritz
*
*/
public class FailedBuildsQueue {
private static HashMap items=null;
public static boolean needsBuild(BuildableItem job) {
if(items!=null){
String fullName=job.getFullName();
if( items.containsKey(fullName)){
BuildItem item = items.get(fullName);
return item.readyForBuild();
}
}
return false;
}
public synchronized static void add(AbstractBuild build, String interval, String maxRetries) {
if(items==null){
items= new HashMap();
}
String fullName=build.getParent().getFullName();
if(!items.containsKey(fullName)){
items.put(fullName, new BuildItem( build.getParent(),Integer.parseInt(interval), Integer.parseInt(maxRetries)));
}
}
public synchronized static void remove(AbstractBuild build) {
if(items!=null){
String fullName=build.getParent().getFullName();
if( items.containsKey(fullName)){
items.remove(fullName);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy