类 RequestMessageProcessor
- java.lang.Object
-
- network.nerve.core.rpc.netty.processor.RequestMessageProcessor
-
public class RequestMessageProcessor extends Object
消息处理器 Receive message processor- 作者:
- tag 2019/2/25
-
-
构造器概要
构造器 构造器 说明 RequestMessageProcessor()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidack(io.netty.channel.Channel channel, String messageId)确认收到Request Confirm receipt of Requeststatic voidcallCommands(Map requestMethods)处理Request,不返回结果 Processing Request, automatically calling the correct method, returning the resultstatic voidcallCommandsWithPeriod(io.netty.channel.Channel channel, Map requestMethods, String messageId, boolean isSubscribe)处理Request,自动调用正确的方法,返回结果 Processing Request, automatically calling the correct method, returning the resultstatic voidnegotiateConnectionResponse(io.netty.channel.Channel channel, Message message)确认握手成功 Confirm successful handshakestatic voidresponseWithEventCount(io.netty.channel.Channel channel, Response realResponse)处理Request,如果达到EventCount的发送条件,则发送 Processing Request, if EventCount's sending condition is met, then sendstatic booleanresponseWithPeriod(ConnectData channelData, Message message, Request request)处理Request,返回bool类型表示处理完之后是保留还是丢弃 After current processing, do need to keep the Request information and wait for the next processing?static voidserviceNotStarted(io.netty.channel.Channel channel, String messageId)服务还未启动完成 The service has not been started yet.static voidunsubscribe(ConnectData channelData, Message message)取消订阅 For Unsubscribe
-
-
-
方法详细资料
-
negotiateConnectionResponse
public static void negotiateConnectionResponse(io.netty.channel.Channel channel, Message message) throws com.fasterxml.jackson.core.JsonProcessingException确认握手成功 Confirm successful handshake- 参数:
channel- 用于发送消息 / Used to send message- 抛出:
com.fasterxml.jackson.core.JsonProcessingException- JSON解析错误 / JSON parsing error
-
ack
public static void ack(io.netty.channel.Channel channel, String messageId) throws com.fasterxml.jackson.core.JsonProcessingException确认收到Request Confirm receipt of Request- 参数:
channel- 用于发送消息 / Used to send messagemessageId- 原始消息ID / The origin message ID- 抛出:
com.fasterxml.jackson.core.JsonProcessingException- JSON解析错误 / JSON parsing error
-
serviceNotStarted
public static void serviceNotStarted(io.netty.channel.Channel channel, String messageId) throws com.fasterxml.jackson.core.JsonProcessingException服务还未启动完成 The service has not been started yet.- 参数:
channel- 链接通道messageId- 请求ID- 抛出:
com.fasterxml.jackson.core.JsonProcessingException
-
unsubscribe
public static void unsubscribe(ConnectData channelData, Message message)
取消订阅 For Unsubscribe- 参数:
message- 取消订阅的消息体 / Unsubscribe message
-
responseWithPeriod
public static boolean responseWithPeriod(ConnectData channelData, Message message, Request request)
处理Request,返回bool类型表示处理完之后是保留还是丢弃 After current processing, do need to keep the Request information and wait for the next processing? True: keep, False: remove- 参数:
channelData- 用于发送消息 / Used to send messagemessage- 原始消息 / The origin messagerequest- 请求 / The request- 返回:
- boolean
-
callCommandsWithPeriod
public static void callCommandsWithPeriod(io.netty.channel.Channel channel, Map requestMethods, String messageId, boolean isSubscribe) throws com.fasterxml.jackson.core.JsonProcessingException处理Request,自动调用正确的方法,返回结果 Processing Request, automatically calling the correct method, returning the result- 参数:
channel- 用于发送消息 / Used to send messagerequestMethods- 请求的方法集合 / The collections of request methodmessageId- 原始消息ID / The origin message IDisSubscribe- is subscribe message- 抛出:
com.fasterxml.jackson.core.JsonProcessingException- 服务器端处理异常
-
callCommands
public static void callCommands(Map requestMethods) throws com.fasterxml.jackson.core.JsonProcessingException
处理Request,不返回结果 Processing Request, automatically calling the correct method, returning the result- 参数:
requestMethods- 请求的方法集合 / The collections of request method- 抛出:
com.fasterxml.jackson.core.JsonProcessingException- 服务器端处理异常
-
responseWithEventCount
public static void responseWithEventCount(io.netty.channel.Channel channel, Response realResponse)处理Request,如果达到EventCount的发送条件,则发送 Processing Request, if EventCount's sending condition is met, then send- 参数:
channel- 用于发送消息 / Used to send messagerealResponse- 订阅事件触发,返回数据
-
-