// Path: flyJenkins/src/main/java/com/agun/flyJenkins/model/DeployReport.java
// public class DeployReport {
// 	
// 	private String deployId;
// 	private int deploySize = 0;
// 	private int successCount =0;
// 	private int failCount = 0;
// 	
// 	public String getDeployId() {
// 		return deployId;
// 	}
// 	public void setDeployId(String deployId) {
// 		this.deployId = deployId;
// 	}
// 	public int getDeploySize() {
// 		return deploySize;
// 	}
// 	public void setDeploySize(int deploySize) {
// 		this.deploySize = deploySize;
// 	}
// 	public int getSuccessCount() {
// 		return successCount;
// 	}
// 	public void setSuccessCount(int successCount) {
// 		this.successCount = successCount;
// 	}
// 	public int getFailCount() {
// 		return failCount;
// 	}
// 	public void setFailCount(int failCount) {
// 		this.failCount = failCount;
// 	}
// 	
// 	public void plusSuccessCount(){
// 		this.successCount++;
// 	}
// 	
// 	public void plusFailCount(){
// 		this.failCount++;
// 	}
// 	
// 	public boolean isFinished(){
// 		if(deploySize == 0)
// 			return true;
// 		if(deploySize == (failCount + successCount))
// 			return true;
// 		
// 		return false;
// 	}
// 	
// 	public int getNextOrder(){
// 		if(isFinished()){
// 			return 0;
// 		}
// 		
// 		if(deploySize > (failCount + successCount))
// 			return failCount + successCount +1;
// 		
// 		return 0;
// 	}
// 
// }


import java.io.IOException;
import java.util.List;
import com.agun.flyJenkins.model.DeployReport;
package com.agun.flyJenkins.persistence;



public class DeployReportSaveableUtil {

	public static void plusSuccessCount(String deployId){
		DeployReportSaveable deployReportSaveable = new DeployReportSaveable();
		deployReportSaveable.load();
		
		List<DeployReport> deployReportList = deployReportSaveable.getDeployReportList();
		if(deployReportList == null)
			return;
		boolean isDeployReport = false;
		for(DeployReport deployReport :  deployReportList){
			if(deployReport.getDeployId().equals(deployId)){
				deployReport.plusSuccessCount();
				isDeployReport = true;
				break;
			}
		}
		if(isDeployReport){
			deployReportSaveable.setDeployReportList(deployReportList);
			try {
				deployReportSaveable.save();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
	
	public static void plusfailCount(String deployId){
		DeployReportSaveable deployReportSaveable = new DeployReportSaveable();
		deployReportSaveable.load();
		
// Path: flyJenkins/src/main/java/com/agun/flyJenkins/model/DeployReport.java
// public class DeployReport {
// 	
// 	private String deployId;
// 	private int deploySize = 0;
// 	private int successCount =0;
// 	private int failCount = 0;
// 	
// 	public String getDeployId() {
// 		return deployId;
// 	}
// 	public void setDeployId(String deployId) {
// 		this.deployId = deployId;
// 	}
// 	public int getDeploySize() {
// 		return deploySize;
// 	}
// 	public void setDeploySize(int deploySize) {
// 		this.deploySize = deploySize;
// 	}
// 	public int getSuccessCount() {
// 		return successCount;
// 	}
// 	public void setSuccessCount(int successCount) {
// 		this.successCount = successCount;
// 	}
// 	public int getFailCount() {
// 		return failCount;
// 	}
// 	public void setFailCount(int failCount) {
// 		this.failCount = failCount;
// 	}
// 	
// 	public void plusSuccessCount(){
// 		this.successCount++;
// 	}
// 	
// 	public void plusFailCount(){
// 		this.failCount++;
// 	}
// 	
// 	public boolean isFinished(){
// 		if(deploySize == 0)
// 			return true;
// 		if(deploySize == (failCount + successCount))
// 			return true;
// 		
// 		return false;
// 	}
// 	
// 	public int getNextOrder(){
// 		if(isFinished()){
// 			return 0;
// 		}
// 		
// 		if(deploySize > (failCount + successCount))
// 			return failCount + successCount +1;
// 		
// 		return 0;
// 	}
// 
// }


// Path: flyJenkins/src/main/java/com/agun/flyJenkins/persistence/DeployReportSaveableUtil.java
import java.io.IOException;
import java.util.List;
import com.agun.flyJenkins.model.DeployReport;

package com.agun.flyJenkins.persistence;



public class DeployReportSaveableUtil {

	public static void plusSuccessCount(String deployId){
		DeployReportSaveable deployReportSaveable = new DeployReportSaveable();
		deployReportSaveable.load();
		
		List<DeployReport> deployReportList = deployReportSaveable.getDeployReportList();
		if(deployReportList == null)
			return;
		boolean isDeployReport = false;
		for(DeployReport deployReport :  deployReportList){
			if(deployReport.getDeployId().equals(deployId)){
				deployReport.plusSuccessCount();
				isDeployReport = true;
				break;
			}
		}
		if(isDeployReport){
			deployReportSaveable.setDeployReportList(deployReportList);
			try {
				deployReportSaveable.save();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
	
	public static void plusfailCount(String deployId){
		DeployReportSaveable deployReportSaveable = new DeployReportSaveable();
		deployReportSaveable.load();
		
		List<DeployReport> deployReportList = deployReportSaveable.getDeployReportList();