package com.pingan.emall.biz.communication;
import com.pingan.emall.dto.MidRequestDTO;
import com.pingan.emall.dto.MidResponseDTO;
/**
* Tcp connector interface , define with connect , send and close
*
* @author LICHAO844
*
*/
public interface TcpConnector {
/**
* 随机抽取存活网关创建IoSession , 同步返回sessionId
* todo 修改connect返回类型为具体类型
* @return
*/
public Object connect();
/**
* 发送MidRequest请求, 同步返回MidResponseDTO
* @param sessionId
* @param message
* @return
* @throws Exception
*/
public MidResponseDTO send(Object sessionId, MidRequestDTO message) throws Exception;
public void close(Object sessionId);
}
import com.pingan.emall.dto.MidRequestDTO;
import com.pingan.emall.dto.MidResponseDTO;
/**
* Tcp connector interface , define with connect , send and close
*
* @author LICHAO844
*
*/
public interface TcpConnector {
/**
* 随机抽取存活网关创建IoSession , 同步返回sessionId
* todo 修改connect返回类型为具体类型
* @return
*/
public Object connect();
/**
* 发送MidRequest请求, 同步返回MidResponseDTO
* @param sessionId
* @param message
* @return
* @throws Exception
*/
public MidResponseDTO send(Object sessionId, MidRequestDTO message) throws Exception;
public void close(Object sessionId);
}