All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.xiaobingzhou.messageframe.request.HandlerRequest Maven / Gradle / Ivy

package com.github.xiaobingzhou.messageframe.request;

import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.github.xiaobingzhou.messageframe.Dispatcher;
import com.github.xiaobingzhou.messageframe.IMessageFrame;
import com.github.xiaobingzhou.messageframe.handler.AbstractHandler;

/**
 * HandlerRequest接口,封装请求参数
* {@link Dispatcher} * {@link AbstractHandler} * @author bell.zhouxiaobing * @since 1.2 */ public interface HandlerRequest { /** * 解析过的消息帧 * @return IMessageFrame */ IMessageFrame getMessageFrame(); /** * 设备uuid * @return String */ String getDeviceId(); /** * 原始消息帧 * @return String */ String getMessage(); /** * 系统时间 * @return Date */ Date getSystemDate(); /** * 获取bodyJson * @return JSONObject */ JSONObject getBodyJson(); /** * 设置bodyJson */ void setBodyJson(JSONObject bodyJson); /** * 获取指令码 * @return * @since 1.6.3 */ default String getCommandCode() { IMessageFrame messageFrame = this.getMessageFrame(); return messageFrame == null ? null : messageFrame.getCommandCode(); } /** * 获取版本号 * @return * @since 1.6.3 */ default String getProtocolVer() { IMessageFrame messageFrame = this.getMessageFrame(); return messageFrame == null ? null : messageFrame.getProtocolVer(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy