程序包 com.walker.tcp
接口 Response<T>
- 所有超级接口:
Serializable
- 所有已知实现类:
AbstractResponse,AbstractStringResponse,BaseResponse,EmptyResponse,HeartBeatResponse,HelloResponse,JsonResponse,LocationNowResponse,LoginResponse
定义TCP通信中响应规范
- 作者:
- 时克英
-
方法概要
修饰符和类型方法说明返回响应数据的分隔符,例如:# 或者 \r\ngetName()返回业务对应的请求终端ID,如:设备唯一ID等返回业务协议中,约定的协议名称,即:接口名称,如:001代表登录请求,002代表登录响应getTopic()返回消息主题名称,在集群模式中,需要该属性区分队列名称。voidsetBusinessContent(T content) 设置商业内容voidtoData()把响应对象转换成可传输的内容。
-
方法详细资料
-
getTopic
String getTopic()返回消息主题名称,在集群模式中,需要该属性区分队列名称。- 返回:
-
toData
T toData()把响应对象转换成可传输的内容。- 返回:
-
getName
String getName()返回业务对应的请求终端ID,如:设备唯一ID等- 返回:
-
getProtocolNum
String getProtocolNum()返回业务协议中,约定的协议名称,即:接口名称,如:001代表登录请求,002代表登录响应- 返回:
-
setBusinessContent
设置商业内容- 参数:
content-
-
getMessageId
String getMessageId() -
setName
-
getDelimiter
String getDelimiter()返回响应数据的分隔符,例如:# 或者 \r\n- 返回:
-