gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r387028 [2/2] - in /gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation: ./ actions/ database/ database/controller/ database/hibernate/ valueObjects/
Date Sun, 19 Mar 2006 20:44:31 GMT
Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java Sun Mar 19 12:44:28 2006
@@ -2,28 +2,34 @@
 
 public class ProjectVersionIdHib {
 
-	private String id;
-	private ProjectHib project;
-	private BuildHib build;
-	
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public ProjectHib getProject() {
-		return project;
-	}
-	public void setProject(ProjectHib project) {
-		this.project = project;
-	}
-	public BuildHib getBuild() {
-		return build;
-	}
-	public void setBuild(BuildHib build) {
-		this.build = build;
-	}
-	
-	
+    private String id;
+
+    private ProjectHib project;
+
+    private BuildHib build;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public ProjectHib getProject() {
+        return project;
+    }
+
+    public void setProject(ProjectHib project) {
+        this.project = project;
+    }
+
+    public BuildHib getBuild() {
+        return build;
+    }
+
+    public void setBuild(BuildHib build) {
+        this.build = build;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java Sun Mar 19 12:44:28 2006
@@ -3,38 +3,45 @@
 import java.util.Set;
 
 public class ResultHib {
-	
-	private Integer id;
-	private String name;
-	private String description;
-	private Set builds;
-	
-	
-
-	public Set getBuilds() {
-		return builds;
-	}
-	public void setBuilds(Set builds) {
-		this.builds = builds;
-	}
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
 
-	
+    private Integer id;
+
+    private String name;
+
+    private String description;
+
+    private Set builds;
+
+    public Set getBuilds() {
+        return builds;
+    }
+
+    public void setBuilds(Set builds) {
+        this.builds = builds;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java Sun Mar 19 12:44:28 2006
@@ -1,42 +1,55 @@
 package org.apache.gump.dynagump.presentation.database.hibernate;
 
 public class RunsHib {
-	
-	private String id;
-	private String startTime;
-	private String endTime;
-	private WorkspaceHib workspaceId;
-	private String name;
-	
-	public String getEndTime() {
-		return endTime;
-	}
-	public void setEndTime(String endTime) {
-		this.endTime = endTime;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getStartTime() {
-		return startTime;
-	}
-	public void setStartTime(String startTime) {
-		this.startTime = startTime;
-	}
-	public WorkspaceHib getWorkspaceId() {
-		return workspaceId;
-	}
-	public void setWorkspaceId(WorkspaceHib workspaceId) {
-		this.workspaceId = workspaceId;
-	}
+
+    private String id;
+
+    private String startTime;
+
+    private String endTime;
+
+    private WorkspaceHib workspaceId;
+
+    private String name;
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public WorkspaceHib getWorkspaceId() {
+        return workspaceId;
+    }
+
+    public void setWorkspaceId(WorkspaceHib workspaceId) {
+        this.workspaceId = workspaceId;
+    }
 
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java Sun Mar 19 12:44:28 2006
@@ -2,35 +2,44 @@
 
 public class WorkspaceHib {
 
-	private String id;
-	private String name;
-	private String host;
-	private String description;
-	
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	public String getHost() {
-		return host;
-	}
-	public void setHost(String host) {
-		this.host = host;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-	
+    private String id;
+
+    private String name;
+
+    private String host;
+
+    private String description;
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Build.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Build.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Build.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Build.java Sun Mar 19 12:44:28 2006
@@ -8,188 +8,244 @@
 import java.util.LinkedList;
 import java.util.List;
 
-public class Build implements Serializable{
+public class Build implements Serializable {
+
+    private String id; // build Id
+
+    private String runId; // id of the run
+
+    private String projectVersionId; // Project version id
+
+    private String startTime; // Build started
+
+    private String endTime; // build ended
+
+    private int result; // result by values (0,1,2)
+
+    private String log; // log from the build
+
+    private String resultString; // the result represented by a string.
+
+    private String projectName; // The name of the project
+
+    private String projectId; // Database id for this project.
+
+    private String description; // Project description
+
+    private String module; // The module the project contains in.
+
+    private List<Build> dependees = new LinkedList<Build>(); // Reference to
+                                                                // other Build
+                                                                // object that
+                                                                // dependes on
+                                                                // this one by
+                                                                // builds.id.
+
+    private List<Build> depends = new LinkedList<Build>(); // Reference to
+                                                            // other builds the
+                                                            // this build
+                                                            // depends on.
+
+    private HistoryVO history;
+
+    public Build() {
+    }
+
+    public Build(String id, String runId, String projectVersionId, String startTime, String endTime, int result, String log, String resultString,
+            String projectName, String projectId, String projectDescription, String moduleName) {
+        this.id = id;
+        this.runId = runId;
+        this.projectVersionId = projectVersionId;
+        this.startTime = startTime;
+        this.endTime = endTime;
+        this.result = result;
+        this.log = log;
+        this.resultString = resultString;
+        this.projectName = projectName;
+        this.projectId = projectId;
+        this.description = projectDescription;
+        this.module = moduleName;
+    }
+
+    public Build(ResultSet rs) throws SQLException {
+        this.id = rs.getString("id");
+        this.runId = rs.getString("run_id");
+        this.projectVersionId = rs.getString("project_version_id");
+        this.startTime = rs.getString("start_time");
+        this.endTime = rs.getString("end_time");
+        this.result = rs.getInt("result");
+        this.log = rs.getString("log");
+        this.resultString = rs.getString("result_name");
+        this.projectName = rs.getString("name");
+        this.projectId = rs.getString("project_id");
+        this.description = rs.getString("description");
+        this.module = rs.getString("module_name");
+    }
+
+    /**
+     * Add a Build b as dependee to this object
+     * 
+     * @param b -
+     *            Build object
+     */
+    public void addDependees(Build b) {
+        this.dependees.add(b);
+        b.addDependant(this);
+    }
+
+    public void addDependant(Build b) {
+        this.depends.add(b);
+    }
+
+    public List<Build> getDependantList() {
+        return this.depends;
+    }
+
+    public List<Build> getDependeesList() {
+        return this.dependees;
+    }
+
+    /**
+     * Return the number of Builds that dependes direct or inderect on this
+     * build.
+     * 
+     * @return the number of dependees
+     */
+    public int getDependees() {
+
+        if (this.dependees == null || this.dependees.size() == 0) {
+            return 0;
+        } else {
+            HashMap map = new HashMap();
+            this.calculateDependencies(map);
+            int dependees = map.size();
+            return dependees;
+        }
+    }
+
+    /**
+     * Returns the number of direct dependent packages
+     * 
+     * @return
+     */
+    public int getDirectDependees() {
+        return dependees.size();
+    }
+
+    private void calculateDependencies(HashMap map) {
+        Iterator<Build> it = dependees.iterator();
+        Build tmp;
+        while (it.hasNext()) {
+            tmp = it.next();
+            map.put(tmp.getId(), 0);
+            tmp.calculateDependencies(map);
+        }
+    }
+
+    /** Getters and setters */
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getLog() {
+        return log;
+    }
+
+    public void setLog(String log) {
+        this.log = log;
+    }
+
+    public String getProjectVersionId() {
+        return projectVersionId;
+    }
+
+    public void setProjectVersionId(String projectVersionId) {
+        this.projectVersionId = projectVersionId;
+    }
+
+    public int getResult() {
+        return result;
+    }
+
+    public void setResult(int result) {
+        this.result = result;
+    }
+
+    public String getRunId() {
+        return runId;
+    }
+
+    public void setRunId(String runId) {
+        this.runId = runId;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getResultString() {
+        return resultString;
+    }
+
+    public void setResultString(String resultString) {
+        this.resultString = resultString;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getModule() {
+        return module;
+    }
+
+    public void setModule(String module) {
+        this.module = module;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public HistoryVO getHistory() {
+        if (history == null) {
+            System.out.println("history == null");
+        }
+        return history;
+    }
+
+    public void addHistory(HistoryVO h) {
+        System.out.println("history = " + h + "\n" + "startTime: " + h.getStartOfState());
+        this.history = h;
+    }
 
-	private String id;  //build Id
-	private String runId; //id of the run 
-	private String projectVersionId; //Project version id
-	private String startTime; //Build started
-	private String endTime; //build ended
-	private int result; 	//result by values (0,1,2)
-	private String log;		//log from the build
-	private String resultString; //the result represented by a string.
-	private String projectName; //The name of the project
-	private String projectId;	//Database id for this project.
-	private String description; //Project description
-	private String module; 		//The module the project contains in.
-	private List<Build> dependees = new LinkedList<Build>(); // Reference to other Build object that dependes on this one by builds.id.
-	private List<Build> depends = new LinkedList<Build>();   //Reference to other builds the this build depends on.
-	private HistoryVO history;
-	
-	
-	public Build(){}
-	public Build(String id,String runId,String projectVersionId,String startTime,
-			String endTime, int result, String log, String resultString, 
-			String projectName, String projectId, String projectDescription, String moduleName){
-		this.id = id;
-		this.runId = runId;
-		this.projectVersionId = projectVersionId;
-		this.startTime = startTime;
-		this.endTime = endTime;
-		this.result = result;
-		this.log = log;
-		this.resultString = resultString;
-		this.projectName = projectName;
-		this.projectId = projectId;
-		this.description = projectDescription;
-		this.module = moduleName;
-	}
-	public Build(ResultSet rs)throws SQLException{
-		this.id = rs.getString("id");
-		this.runId = rs.getString("run_id");
-		this.projectVersionId = rs.getString("project_version_id");
-		this.startTime = rs.getString("start_time");
-		this.endTime = rs.getString("end_time");
-		this.result = rs.getInt("result");
-		this.log = rs.getString("log");
-		this.resultString = rs.getString("result_name");
-		this.projectName = rs.getString("name");
-		this.projectId = rs.getString("project_id");
-		this.description = rs.getString("description");
-		this.module = rs.getString("module_name");
-	}
-	/**
-	 * Add a Build b as dependee to this object
-	 * @param b -  Build object
-	 */
-	public void addDependees(Build b){
-		this.dependees.add(b);
-		b.addDependant(this);
-	}
-	public void addDependant(Build b){
-		this.depends.add(b);
-	}
-	public List<Build> getDependantList(){		
-		return this.depends;
-	}
-	public List<Build> getDependeesList(){
-		return this.dependees;
-	}
-	/**
-	 * Return the number of Builds that dependes direct or inderect on this build.
-	 * @return the number of dependees
-	 */
-	public int getDependees(){
-		
-		if(this.dependees == null || this.dependees.size() == 0){
-			return 0;
-		} else {
-			HashMap map = new HashMap();
-			this.calculateDependencies(map);
-			int dependees = map.size();
-			return dependees;			
-		}
-	}
-	/**
-	 * Returns the number of direct dependent packages
-	 * @return
-	 */
-	public int getDirectDependees(){
-		return dependees.size();
-	}
-	private void calculateDependencies(HashMap map){
-		Iterator<Build> it = dependees.iterator();
-		Build tmp;
-		while(it.hasNext()){
-			tmp = it.next();
-			map.put(tmp.getId(), 0);
-			tmp.calculateDependencies(map);			
-		}
-	}
-	/** Getters and setters */
-	
-	public String getEndTime() {
-		return endTime;
-	}
-	public void setEndTime(String endTime) {
-		this.endTime = endTime;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getLog() {
-		return log;
-	}
-	public void setLog(String log) {
-		this.log = log;
-	}
-	public String getProjectVersionId() {
-		return projectVersionId;
-	}
-	public void setProjectVersionId(String projectVersionId) {
-		this.projectVersionId = projectVersionId;
-	}
-	public int getResult() {
-		return result;
-	}
-	public void setResult(int result) {
-		this.result = result;
-	}
-	public String getRunId() {
-		return runId;
-	}
-	public void setRunId(String runId) {
-		this.runId = runId;
-	}
-	public String getStartTime() {
-		return startTime;
-	}
-	public void setStartTime(String startTime) {
-		this.startTime = startTime;
-	}
-	public String getResultString() {
-		return resultString;
-	}
-	public void setResultString(String resultString) {
-		this.resultString = resultString;
-	}
-	public String getProjectName() {
-		return projectName;
-	}
-	public void setProjectName(String projectName) {
-		this.projectName = projectName;
-	}
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	public String getModule() {
-		return module;
-	}
-	public void setModule(String module) {
-		this.module = module;
-	}
-	
-	public String getProjectId() {
-		return projectId;
-	}
-	public HistoryVO getHistory(){
-		if(history == null){
-			System.out.println("history == null");
-		}
-		return history;
-	}
-	public void addHistory(HistoryVO h){
-		System.out.println("history = "+h +"\n"
-						   +"startTime: " +h.getStartOfState());
-		this.history = h;
-	}
-	
-	
-	
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.java Sun Mar 19 12:44:28 2006
@@ -2,26 +2,32 @@
 
 public class HistoryObject {
 
-	private String start;
-	private int result;
-	
-	public HistoryObject(){}
-	public HistoryObject(String start, int result){
-		this.start=start;
-		this.result=result;
-	}
-	
-	public int getResult() {
-		return result;
-	}
-	public void setResult(int result) {
-		this.result = result;
-	}
-	public String getStart() {
-		return start;
-	}
-	public void setStart(String start) {
-		this.start = start;
-	}
-	
+    private String start;
+
+    private int result;
+
+    public HistoryObject() {
+    }
+
+    public HistoryObject(String start, int result) {
+        this.start = start;
+        this.result = result;
+    }
+
+    public int getResult() {
+        return result;
+    }
+
+    public void setResult(int result) {
+        this.result = result;
+    }
+
+    public String getStart() {
+        return start;
+    }
+
+    public void setStart(String start) {
+        this.start = start;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.java Sun Mar 19 12:44:28 2006
@@ -1,157 +1,188 @@
 package org.apache.gump.dynagump.presentation.valueObjects;
 
 import java.io.Serializable;
-import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 
-public class HistoryVO implements Serializable{
+public class HistoryVO implements Serializable {
 
-	private int currentState;
-	private int durationInState;
-	private String startOfState;
-	private int previusState;
-	private String firstSuccess = null;
-	private String lastSuccess = null;
-	private String[] states = new String[]{"success", "failure","stalled"};
-	private HashMap<String, Integer> numberAtState = new HashMap<String, Integer>();
-	private List<HistoryObject> values = new LinkedList<HistoryObject>();
-	
-	public HistoryVO(){
-		for(int i=0; i < states.length; i++){
-			numberAtState.put(states[i], 0);
-		}
-	}
-	/** 
-	 * Sets the values for the history object from a resultset from the database.
-	 * @param rs - ResultSet from db.
-	 * @throws SQLException
-	 */
-	public void addValues(int result, String start){
-		values.add(new HistoryObject(start,result));
-	}
-	public void setValues() throws SQLException{
-
-		HistoryObject tmp;
-		while(values.size() != 0){	
-//			String start =  rs.getString("start");			
-//			int result = rs.getInt("result");
-			tmp = values.remove(0);
-			String start =  tmp.getStart();			
-			int result = tmp.getResult();
-			
-			
-			currentState = result;
-			this.updateNumberOfState(result);
-			durationInState = 0;
-			startOfState = start;
-			previusState = currentState;
-			if(currentState == 0){
-				this.setSuccessStatus(start);
-			}
-			
-			this.checkDurationAndState();
-			
-		}
-	}
-	/**
-	 * Recursive method to check for the states that this package has gone through historicly and check for duration in state.
-	 * @param rs result from the db.
-	 * @throws SQLException
-	 */
-	private void checkDurationAndState() throws SQLException{
-		if(values.size() == 0)
-			return;
-		HistoryObject tmp;
-		tmp = values.remove(0);
-		int result = tmp.getResult();
-		String start = tmp.getStart();
-		this.updateNumberOfState(result);
-		if(result == 0)
-			this.setSuccessStatus(start);
-		
-		if(result != currentState){			
-			previusState = result;
-			this.checkState();
-			
-		}else {
-			startOfState = start;
-			this.checkDurationAndState();
-			
-		}
-	}
-	/**
-	 * Recursive method to go throu the states that this package has gone through historicly. With out checking for duration in state.
-	 *  
-	 * @param rs the result from the db
-	 * @throws SQLException
-	 */
-	private void checkState() throws SQLException{
-		if(values.size() == 0)
-			return;
-		HistoryObject tmp = values.remove(0);
-		
-		int result = tmp.getResult();
-		String start = tmp.getStart();
-		this.updateNumberOfState(result);
-		if(result == 0)
-			this.setSuccessStatus(start);
-		this.checkState();		
-	}
-	/**
-	 * Updates the first and last success for this package by the given date.
-	 * @param start
-	 */
-	private void setSuccessStatus(String start){
-		if(firstSuccess == null){
-			firstSuccess = start;
-		}
-		lastSuccess = start;
-	}
-	private void updateNumberOfState(int result){
-		numberAtState.put(states[result], numberAtState.get(states[result])+1);
-	}
-
-	/* Getters and Setters */
-	public String getCurrentStateString(){
-		return states[currentState];
-	}
-	public int getCurrentState(){
-		return currentState;
-	}
-	public int getDurationInState(){
-		return durationInState;
-	}
-	public String getStartOfState(){
-		return startOfState;
-	}
-	public String getFirsSuccess(){
-		if(firstSuccess == null){
-			return "-";
-		}
-		return firstSuccess;
-	}
-	public String getLastSuccess(){
-		if(lastSuccess == null){
-			return "-";
-		}
-		return lastSuccess;
-	}
-	public String getPreviusStateString(){
-		return states[previusState];
-	}
-	public int getPreviusState(){
-		return previusState;
-	}
-	public int getNumberOfSuccess(){
-		return numberAtState.get(states[0]);
-	}
-	public int getNumberOfFailures(){
-		return numberAtState.get(states[1]);
-	}
-	public int getNumberOfStalled(){
-		return numberAtState.get(states[2]);
-	}	
+    private int currentState;
+
+    private int durationInState;
+
+    private String startOfState;
+
+    private int previusState;
+
+    private String firstSuccess = null;
+
+    private String lastSuccess = null;
+
+    private String[] states = new String[] { "success", "failure", "stalled" };
+
+    private HashMap<String, Integer> numberAtState = new HashMap<String, Integer>();
+
+    private List<HistoryObject> values = new LinkedList<HistoryObject>();
+
+    public HistoryVO() {
+        for (int i = 0; i < states.length; i++) {
+            numberAtState.put(states[i], 0);
+        }
+    }
+
+    /**
+     * Sets the values for the history object from a resultset from the
+     * database.
+     * 
+     * @param rs -
+     *            ResultSet from db.
+     * @throws SQLException
+     */
+    public void addValues(int result, String start) {
+        values.add(new HistoryObject(start, result));
+    }
+
+    public void setValues() throws SQLException {
+
+        HistoryObject tmp;
+        while (values.size() != 0) {
+            // String start = rs.getString("start");
+            // int result = rs.getInt("result");
+            tmp = values.remove(0);
+            String start = tmp.getStart();
+            int result = tmp.getResult();
+
+            currentState = result;
+            this.updateNumberOfState(result);
+            durationInState = 0;
+            startOfState = start;
+            previusState = currentState;
+            if (currentState == 0) {
+                this.setSuccessStatus(start);
+            }
+
+            this.checkDurationAndState();
+
+        }
+    }
+
+    /**
+     * Recursive method to check for the states that this package has gone
+     * through historicly and check for duration in state.
+     * 
+     * @param rs
+     *            result from the db.
+     * @throws SQLException
+     */
+    private void checkDurationAndState() throws SQLException {
+        if (values.size() == 0)
+            return;
+        HistoryObject tmp;
+        tmp = values.remove(0);
+        int result = tmp.getResult();
+        String start = tmp.getStart();
+        this.updateNumberOfState(result);
+        if (result == 0)
+            this.setSuccessStatus(start);
+
+        if (result != currentState) {
+            previusState = result;
+            this.checkState();
+
+        } else {
+            startOfState = start;
+            this.checkDurationAndState();
+
+        }
+    }
+
+    /**
+     * Recursive method to go throu the states that this package has gone
+     * through historicly. With out checking for duration in state.
+     * 
+     * @param rs
+     *            the result from the db
+     * @throws SQLException
+     */
+    private void checkState() throws SQLException {
+        if (values.size() == 0)
+            return;
+        HistoryObject tmp = values.remove(0);
+
+        int result = tmp.getResult();
+        String start = tmp.getStart();
+        this.updateNumberOfState(result);
+        if (result == 0)
+            this.setSuccessStatus(start);
+        this.checkState();
+    }
+
+    /**
+     * Updates the first and last success for this package by the given date.
+     * 
+     * @param start
+     */
+    private void setSuccessStatus(String start) {
+        if (firstSuccess == null) {
+            firstSuccess = start;
+        }
+        lastSuccess = start;
+    }
+
+    private void updateNumberOfState(int result) {
+        numberAtState.put(states[result], numberAtState.get(states[result]) + 1);
+    }
+
+    /* Getters and Setters */
+    public String getCurrentStateString() {
+        return states[currentState];
+    }
+
+    public int getCurrentState() {
+        return currentState;
+    }
+
+    public int getDurationInState() {
+        return durationInState;
+    }
+
+    public String getStartOfState() {
+        return startOfState;
+    }
+
+    public String getFirsSuccess() {
+        if (firstSuccess == null) {
+            return "-";
+        }
+        return firstSuccess;
+    }
+
+    public String getLastSuccess() {
+        if (lastSuccess == null) {
+            return "-";
+        }
+        return lastSuccess;
+    }
+
+    public String getPreviusStateString() {
+        return states[previusState];
+    }
+
+    public int getPreviusState() {
+        return previusState;
+    }
+
+    public int getNumberOfSuccess() {
+        return numberAtState.get(states[0]);
+    }
+
+    public int getNumberOfFailures() {
+        return numberAtState.get(states[1]);
+    }
+
+    public int getNumberOfStalled() {
+        return numberAtState.get(states[2]);
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Host.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Host.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Host.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Host.java Sun Mar 19 12:44:28 2006
@@ -5,128 +5,141 @@
 import java.sql.SQLException;
 import java.util.LinkedList;
 import java.util.List;
+
 /**
- * A value object for one host that contains a list of workspaces that is linked to the host.
+ * A value object for one host that contains a list of workspaces that is linked
+ * to the host.
+ * 
  * @author hodden
- *
+ * 
  */
-public class Host implements Serializable{
+public class Host implements Serializable {
+
+    private String address;
+
+    private String description;
+
+    private String cpuArch;
+
+    private int cpuNumber;
+
+    private int cpuSpeedMhz;
+
+    private int memoryMb;
+
+    private int diskGb;
+
+    private String name;
+
+    private List<WorkSpace> workspaces = new LinkedList<WorkSpace>();
+
+    public Host() {
+    }
+
+    public Host(String address, String description, String cpuArch, int cpuNumber, int cpuSpeed, int memoryMb, int diskGb, String name) {
+        this.address = address;
+        this.description = description;
+        this.cpuArch = cpuArch;
+        this.cpuNumber = cpuNumber;
+        this.cpuSpeedMhz = cpuSpeed;
+        this.memoryMb = memoryMb;
+        this.diskGb = diskGb;
+        this.name = name;
+
+    }
+
+    public Host(ResultSet rs) throws SQLException {
+        this.address = rs.getString("address");
+        this.description = rs.getString("description");
+        this.cpuArch = rs.getString("cpu_arch");
+        this.cpuNumber = rs.getInt("cpu_number");
+        this.cpuSpeedMhz = rs.getInt("cpu_speed_Mhz");
+        this.memoryMb = rs.getInt("memory_Mb");
+        this.diskGb = rs.getInt("disk_Gb");
+        this.name = rs.getString("name");
+
+    }
+
+    public void addWorkspace(WorkSpace w) {
+        workspaces.add(w);
+    }
+
+    public void setWorkspaces(ResultSet rs) throws SQLException {
+        while (rs.next()) {
+            workspaces.add(new WorkSpace(rs));
+        }
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCpuArch() {
+        return cpuArch;
+    }
+
+    public void setCpuArch(String cpuArch) {
+        this.cpuArch = cpuArch;
+    }
+
+    public int getCpuNumber() {
+        return cpuNumber;
+    }
+
+    public void setCpuNumber(int cpuNumber) {
+        this.cpuNumber = cpuNumber;
+    }
+
+    public int getCpuSpeedMhz() {
+        return cpuSpeedMhz;
+    }
+
+    public void setCpuSpeedMhz(int cpuSpeedMhz) {
+        this.cpuSpeedMhz = cpuSpeedMhz;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public int getDiskGb() {
+        return diskGb;
+    }
+
+    public void setDiskGb(int diskGb) {
+        this.diskGb = diskGb;
+    }
+
+    public int getMemoryMb() {
+        return memoryMb;
+    }
+
+    public void setMemoryMb(int memoryMb) {
+        this.memoryMb = memoryMb;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<WorkSpace> getWorkspaces() {
+        return workspaces;
+    }
 
-	private String address;
-	private String description;
-	private String cpuArch;
-	private int cpuNumber;
-	private int cpuSpeedMhz;
-	private int memoryMb;
-	private int diskGb;
-	private String name;
-	private List<WorkSpace> workspaces = new LinkedList<WorkSpace>();
-	
-	public Host(){}
-	
-	public Host(String address, String description, String cpuArch, int cpuNumber,
-			int cpuSpeed, int memoryMb, int diskGb, String name){
-		this.address = address;
-		this.description = description;
-		this.cpuArch = cpuArch;
-		this.cpuNumber = cpuNumber;
-		this.cpuSpeedMhz = cpuSpeed;
-		this.memoryMb = memoryMb;
-		this.diskGb = diskGb;
-		this.name = name;
-		
-	}
-	public Host(ResultSet rs) throws SQLException{
-		this.address = rs.getString("address");
-		this.description = rs.getString("description");
-		this.cpuArch = rs.getString("cpu_arch");
-		this.cpuNumber = rs.getInt("cpu_number");
-		this.cpuSpeedMhz = rs.getInt("cpu_speed_Mhz");
-		this.memoryMb = rs.getInt("memory_Mb");
-		this.diskGb = rs.getInt("disk_Gb");
-		this.name = rs.getString("name");
-		
-	}
-	public void addWorkspace(WorkSpace w){
-		workspaces.add(w);
-	}
-	public void setWorkspaces(ResultSet rs)throws SQLException{
-		while(rs.next()){
-			workspaces.add(new WorkSpace(rs));
-		}
-	}
-
-	public String getAddress() {
-		return address;
-	}
-
-	public void setAddress(String address) {
-		this.address = address;
-	}
-
-	public String getCpuArch() {
-		return cpuArch;
-	}
-
-	public void setCpuArch(String cpuArch) {
-		this.cpuArch = cpuArch;
-	}
-
-	public int getCpuNumber() {
-		return cpuNumber;
-	}
-
-	public void setCpuNumber(int cpuNumber) {
-		this.cpuNumber = cpuNumber;
-	}
-
-	public int getCpuSpeedMhz() {
-		return cpuSpeedMhz;
-	}
-
-	public void setCpuSpeedMhz(int cpuSpeedMhz) {
-		this.cpuSpeedMhz = cpuSpeedMhz;
-	}
-
-	public String getDescription() {
-		return description;
-	}
-
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	public int getDiskGb() {
-		return diskGb;
-	}
-
-	public void setDiskGb(int diskGb) {
-		this.diskGb = diskGb;
-	}
-
-	public int getMemoryMb() {
-		return memoryMb;
-	}
-
-	public void setMemoryMb(int memoryMb) {
-		this.memoryMb = memoryMb;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public List<WorkSpace> getWorkspaces() {
-		return workspaces;
-	}
-
-	public void setWorkspaces(List<WorkSpace> workspaces) {
-		this.workspaces = workspaces;
-	}
-	
+    public void setWorkspaces(List<WorkSpace> workspaces) {
+        this.workspaces = workspaces;
+    }
 
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.java Sun Mar 19 12:44:28 2006
@@ -4,157 +4,210 @@
 import java.util.LinkedList;
 import java.util.List;
 
-public class ProjectBuildVO implements Serializable{
+public class ProjectBuildVO implements Serializable {
+
+    private String id;
+
+    private String name;
+
+    private String description;
+
+    private String module_id;
+
+    private String build_id;
+
+    private String run_id;
+
+    private int result;
+
+    private String start_time;
+
+    private String end_time;
+
+    private String workspace_id;
+
+    private String run_name;
+
+    private String workspace_name;
+
+    private String module_name;
+
+    private String resultString;
+
+    private String projectVersionID;
+
+    private List<String> dependees = new LinkedList<String>(); // packages
+                                                                // depending on
+                                                                // this package
+
+    private List<String> dependant = new LinkedList<String>(); // packages this
+                                                                // package
+                                                                // depends on.
+
+    public ProjectBuildVO() {
+    }
+
+    public ProjectBuildVO(String id, String name, String description, String module_id, String build_id, String run_id, int result,
+            String start_time, String end_time, String workspace_id, String run_name, String workspace_name, String module_name, String resultString) {
+        this.id = id;
+        this.name = name;
+        this.description = description;
+        this.module_id = module_id;
+        this.module_name = module_name;
+        this.build_id = build_id;
+        this.run_id = run_id;
+        this.run_name = run_name;
+        this.start_time = start_time;
+        this.end_time = end_time;
+        this.workspace_id = workspace_id;
+        this.workspace_name = workspace_name;
+        this.result = result;
+        this.resultString = resultString;
+    }
+
+    public int getNumbersOfDependees() {
+        return dependees.size();
+    }
+
+    public int getNumbersOfDependant() {
+        return dependant.size();
+    }
+
+    /* Getters and setters */
+    public String getBuild_id() {
+        return build_id;
+    }
+
+    public void setBuild_id(String build_id) {
+        this.build_id = build_id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getEnd_time() {
+        return end_time;
+    }
+
+    public void setEnd_time(String end_time) {
+        this.end_time = end_time;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getModule_id() {
+        return module_id;
+    }
+
+    public void setModule_id(String module_id) {
+        this.module_id = module_id;
+    }
+
+    public String getModule_name() {
+        return module_name;
+    }
+
+    public void setModule_name(String module_name) {
+        this.module_name = module_name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getResult() {
+        return result;
+    }
+
+    public void setResult(int result) {
+        this.result = result;
+    }
+
+    public String getResultString() {
+        return resultString;
+    }
+
+    public void setResultString(String resultString) {
+        this.resultString = resultString;
+    }
+
+    public String getRun_id() {
+        return run_id;
+    }
+
+    public void setRun_id(String run_id) {
+        this.run_id = run_id;
+    }
+
+    public String getRun_name() {
+        return run_name;
+    }
+
+    public void setRun_name(String run_name) {
+        this.run_name = run_name;
+    }
+
+    public String getStart_time() {
+        return start_time;
+    }
+
+    public void setStart_time(String start_time) {
+        this.start_time = start_time;
+    }
+
+    public String getWorkspace_id() {
+        return workspace_id;
+    }
+
+    public void setWorkspace_id(String workspace_id) {
+        this.workspace_id = workspace_id;
+    }
+
+    public String getWorkspace_name() {
+        return workspace_name;
+    }
+
+    public void setWorkspace_name(String workspace_name) {
+        this.workspace_name = workspace_name;
+    }
+
+    public List<String> getDependant() {
+        return dependant;
+    }
+
+    public void setDependant(List<String> dependant) {
+        this.dependant = dependant;
+    }
+
+    public List<String> getDependees() {
+        return dependees;
+    }
+
+    public void setDependees(List<String> dependees) {
+        this.dependees = dependees;
+    }
+
+    public String getProjectVersionID() {
+        return projectVersionID;
+    }
+
+    public void setProjectVersionID(String projectVersionID) {
+        this.projectVersionID = projectVersionID;
+    }
 
-	 private String id;
-	 private String name;
-	 private String description;
-	 private String module_id;
-	 private String build_id;
-	 private String run_id;
-	 private int result;
-	 private String start_time;
-	 private String end_time;
-	 private String workspace_id;
-	 private String run_name;
-	 private String workspace_name;
-	 private String module_name;
-	 private String resultString;
-	 private String projectVersionID;
-	 private List<String> dependees = new LinkedList<String>();	//packages depending on this package
-	 private List<String> dependant = new LinkedList<String>();   // packages this package depends on.
-	
-	 public ProjectBuildVO(){}
-	 public ProjectBuildVO(String id,String name,String description,String module_id,
-			 			String build_id,String run_id,int result,String start_time,
-			 			String end_time, String workspace_id, String run_name,String workspace_name,
-			 			String module_name, String resultString){
-		 this.id = id;
-		 this.name = name;
-		 this.description = description;
-		 this.module_id = module_id;
-		 this.module_name = module_name;
-		 this.build_id = build_id;
-		 this.run_id = run_id;
-		 this.run_name = run_name;
-		 this.start_time = start_time;
-		 this.end_time = end_time;
-		 this.workspace_id = workspace_id;
-		 this.workspace_name = workspace_name;
-		 this.result = result;
-		 this.resultString = resultString;
-	 }
-	 
-	 public int getNumbersOfDependees(){
-		 return dependees.size();
-	 }
-	 public int getNumbersOfDependant(){
-		 return dependant.size();
-	 }
-	/* Getters and setters */
-	public String getBuild_id() {
-		return build_id;
-	}
-	public void setBuild_id(String build_id) {
-		this.build_id = build_id;
-	}
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	public String getEnd_time() {
-		return end_time;
-	}
-	public void setEnd_time(String end_time) {
-		this.end_time = end_time;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getModule_id() {
-		return module_id;
-	}
-	public void setModule_id(String module_id) {
-		this.module_id = module_id;
-	}
-	public String getModule_name() {
-		return module_name;
-	}
-	public void setModule_name(String module_name) {
-		this.module_name = module_name;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public int getResult() {
-		return result;
-	}
-	public void setResult(int result) {
-		this.result = result;
-	}
-	public String getResultString() {
-		return resultString;
-	}
-	public void setResultString(String resultString) {
-		this.resultString = resultString;
-	}
-	public String getRun_id() {
-		return run_id;
-	}
-	public void setRun_id(String run_id) {
-		this.run_id = run_id;
-	}
-	public String getRun_name() {
-		return run_name;
-	}
-	public void setRun_name(String run_name) {
-		this.run_name = run_name;
-	}
-	public String getStart_time() {
-		return start_time;
-	}
-	public void setStart_time(String start_time) {
-		this.start_time = start_time;
-	}
-	public String getWorkspace_id() {
-		return workspace_id;
-	}
-	public void setWorkspace_id(String workspace_id) {
-		this.workspace_id = workspace_id;
-	}
-	public String getWorkspace_name() {
-		return workspace_name;
-	}
-	public void setWorkspace_name(String workspace_name) {
-		this.workspace_name = workspace_name;
-	}
-	public List<String> getDependant() {
-		return dependant;
-	}
-	public void setDependant(List<String> dependant) {
-		this.dependant = dependant;
-	}
-	public List<String> getDependees() {
-		return dependees;
-	}
-	public void setDependees(List<String> dependees) {
-		this.dependees = dependees;
-	}
-	public String getProjectVersionID() {
-		return projectVersionID;
-	}
-	public void setProjectVersionID(String projectVersionID) {
-		this.projectVersionID = projectVersionID;
-	}
-	 
-	 
-	 
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.java Sun Mar 19 12:44:28 2006
@@ -2,53 +2,67 @@
 
 import java.io.Serializable;
 
-public class ProjectVO implements Serializable{
+public class ProjectVO implements Serializable {
+
+    private String projectId;
+
+    private String name;
+
+    private String description;
+
+    private String moduleId;
+
+    private String moduleName;
+
+    public ProjectVO() {
+    }
+
+    public ProjectVO(String id, String name, String description, String moduleId, String moduleName) {
+        this.projectId = id;
+        this.name = name;
+        this.description = description;
+        this.moduleId = moduleId;
+        this.moduleName = moduleName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getModuleId() {
+        return moduleId;
+    }
+
+    public void setModuleId(String moduleId) {
+        this.moduleId = moduleId;
+    }
+
+    public String getModuleName() {
+        return moduleName;
+    }
+
+    public void setModuleName(String moduleName) {
+        this.moduleName = moduleName;
+    }
 
-	private String projectId;
-	private String name;
-	private String description;
-	private String moduleId;
-	private String moduleName;
-	
-	public ProjectVO(){}
-	public ProjectVO(String id, String name, String description, String moduleId, String moduleName){
-		this.projectId = id;
-		this.name = name;
-		this.description = description;
-		this.moduleId = moduleId;
-		this.moduleName = moduleName;
-	}
-	
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getProjectId() {
-		return projectId;
-	}
-	public void setProjectId(String projectId) {
-		this.projectId = projectId;
-	}
-	public String getModuleId() {
-		return moduleId;
-	}
-	public void setModuleId(String moduleId) {
-		this.moduleId = moduleId;
-	}
-	public String getModuleName() {
-		return moduleName;
-	}
-	public void setModuleName(String moduleName) {
-		this.moduleName = moduleName;
-	}
-	
-	
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Run.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Run.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Run.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Run.java Sun Mar 19 12:44:28 2006
@@ -3,67 +3,83 @@
 import java.io.Serializable;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+
 /**
  * Value object to represent the each run made by gump.
+ * 
  * @author hodden
- *
+ * 
  */
 public class Run implements Serializable {
 
-	private String id;
-	private String start;
-	private String end;
-	private String workspace;
-	private String name;
-	
-	public Run(){}
-	public Run(String id, String start, String end, String workspace, String name){
-		this.id = id;
-		this.start = start;
-		this.end = end;
-		this.workspace = workspace;
-		this.name = name;
-	}
-	public Run(ResultSet rs)throws SQLException{
-		this.id = rs.getString("id");
-		this.start = rs.getString("start_time");
-		this.end = rs.getString("end_time");
-		this.workspace = rs.getString("workspace_id");
-		this.name = rs.getString("name");
-	}
-	
-	/** Getter and setters for the Run Value Object */
-	public String getEnd() {
-		return end;
-	}
-	public void setEnd(String end) {
-		this.end = end;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getStart() {
-		return start;
-	}
-	public void setStart(String start) {
-		this.start = start;
-	}
-	public String getWorkspace() {
-		return workspace;
-	}
-	public void setWorkspace(String workspace) {
-		this.workspace = workspace;
-	}
-	
-	
-	
+    private String id;
+
+    private String start;
+
+    private String end;
+
+    private String workspace;
+
+    private String name;
+
+    public Run() {
+    }
+
+    public Run(String id, String start, String end, String workspace, String name) {
+        this.id = id;
+        this.start = start;
+        this.end = end;
+        this.workspace = workspace;
+        this.name = name;
+    }
+
+    public Run(ResultSet rs) throws SQLException {
+        this.id = rs.getString("id");
+        this.start = rs.getString("start_time");
+        this.end = rs.getString("end_time");
+        this.workspace = rs.getString("workspace_id");
+        this.name = rs.getString("name");
+    }
+
+    /** Getter and setters for the Run Value Object */
+    public String getEnd() {
+        return end;
+    }
+
+    public void setEnd(String end) {
+        this.end = end;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getStart() {
+        return start;
+    }
+
+    public void setStart(String start) {
+        this.start = start;
+    }
+
+    public String getWorkspace() {
+        return workspace;
+    }
+
+    public void setWorkspace(String workspace) {
+        this.workspace = workspace;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.java Sun Mar 19 12:44:28 2006
@@ -7,64 +7,73 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+
 /**
- * Value object to collect all the information from one Run. 
- * Contains a list of builds for this run. 
- * And the over all status for this run.
+ * Value object to collect all the information from one Run. Contains a list of
+ * builds for this run. And the over all status for this run.
+ * 
  * @author hodden
- *
+ * 
  */
-public class RunStatusVO implements Serializable{
-	
-	private HashMap overAllStatus;
-	private HashMap<String, Build> builds = new HashMap<String, Build>();
-	
-	public RunStatusVO(){
-		
-	}
-	public void addBuild(Build b){
-		builds.put(b.getId(), b);
-	}
-	public Collection<Build> getBuilds() {		
-		Collection<Build> c = builds.values();
-		return c;
-	}
-	public HashMap<String, Build> getBuildsMap() {		
-		return builds;
-	}
-
-	public void setBuilds(HashMap<String, Build> builds) {
-		this.builds = builds;
-	}
-	public List<StatusVO> getOverAll(){
-		List<StatusVO> li = new LinkedList<StatusVO>();
-		li.add(new StatusVO("success", 0));
-		li.add(new StatusVO("failure", 0));
-		li.add(new StatusVO("stalled", 0));
-		this.updateOverAllStats(li);
-		this.setPercentage(li);
-		return li;
-	}
-	public Build getBuild(String id){
-		return builds.get(id);	
-	}
-	private void setPercentage(List<StatusVO> li){
-		for(int i=0; i<li.size(); i++){
-			li.get(i).calcPercent(builds.size());
-		}
-	}
-	private void updateOverAllStats(List<StatusVO> li){
-		HashMap<String, StatusVO> status = new HashMap<String, StatusVO>();
-		//TODO Initiate the list from the result table
-		for(int i=0; i < li.size(); i++){
-			status.put(li.get(i).getName(), li.get(i));
-		}
-		StatusVO temp;
-		Set<String> s = builds.keySet();
-		Iterator<String> it = s.iterator();
-		while(it.hasNext()){
-			temp = status.get(builds.get(it.next()).getResultString());
-			temp.setValue(temp.getValue()+1); 
-		}
-	}
+public class RunStatusVO implements Serializable {
+
+    private HashMap overAllStatus;
+
+    private HashMap<String, Build> builds = new HashMap<String, Build>();
+
+    public RunStatusVO() {
+
+    }
+
+    public void addBuild(Build b) {
+        builds.put(b.getId(), b);
+    }
+
+    public Collection<Build> getBuilds() {
+        Collection<Build> c = builds.values();
+        return c;
+    }
+
+    public HashMap<String, Build> getBuildsMap() {
+        return builds;
+    }
+
+    public void setBuilds(HashMap<String, Build> builds) {
+        this.builds = builds;
+    }
+
+    public List<StatusVO> getOverAll() {
+        List<StatusVO> li = new LinkedList<StatusVO>();
+        li.add(new StatusVO("success", 0));
+        li.add(new StatusVO("failure", 0));
+        li.add(new StatusVO("stalled", 0));
+        this.updateOverAllStats(li);
+        this.setPercentage(li);
+        return li;
+    }
+
+    public Build getBuild(String id) {
+        return builds.get(id);
+    }
+
+    private void setPercentage(List<StatusVO> li) {
+        for (int i = 0; i < li.size(); i++) {
+            li.get(i).calcPercent(builds.size());
+        }
+    }
+
+    private void updateOverAllStats(List<StatusVO> li) {
+        HashMap<String, StatusVO> status = new HashMap<String, StatusVO>();
+        // TODO Initiate the list from the result table
+        for (int i = 0; i < li.size(); i++) {
+            status.put(li.get(i).getName(), li.get(i));
+        }
+        StatusVO temp;
+        Set<String> s = builds.keySet();
+        Iterator<String> it = s.iterator();
+        while (it.hasNext()) {
+            temp = status.get(builds.get(it.next()).getResultString());
+            temp.setValue(temp.getValue() + 1);
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.java Sun Mar 19 12:44:28 2006
@@ -1,43 +1,56 @@
 package org.apache.gump.dynagump.presentation.valueObjects;
 
 import java.io.Serializable;
+
 /**
  * This object is an object to contain the over all status of a run or module.
+ * 
  * @author hodden
- *
+ * 
  */
 public class StatusVO implements Serializable {
 
-	private String name;
-	private int value;
-	private float percentage;
-	
-	public StatusVO(){}
-	public StatusVO(String name, int value){
-		this.name = name;
-		this.value = value;
-	
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public int getValue() {
-		return value;
-	}
-	public void setValue(int value) {
-		this.value = value;
-	}
-	public float getPercentage() {
-		return percentage;
-	}
-	public void setPercentage(float percentage) {
-		this.percentage = percentage;
-	}
-	public void calcPercent(int total){		
-		this.percentage = Math.round(((float)value / total)*100);		
-	}
-	
+    private String name;
+
+    private int value;
+
+    private float percentage;
+
+    public StatusVO() {
+    }
+
+    public StatusVO(String name, int value) {
+        this.name = name;
+        this.value = value;
+
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public void setValue(int value) {
+        this.value = value;
+    }
+
+    public float getPercentage() {
+        return percentage;
+    }
+
+    public void setPercentage(float percentage) {
+        this.percentage = percentage;
+    }
+
+    public void calcPercent(int total) {
+        this.percentage = Math.round(((float) value / total) * 100);
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.java Sun Mar 19 12:44:28 2006
@@ -4,51 +4,65 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-public class WorkSpace implements Serializable{
+public class WorkSpace implements Serializable {
+
+    private String id;
+
+    private String name;
+
+    private String host;
+
+    private String description;
+
+    public WorkSpace() {
+    }
+
+    public WorkSpace(String id, String name, String host, String description) {
+        this.id = id;
+        this.name = name;
+        this.host = host;
+        this.description = description;
+    }
+
+    public WorkSpace(ResultSet rs) throws SQLException {
+        this.id = rs.getString("id");
+        this.name = rs.getString("name");
+        this.host = rs.getString("host");
+        this.description = rs.getString("description");
+    }
+
+    /** Getters and setters * */
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
 
-	private String id;
-	private String name;
-	private String host;
-	private String description;
-	
-	public WorkSpace(){}
-	public WorkSpace(String id, String name, String host, String description){
-		this.id = id;
-		this.name= name;
-		this.host = host;
-		this.description = description;
-	}
-	public WorkSpace(ResultSet rs) throws SQLException{
-		this.id = rs.getString("id");
-		this.name = rs.getString("name");
-		this.host = rs.getString("host");
-		this.description = rs.getString("description");
-	}
-	/** Getters and setters **/
-	
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	public String getHost() {
-		return host;
-	}
-	public void setHost(String host) {
-		this.host = host;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	
 }



Mime
View raw message