package gmt.common.vo;

import gmt.common.type.SendModeType;
import gmt.common.type.SocketType;

import java.time.LocalDateTime;

public class MsgObjVO {
	private int				msgSeq;
//	private String			msg;
	private byte[]        	msg;
	private String			recvIP;
	private int				recvPort;
	private int				recvID;
	private int             recvTag;
	private LocalDateTime	recvDT;
	private int				recvServerPort; 
	private String			recvConnID;
	private SocketType		recvSocketType;		
	private String			destIP;
	private int				destPort;
	private String			destID;
	
	private int 			sendID;
	private int 			sendServerPort;
	private String			serviceClientIP;
	private int 			serviceClientPort;
	private String			exceptIP;
	private String 			sendClientIP;
	private int 			sendClientPort;
	private int 			serialPort;
	private SendModeType 	sendModeType;

	public MsgObjVO() {
		msgSeq     		= 0;
		msg        		= null;
		recvIP     		= "";
		recvPort   		= 0;
		recvID     		= -1;
		recvTag    		= 0;		
		recvDT     		= LocalDateTime.now();
		recvSocketType	= SocketType.NONE;
		recvServerPort 	= -1;
		recvConnID  	= "";
		destIP 			= "";
		destPort 		= 0;
		destID 			= "";
		
		sendID 				= -1;
		sendServerPort 		= 0;
		serviceClientIP 	= "";
		serviceClientPort	= 0;
		exceptIP 			= "";
		sendClientIP 		= "";
		sendClientPort 		= 0;
		serialPort 			= 0;
		sendModeType 		= SendModeType.UNKNOWN;
	}	

	public int getMsgSeq() {
		return msgSeq;
	}

	public void setMsgSeq(int msgSeq) {
		this.msgSeq = msgSeq;
	}

	public byte[] getMsg() {
		return msg;
	}

	public void setMsg(byte[] msg) {
		this.msg = msg;
	}

	public String getRecvIP() {
		return recvIP;
	}

	public void setRecvIP(String recvIP) {
		this.recvIP = recvIP;
	}

	public int getRecvPort() {
		return recvPort;
	}

	public void setRecvPort(int rcvPort) {
		this.recvPort = rcvPort;
	}

	public int getRecvID() {
		return recvID;
	}

	public void setRecvID(int rcvID) {
		this.recvID = rcvID;
	}

	public LocalDateTime getRecvDT() {
		return recvDT;
	}

	public void setRecvDT(LocalDateTime localDateTime) {
		this.recvDT = localDateTime;
	}

	public int getRecvServerPort() {
		return recvServerPort;
	}

	public void setRecvServerPort(int serverPort) {
		this.recvServerPort = serverPort;
	}

	public String getRecvConnID() {
		return recvConnID;
	}

	public void setRecvConnID(String connID) {
		this.recvConnID = connID;
	}

	public int getRecvTag() {
		return recvTag;
	}

	public void setRecvTag(int tag) {
		this.recvTag = tag;
	}
	
	public String getDestIP() {
		return destIP;
	}

	public void setDestIP(String destIP) {
		this.destIP = destIP;
	}

	public int getDestPort() {
		return destPort;
	}

	public void setDestPort(int destPort) {
		this.destPort = destPort;
	}

	public String getDestID() {
		return destID;
	}

	public void setDestID(String destID) {
		this.destID = destID;
	}
	
	public SendModeType getSendModeType() {
		return sendModeType;
	}

	public void setSendModeType(SendModeType sendModeType) {
		this.sendModeType = sendModeType;
	}

	public int getSendID() {
		return sendID;
	}

	public void setSendID(int sendID) {
		this.sendID = sendID;
	}

	public int getSendServerPort() {
		return sendServerPort;
	}

	public void setSendServerPort(int serverPort) {
		this.sendServerPort = serverPort;
	}

	public String getServiceClientIP() {
		return serviceClientIP;
	}

	public void setServiceClientIP(String serviceClientIP) {
		this.serviceClientIP = serviceClientIP;
	}

	public int getServiceClientPort() {
		return serviceClientPort;
	}

	public void setServiceClientPort(int serviceClientPort) {
		this.serviceClientPort = serviceClientPort;
	}

	public String getExceptIP() {
		return exceptIP;
	}

	public void setExceptIP(String exceptIP) {
		this.exceptIP = exceptIP;
	}

	public String getSendClientIP() {
		return sendClientIP;
	}

	public void setSendClientIP(String clientIP) {
		this.sendClientIP = clientIP;
	}

	public int getSendClientPort() {
		return sendClientPort;
	}

	public void setSendClientPort(int clientPort) {
		this.sendClientPort = clientPort;
	}

	public int getSerialPort() {
		return serialPort;
	}

	public void setSerialPort(int serialPort) {
		this.serialPort = serialPort;
	}
	
	public SocketType getRecvSocketType() {
		return recvSocketType;
	}

	public void setRecvSocketType(SocketType recvModeType) {
		this.recvSocketType = recvModeType;
	}

	public MsgObjVO getClone() {
		try {
			MsgObjVO vo = new MsgObjVO();

			vo.msgSeq			= this.msgSeq;
			vo.msg				= this.msg;
			vo.recvIP			= this.recvIP;
			vo.recvPort			= this.recvPort;;
			vo.recvID			= this.recvID;
			vo.recvTag			= this.recvTag;
			vo.recvDT			= this.recvDT;			
			vo.recvServerPort	= this.recvServerPort;
			vo.recvConnID		= this.recvConnID;
			vo.recvSocketType		= this.recvSocketType;
			vo.destIP			= this.destIP;
			vo.destPort			= this.destPort;
			vo.destID			= this.destID;
			
			vo.sendID 				= this.sendID;
			vo.sendServerPort		= this.sendServerPort;
			vo.serviceClientIP 		= this.serviceClientIP;
			vo.serviceClientPort	= this.serviceClientPort;
			vo.exceptIP 			= this.exceptIP;
			vo.sendClientIP 			= this.sendClientIP;
			vo.sendClientPort 			= this.sendClientPort;
			vo.serialPort 			= this.serialPort;
			vo.sendModeType 		= this.sendModeType;
			
			return vo;			
		} catch(Exception e) {
			return null;
		}		
	}

	
}
