Search in sources :

Example 1 with PluginRpcMsg

use of org.thingsboard.server.extensions.api.plugins.rpc.PluginRpcMsg in project thingsboard by thingsboard.

the class BasicRpcSessionListener method convert.

private static PluginRpcMsg convert(ServerAddress serverAddress, ClusterAPIProtos.ToPluginRpcMessage msg) {
    ClusterAPIProtos.PluginAddress address = msg.getAddress();
    TenantId tenantId = new TenantId(toUUID(address.getTenantId()));
    PluginId pluginId = new PluginId(toUUID(address.getPluginId()));
    RpcMsg rpcMsg = new RpcMsg(serverAddress, msg.getClazz(), msg.getData().toByteArray());
    return new PluginRpcMsg(tenantId, pluginId, rpcMsg);
}
Also used : TenantId(org.thingsboard.server.common.data.id.TenantId) ClusterAPIProtos(org.thingsboard.server.gen.cluster.ClusterAPIProtos) PluginRpcMsg(org.thingsboard.server.extensions.api.plugins.rpc.PluginRpcMsg) PluginRpcMsg(org.thingsboard.server.extensions.api.plugins.rpc.PluginRpcMsg) RpcMsg(org.thingsboard.server.extensions.api.plugins.rpc.RpcMsg) PluginId(org.thingsboard.server.common.data.id.PluginId)

Aggregations

PluginId (org.thingsboard.server.common.data.id.PluginId)1 TenantId (org.thingsboard.server.common.data.id.TenantId)1 PluginRpcMsg (org.thingsboard.server.extensions.api.plugins.rpc.PluginRpcMsg)1 RpcMsg (org.thingsboard.server.extensions.api.plugins.rpc.RpcMsg)1 ClusterAPIProtos (org.thingsboard.server.gen.cluster.ClusterAPIProtos)1