Search in sources :

Example 1 with TransportToDeviceActorMsg

use of org.thingsboard.server.gen.transport.TransportProtos.TransportToDeviceActorMsg in project thingsboard by thingsboard.

the class DeviceActorMessageProcessor method process.

void process(TbActorCtx context, TransportToDeviceActorMsgWrapper wrapper) {
    TransportToDeviceActorMsg msg = wrapper.getMsg();
    TbCallback callback = wrapper.getCallback();
    var sessionInfo = msg.getSessionInfo();
    if (msg.hasSessionEvent()) {
        processSessionStateMsgs(sessionInfo, msg.getSessionEvent());
    }
    if (msg.hasSubscribeToAttributes()) {
        processSubscriptionCommands(context, sessionInfo, msg.getSubscribeToAttributes());
    }
    if (msg.hasSubscribeToRPC()) {
        processSubscriptionCommands(context, sessionInfo, msg.getSubscribeToRPC());
    }
    if (msg.hasSendPendingRPC()) {
        sendPendingRequests(context, getSessionId(sessionInfo), sessionInfo.getNodeId());
    }
    if (msg.hasGetAttributes()) {
        handleGetAttributesRequest(context, sessionInfo, msg.getGetAttributes());
    }
    if (msg.hasToDeviceRPCCallResponse()) {
        processRpcResponses(context, sessionInfo, msg.getToDeviceRPCCallResponse());
    }
    if (msg.hasSubscriptionInfo()) {
        handleSessionActivity(context, sessionInfo, msg.getSubscriptionInfo());
    }
    if (msg.hasClaimDevice()) {
        handleClaimDeviceMsg(context, sessionInfo, msg.getClaimDevice());
    }
    if (msg.hasRpcResponseStatusMsg()) {
        processRpcResponseStatus(context, sessionInfo, msg.getRpcResponseStatusMsg());
    }
    if (msg.hasUplinkNotificationMsg()) {
        processUplinkNotificationMsg(context, sessionInfo, msg.getUplinkNotificationMsg());
    }
    callback.onSuccess();
}
Also used : TbCallback(org.thingsboard.server.common.msg.queue.TbCallback) TransportToDeviceActorMsg(org.thingsboard.server.gen.transport.TransportProtos.TransportToDeviceActorMsg)

Aggregations

TbCallback (org.thingsboard.server.common.msg.queue.TbCallback)1 TransportToDeviceActorMsg (org.thingsboard.server.gen.transport.TransportProtos.TransportToDeviceActorMsg)1