Online Device status cache
This commit is contained in:
parent
38465e264e
commit
442ae6e4bf
|
@ -16,6 +16,7 @@ public interface PersistenceHandler {
|
|||
|
||||
String DEVICE_INFO_CACHE = "info:device:";
|
||||
String DEVICE_DATA_CACHE = "data:device:";
|
||||
String ONLINE_DEVICE_CACHE = "data:device:online";
|
||||
|
||||
void createTable(String tableName, Long deviceId);
|
||||
|
||||
|
|
|
@ -74,6 +74,8 @@ public class Redis2DBPersistenceService {
|
|||
if (Objects.nonNull(idGatewayMappingMap)) {
|
||||
operations.put(PersistenceHandler.DEVICE_DATA_CACHE + deviceId,
|
||||
"online", String.valueOf(idGatewayMappingMap.containsKey(deviceId)));
|
||||
operations.put(PersistenceHandler.ONLINE_DEVICE_CACHE, String.valueOf(deviceId),
|
||||
String.valueOf(idGatewayMappingMap.containsKey(deviceId)));
|
||||
}
|
||||
String modbusDeviceProductCode = (String) operations.get(
|
||||
PersistenceHandler.DEVICE_INFO_CACHE + deviceId, "modbus_device_product_code");
|
||||
|
|
Loading…
Reference in New Issue