Search in sources :

Example 1 with GatewaySessionCtx

use of org.thingsboard.server.transport.mqtt.session.GatewaySessionCtx in project thingsboard by thingsboard.

the class MqttTransportHandler method checkGatewaySession.

private void checkGatewaySession() {
    Device device = deviceSessionCtx.getDevice();
    JsonNode infoNode = device.getAdditionalInfo();
    if (infoNode != null) {
        JsonNode gatewayNode = infoNode.get("gateway");
        if (gatewayNode != null && gatewayNode.asBoolean()) {
            gatewaySessionCtx = new GatewaySessionCtx(processor, deviceService, authService, relationService, deviceSessionCtx);
        }
    }
}
Also used : Device(org.thingsboard.server.common.data.Device) GatewaySessionCtx(org.thingsboard.server.transport.mqtt.session.GatewaySessionCtx) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 Device (org.thingsboard.server.common.data.Device)1 GatewaySessionCtx (org.thingsboard.server.transport.mqtt.session.GatewaySessionCtx)1