// 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/model/util/ModelSoting.java
// public class ModelSoting {
// 	public static void serviceSortByWeight(List<ServiceMeta> serviceMetaList){
// 
// 		Comparator<ServiceMeta> comparator =  new Comparator<ServiceMeta>() {
// 			public int compare(ServiceMeta o1, ServiceMeta o2) {
// 				return (o1.getWeight() > o2.getWeight())? 1 : -1 ;
// 			}
// 		
// 		};
// 		Collections.sort(serviceMetaList, comparator);
// 	}
// 	
// 	public static void productionSortDate(List<ProductionMeta> productionList){
// 		Comparator<ProductionMeta> comparator =  new Comparator<ProductionMeta>() {
// 			public int compare(ProductionMeta o1, ProductionMeta o2) {
// 				return (o1.getCreateDate().getTime() < o2.getCreateDate().getTime())? 1 : -1 ;
// 			}
// 		};
// 		
// 		Collections.sort(productionList, comparator);
// 
// 	}
// 	
// 	
// 	public static void deployRequestSortDate(List<DeployRequest> deployRequestList){
// 		Comparator<DeployRequest> comparator =  new Comparator<DeployRequest>() {
// 			public int compare(DeployRequest o1, DeployRequest o2) {
// 				return (o1.getDate().getTime() < o2.getDate().getTime())? 1 : -1 ;
// 			}
// 		};
// 		Collections.sort(deployRequestList, comparator);
// 	}
// 	
// 	public static void deployLogSortDate(List<DeployLog> deployLogList){
// 		Comparator<DeployLog> comparator =  new Comparator<DeployLog>() {
// 			public int compare(DeployLog o1, DeployLog o2) {
// 				return (o1.getDate().getTime() < o2.getDate().getTime())? 1 : -1 ;
// 			}
// 		};
// 		Collections.sort(deployLogList, comparator);
// 	}
// 	
// 	public static void deployReportSortId(List<DeployReport> deployReportList){
// 		Comparator<DeployReport> comparator =  new Comparator<DeployReport>() {
// 			public int compare(DeployReport o1, DeployReport o2) {
// 				return o2.getDeployId().compareTo(o1.getDeployId());
// 			}
// 		};
// 		Collections.sort(deployReportList, comparator);
// 	}
// }


import java.io.File;
import java.io.IOException;
import java.util.List;
import com.agun.flyJenkins.model.DeployReport;
import com.agun.flyJenkins.model.util.ModelSoting;
import jenkins.model.Jenkins;
import hudson.BulkChange;
import hudson.XmlFile;
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;
package com.agun.flyJenkins.persistence;




public class DeployReportSaveable implements Saveable {

	List<DeployReport> deployReportList;
	
	public void save() throws IOException {
		if(deployReportList != null)
// 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/model/util/ModelSoting.java
// public class ModelSoting {
// 	public static void serviceSortByWeight(List<ServiceMeta> serviceMetaList){
// 
// 		Comparator<ServiceMeta> comparator =  new Comparator<ServiceMeta>() {
// 			public int compare(ServiceMeta o1, ServiceMeta o2) {
// 				return (o1.getWeight() > o2.getWeight())? 1 : -1 ;
// 			}
// 		
// 		};
// 		Collections.sort(serviceMetaList, comparator);
// 	}
// 	
// 	public static void productionSortDate(List<ProductionMeta> productionList){
// 		Comparator<ProductionMeta> comparator =  new Comparator<ProductionMeta>() {
// 			public int compare(ProductionMeta o1, ProductionMeta o2) {
// 				return (o1.getCreateDate().getTime() < o2.getCreateDate().getTime())? 1 : -1 ;
// 			}
// 		};
// 		
// 		Collections.sort(productionList, comparator);
// 
// 	}
// 	
// 	
// 	public static void deployRequestSortDate(List<DeployRequest> deployRequestList){
// 		Comparator<DeployRequest> comparator =  new Comparator<DeployRequest>() {
// 			public int compare(DeployRequest o1, DeployRequest o2) {
// 				return (o1.getDate().getTime() < o2.getDate().getTime())? 1 : -1 ;
// 			}
// 		};
// 		Collections.sort(deployRequestList, comparator);
// 	}
// 	
// 	public static void deployLogSortDate(List<DeployLog> deployLogList){
// 		Comparator<DeployLog> comparator =  new Comparator<DeployLog>() {
// 			public int compare(DeployLog o1, DeployLog o2) {
// 				return (o1.getDate().getTime() < o2.getDate().getTime())? 1 : -1 ;
// 			}
// 		};
// 		Collections.sort(deployLogList, comparator);
// 	}
// 	
// 	public static void deployReportSortId(List<DeployReport> deployReportList){
// 		Comparator<DeployReport> comparator =  new Comparator<DeployReport>() {
// 			public int compare(DeployReport o1, DeployReport o2) {
// 				return o2.getDeployId().compareTo(o1.getDeployId());
// 			}
// 		};
// 		Collections.sort(deployReportList, comparator);
// 	}
// }


// Path: flyJenkins/src/main/java/com/agun/flyJenkins/persistence/DeployReportSaveable.java
import java.io.File;
import java.io.IOException;
import java.util.List;
import com.agun.flyJenkins.model.DeployReport;
import com.agun.flyJenkins.model.util.ModelSoting;
import jenkins.model.Jenkins;
import hudson.BulkChange;
import hudson.XmlFile;
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;

package com.agun.flyJenkins.persistence;




public class DeployReportSaveable implements Saveable {

	List<DeployReport> deployReportList;
	
	public void save() throws IOException {
		if(deployReportList != null)
			ModelSoting.deployReportSortId(deployReportList);