Search in sources :

Example 1 with DeviceNameOrTypeUpdateMsg

use of org.thingsboard.server.extensions.api.device.DeviceNameOrTypeUpdateMsg in project thingsboard by thingsboard.

the class DefaultActorService method onDeviceNameOrTypeUpdate.

@Override
public void onDeviceNameOrTypeUpdate(TenantId tenantId, DeviceId deviceId, String deviceName, String deviceType) {
    log.trace("[{}] Processing onDeviceNameOrTypeUpdate event, deviceName: {}, deviceType: {}", deviceId, deviceName, deviceType);
    DeviceNameOrTypeUpdateMsg msg = new DeviceNameOrTypeUpdateMsg(tenantId, deviceId, deviceName, deviceType);
    Optional<ServerAddress> address = actorContext.getRoutingService().resolveById(deviceId);
    if (address.isPresent()) {
        rpcService.tell(address.get(), msg);
    } else {
        onMsg(msg);
    }
}
Also used : ServerAddress(org.thingsboard.server.common.msg.cluster.ServerAddress) DeviceNameOrTypeUpdateMsg(org.thingsboard.server.extensions.api.device.DeviceNameOrTypeUpdateMsg)

Aggregations

ServerAddress (org.thingsboard.server.common.msg.cluster.ServerAddress)1 DeviceNameOrTypeUpdateMsg (org.thingsboard.server.extensions.api.device.DeviceNameOrTypeUpdateMsg)1