package com.eactive.eai.agent.adapter.socket;

import java.io.Serializable;

public class SocketSessionVO implements Serializable//, Comparable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String serverName       = "";  //서버인스턴스명
	private String uuid             = "";  //UUID
	private String processType      = "";  //업무유형
	private String processCode      = "";  //업무코드
	private String processName      = "";  //업무명
	private String organCode        = "";  //대외기관코드
	private String organName        = "";  //대외기관명
	private String adapterGroupName = "";  //어댑터그룹명
	private String adapterName      = "";  //어댑터명
	private String localIp          = "";  //로컬IP
	private String localPort        = "";  //로컬Port
	private String remoteIp         = "";  //리모트IP
	private String remotePort       = "";  //리모트Port
	private long   startTimeStamp   =  0;  //연결시작시간
	private long   endTimeStamp     =  0;  //연결종료시간 (배치에서는 무의미함)
	private String status           = "";  //Session Service 상태

	public void setServerName      (String arg) { this.serverName       = arg; }
	public void setUuid            (String arg) { this.uuid             = arg; }
	public void setProcessType     (String arg) { this.processType      = arg; }
	public void setProcessCode     (String arg) { this.processCode      = arg; }
	public void setProcessName     (String arg) { this.processName      = arg; }
	public void setOrganCode       (String arg) { this.organCode        = arg; }
	public void setOrganName       (String arg) { this.organName        = arg; }
	public void setAdapterGroupName(String arg) { this.adapterGroupName = arg; }
	public void setAdapterName     (String arg) { this.adapterName      = arg; }
	public void setLocalIp         (String arg) { this.localIp          = arg; }
	public void setLocalPort       (String arg) { this.localPort        = arg; }
	public void setRemoteIp        (String arg) { this.remoteIp         = arg; }
	public void setRemotePort      (String arg) { this.remotePort       = arg; }
	public void setStartTimeStamp  (long   arg) { this.startTimeStamp   = arg; }
	public void setEndTimeStamp    (long   arg) { this.endTimeStamp     = arg; }
	public void setStatus          (String arg) { this.status           = arg; }

	public String getServerName      () { return this.serverName      ; }
	public String getUuid            () { return this.uuid            ; }
	public String getProcessType     () { return this.processType     ; }
	public String getProcessCode     () { return this.processCode     ; }
	public String getProcessName     () { return this.processName     ; }
	public String getOrganCode       () { return this.organCode       ; }
	public String getOrganName       () { return this.organName       ; }
	public String getAdapterGroupName() { return this.adapterGroupName; }
	public String getAdapterName     () { return this.adapterName     ; }
	public String getLocalIp         () { return this.localIp         ; }
	public String getLocalPort       () { return this.localPort       ; }
	public String getRemoteIp        () { return this.remoteIp        ; }
	public String getRemotePort      () { return this.remotePort      ; }
	public long   getStartTimeStamp  () { return this.startTimeStamp  ; }
	public long   getEndTimeStamp    () { return this.endTimeStamp    ; }
	public String getStatus          () { return this.status          ; }

//    public int compareTo(Object arg0) {
//		SocketSessionVO info = (SocketSessionVO) arg0;
//		int compare = 0;
//		if ((compare = this.getServerName      ().compareTo(info.getServerName      ())) != 0) return compare;
//		if ((compare = this.getAdapterGroupName().compareTo(info.getAdapterGroupName())) != 0) return compare;
//		if ((compare = this.getAdapterName     ().compareTo(info.getAdapterName     ())) != 0) return compare;
//		return (int) (this.getStartTimeStamp() - info.getStartTimeStamp());
//	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("\nSocketSessionVO [ ");
		sb.append("serverName="        ).append(serverName      );
		sb.append(", uuid="            ).append(uuid            );
		sb.append(", processType="     ).append(processType     );
		sb.append(", processCode="     ).append(processCode     );
		sb.append(", processName="     ).append(processName     );
		sb.append(", organCode="       ).append(organCode       );
		sb.append(", organName="       ).append(organName       );
		sb.append(", adapterGroupName=").append(adapterGroupName);
		sb.append(", adapterName="     ).append(adapterName     );
		sb.append(", localIp="         ).append(localIp         );
		sb.append(", localPort="       ).append(localPort       );
		sb.append(", remoteIp="        ).append(remoteIp        );
		sb.append(", remotePort="      ).append(remotePort      );
		sb.append(", startTimeStamp="  ).append(startTimeStamp  );
		sb.append(", endTimeStamp="    ).append(endTimeStamp    );
		sb.append(", status="          ).append(status          );
		sb.append(" ]");

		return sb.toString();
	}
}
