// Path: flyJenkins/src/main/java/com/agun/flyJenkins/model/DeployLog.java
// public class DeployLog {
// 
// 	private String deployId;
// 	private String jobName;
// 	private String production;
// 	private String host;
// 	private int serviceGroupId;
// 	private int serviceId;
// 	private Date date;
// 	private Date reserveDate;
// 	private int requestOrder = 0;
// 	
// 	public int getRequestOrder() {
// 		return requestOrder;
// 	}
// 
// 	public void setRequestOrder(int requestOrder) {
// 		this.requestOrder = requestOrder;
// 	}
// 
// 	public String getDeployId() {
// 		return deployId;
// 	}
// 
// 	public void setDeployId(String deployId) {
// 		this.deployId = deployId;
// 	}
// 
// 	public String getJobName() {
// 		return jobName;
// 	}
// 
// 	public void setJobName(String jobName) {
// 		this.jobName = jobName;
// 	}
// 
// 	public Date getDate() {
// 		return date;
// 	}
// 
// 	public void setDate(Date date) {
// 		this.date = date;
// 	}
// 
// 	public String getProduction() {
// 		return production;
// 	}
// 
// 	public void setProduction(String production) {
// 		this.production = production;
// 	}
// 
// 	public Date getReserveDate() {
// 		return reserveDate;
// 	}
// 
// 	public void setReserveDate(Date reserveDate) {
// 		this.reserveDate = reserveDate;
// 	}
// 	
// 	public int getServiceGroupId() {
// 		return serviceGroupId;
// 	}
// 
// 	public void setServiceGroupId(int serviceGroupId) {
// 		this.serviceGroupId = serviceGroupId;
// 	}
// 
// 	public int getServiceId() {
// 		return serviceId;
// 	}
// 
// 	public void setServiceId(int serviceId) {
// 		this.serviceId = serviceId;
// 	}
// 
// 	public String getHost() {
// 		return host;
// 	}
// 
// 	public void setHost(String host) {
// 		this.host = host;
// 	}
// 	
// }
// 
// 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 jenkins.model.Jenkins;
import com.agun.flyJenkins.model.DeployLog;
import com.agun.flyJenkins.model.util.ModelSoting;
import hudson.BulkChange;
import hudson.XmlFile;
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;
package com.agun.flyJenkins.persistence;





public class DeployLogSaveable implements Saveable{
	private List<DeployLog> deployLogList = null;
	
	public void save() throws IOException {
		if(deployLogList != null){
// Path: flyJenkins/src/main/java/com/agun/flyJenkins/model/DeployLog.java
// public class DeployLog {
// 
// 	private String deployId;
// 	private String jobName;
// 	private String production;
// 	private String host;
// 	private int serviceGroupId;
// 	private int serviceId;
// 	private Date date;
// 	private Date reserveDate;
// 	private int requestOrder = 0;
// 	
// 	public int getRequestOrder() {
// 		return requestOrder;
// 	}
// 
// 	public void setRequestOrder(int requestOrder) {
// 		this.requestOrder = requestOrder;
// 	}
// 
// 	public String getDeployId() {
// 		return deployId;
// 	}
// 
// 	public void setDeployId(String deployId) {
// 		this.deployId = deployId;
// 	}
// 
// 	public String getJobName() {
// 		return jobName;
// 	}
// 
// 	public void setJobName(String jobName) {
// 		this.jobName = jobName;
// 	}
// 
// 	public Date getDate() {
// 		return date;
// 	}
// 
// 	public void setDate(Date date) {
// 		this.date = date;
// 	}
// 
// 	public String getProduction() {
// 		return production;
// 	}
// 
// 	public void setProduction(String production) {
// 		this.production = production;
// 	}
// 
// 	public Date getReserveDate() {
// 		return reserveDate;
// 	}
// 
// 	public void setReserveDate(Date reserveDate) {
// 		this.reserveDate = reserveDate;
// 	}
// 	
// 	public int getServiceGroupId() {
// 		return serviceGroupId;
// 	}
// 
// 	public void setServiceGroupId(int serviceGroupId) {
// 		this.serviceGroupId = serviceGroupId;
// 	}
// 
// 	public int getServiceId() {
// 		return serviceId;
// 	}
// 
// 	public void setServiceId(int serviceId) {
// 		this.serviceId = serviceId;
// 	}
// 
// 	public String getHost() {
// 		return host;
// 	}
// 
// 	public void setHost(String host) {
// 		this.host = host;
// 	}
// 	
// }
// 
// 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/DeployLogSaveable.java
import java.io.File;
import java.io.IOException;
import java.util.List;
import jenkins.model.Jenkins;
import com.agun.flyJenkins.model.DeployLog;
import com.agun.flyJenkins.model.util.ModelSoting;
import hudson.BulkChange;
import hudson.XmlFile;
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;

package com.agun.flyJenkins.persistence;





public class DeployLogSaveable implements Saveable{
	private List<DeployLog> deployLogList = null;
	
	public void save() throws IOException {
		if(deployLogList != null){
			ModelSoting.deployLogSortDate(deployLogList);