提交 0bc16b22 编写于 作者: K kohsuke

health report is now a part of the remote API


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6646 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f12de760
package hudson.model;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
......@@ -11,6 +14,7 @@ import java.util.List;
* @author connollys
* @since 1.115
*/
@ExportedBean(defaultVisibility=2) // this is always exported as a part of Job and never on its own, so start with 2.
public class HealthReport implements Serializable, Comparable<HealthReport> {
private static final String HEALTH_OVER_80 = "health-80plus.gif";
private static final String HEALTH_60_TO_79 = "health-60to79.gif";
......@@ -91,6 +95,7 @@ public class HealthReport implements Serializable, Comparable<HealthReport> {
*
* @return The percentage health score (from 0 to 100 inclusive).
*/
@Exported
public int getScore() {
return score;
}
......@@ -142,6 +147,7 @@ public class HealthReport implements Serializable, Comparable<HealthReport> {
*
* @return Value for property 'description'.
*/
@Exported
public String getDescription() {
return description;
}
......
......@@ -575,6 +575,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
return reports.isEmpty() ? new HealthReport() : reports.get(0);
}
@Exported(name="healthReport")
public List<HealthReport> getBuildHealthReports() {
List<HealthReport> reports = new ArrayList<HealthReport>();
RunT lastBuild = getLastBuild();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册