Search in sources :

Example 71 with TbMsgMetaData

use of org.thingsboard.server.common.msg.TbMsgMetaData in project thingsboard by thingsboard.

the class TbDeviceProfileNodeTest method testTenantInheritModeForDynamicValues.

@Test
public void testTenantInheritModeForDynamicValues() throws Exception {
    init();
    DeviceProfile deviceProfile = new DeviceProfile();
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    AttributeKvCompositeKey compositeKey = new AttributeKvCompositeKey(EntityType.TENANT, deviceId.getId(), "SERVER_SCOPE", "tenantAttribute");
    Device device = new Device();
    device.setId(deviceId);
    device.setCustomerId(customerId);
    AttributeKvEntity attributeKvEntity = new AttributeKvEntity();
    attributeKvEntity.setId(compositeKey);
    attributeKvEntity.setLongValue(100L);
    attributeKvEntity.setLastUpdateTs(0L);
    AttributeKvEntry entry = attributeKvEntity.toData();
    ListenableFuture<List<AttributeKvEntry>> listListenableFutureWithLess = Futures.immediateFuture(Collections.emptyList());
    ListenableFuture<Optional<AttributeKvEntry>> emptyOptionalFuture = Futures.immediateFuture(Optional.empty());
    ListenableFuture<Optional<AttributeKvEntry>> optionalListenableFutureWithLess = Futures.immediateFuture(Optional.of(entry));
    AlarmConditionFilter lowTempFilter = new AlarmConditionFilter();
    lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature"));
    lowTempFilter.setValueType(EntityKeyValueType.NUMERIC);
    NumericFilterPredicate lowTempPredicate = new NumericFilterPredicate();
    lowTempPredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER);
    lowTempPredicate.setValue(new FilterPredicateValue<>(0.0, null, new DynamicValue<>(DynamicValueSourceType.CURRENT_DEVICE, "tenantAttribute", true)));
    lowTempFilter.setPredicate(lowTempPredicate);
    AlarmCondition alarmCondition = new AlarmCondition();
    alarmCondition.setCondition(Collections.singletonList(lowTempFilter));
    AlarmRule alarmRule = new AlarmRule();
    alarmRule.setCondition(alarmCondition);
    DeviceProfileAlarm dpa = new DeviceProfileAlarm();
    dpa.setId("lesstempID");
    dpa.setAlarmType("lessTemperatureAlarm");
    dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule)));
    deviceProfileData.setAlarms(Collections.singletonList(dpa));
    deviceProfile.setProfileData(deviceProfileData);
    Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile);
    Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))).thenReturn(Futures.immediateFuture(Collections.emptyList()));
    Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "lessTemperatureAlarm")).thenReturn(Futures.immediateFuture(null));
    Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg());
    Mockito.when(ctx.getAttributesService()).thenReturn(attributesService);
    Mockito.when(ctx.getDeviceService().findDeviceById(tenantId, deviceId)).thenReturn(device);
    Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())).thenReturn(listListenableFutureWithLess);
    Mockito.when(attributesService.find(eq(tenantId), eq(customerId), Mockito.anyString(), Mockito.anyString())).thenReturn(emptyOptionalFuture);
    Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), eq(DataConstants.SERVER_SCOPE), Mockito.anyString())).thenReturn(optionalListenableFutureWithLess);
    TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), "");
    Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyString())).thenReturn(theMsg);
    ObjectNode data = mapper.createObjectNode();
    data.put("temperature", 150L);
    TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg);
    verify(ctx).tellSuccess(msg);
    verify(ctx).enqueueForTellNext(theMsg, "Alarm Created");
    verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any());
}
Also used : AttributeKvEntry(org.thingsboard.server.common.data.kv.AttributeKvEntry) Optional(java.util.Optional) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) AttributeKvEntity(org.thingsboard.server.dao.model.sql.AttributeKvEntity) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) Device(org.thingsboard.server.common.data.Device) AlarmRule(org.thingsboard.server.common.data.device.profile.AlarmRule) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) AlarmConditionFilter(org.thingsboard.server.common.data.device.profile.AlarmConditionFilter) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) AlarmCondition(org.thingsboard.server.common.data.device.profile.AlarmCondition) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) List(java.util.List) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) AlarmConditionFilterKey(org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey) AttributeKvCompositeKey(org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey) DynamicValue(org.thingsboard.server.common.data.query.DynamicValue) TbMsg(org.thingsboard.server.common.msg.TbMsg) Test(org.junit.Test)

Example 72 with TbMsgMetaData

use of org.thingsboard.server.common.msg.TbMsgMetaData in project thingsboard by thingsboard.

the class TbDeviceProfileNodeTest method testCustomerInheritModeForDynamicValues.

@Test
public void testCustomerInheritModeForDynamicValues() throws Exception {
    init();
    DeviceProfile deviceProfile = new DeviceProfile();
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    AttributeKvCompositeKey compositeKey = new AttributeKvCompositeKey(EntityType.DEVICE, deviceId.getId(), EntityKeyType.SERVER_ATTRIBUTE.name(), "tenantAttribute");
    Device device = new Device();
    device.setId(deviceId);
    device.setCustomerId(customerId);
    AttributeKvEntity attributeKvEntity = new AttributeKvEntity();
    attributeKvEntity.setId(compositeKey);
    attributeKvEntity.setLongValue(100L);
    attributeKvEntity.setLastUpdateTs(0L);
    AttributeKvEntry entry = attributeKvEntity.toData();
    ListenableFuture<List<AttributeKvEntry>> listListenableFutureWithLess = Futures.immediateFuture(Collections.emptyList());
    ListenableFuture<Optional<AttributeKvEntry>> emptyOptionalFuture = Futures.immediateFuture(Optional.empty());
    ListenableFuture<Optional<AttributeKvEntry>> optionalListenableFutureWithLess = Futures.immediateFuture(Optional.of(entry));
    AlarmConditionFilter lowTempFilter = new AlarmConditionFilter();
    lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature"));
    lowTempFilter.setValueType(EntityKeyValueType.NUMERIC);
    NumericFilterPredicate lowTempPredicate = new NumericFilterPredicate();
    lowTempPredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER);
    lowTempPredicate.setValue(new FilterPredicateValue<>(0.0, null, new DynamicValue<>(DynamicValueSourceType.CURRENT_CUSTOMER, "tenantAttribute", true)));
    lowTempFilter.setPredicate(lowTempPredicate);
    AlarmCondition alarmCondition = new AlarmCondition();
    alarmCondition.setCondition(Collections.singletonList(lowTempFilter));
    AlarmRule alarmRule = new AlarmRule();
    alarmRule.setCondition(alarmCondition);
    DeviceProfileAlarm dpa = new DeviceProfileAlarm();
    dpa.setId("lesstempID");
    dpa.setAlarmType("greaterTemperatureAlarm");
    dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule)));
    deviceProfileData.setAlarms(Collections.singletonList(dpa));
    deviceProfile.setProfileData(deviceProfileData);
    Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile);
    Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))).thenReturn(Futures.immediateFuture(Collections.emptyList()));
    Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "greaterTemperatureAlarm")).thenReturn(Futures.immediateFuture(null));
    Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg());
    Mockito.when(ctx.getAttributesService()).thenReturn(attributesService);
    Mockito.when(ctx.getDeviceService().findDeviceById(tenantId, deviceId)).thenReturn(device);
    Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())).thenReturn(listListenableFutureWithLess);
    Mockito.when(attributesService.find(eq(tenantId), eq(customerId), Mockito.anyString(), Mockito.anyString())).thenReturn(emptyOptionalFuture);
    Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), eq(DataConstants.SERVER_SCOPE), Mockito.anyString())).thenReturn(optionalListenableFutureWithLess);
    TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), "");
    Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyString())).thenReturn(theMsg);
    ObjectNode data = mapper.createObjectNode();
    data.put("temperature", 150L);
    TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg);
    verify(ctx).tellSuccess(msg);
    verify(ctx).enqueueForTellNext(theMsg, "Alarm Created");
    verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any());
}
Also used : AttributeKvEntry(org.thingsboard.server.common.data.kv.AttributeKvEntry) Optional(java.util.Optional) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) AttributeKvEntity(org.thingsboard.server.dao.model.sql.AttributeKvEntity) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) Device(org.thingsboard.server.common.data.Device) AlarmRule(org.thingsboard.server.common.data.device.profile.AlarmRule) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) AlarmConditionFilter(org.thingsboard.server.common.data.device.profile.AlarmConditionFilter) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) AlarmCondition(org.thingsboard.server.common.data.device.profile.AlarmCondition) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) List(java.util.List) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) AlarmConditionFilterKey(org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey) AttributeKvCompositeKey(org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey) DynamicValue(org.thingsboard.server.common.data.query.DynamicValue) TbMsg(org.thingsboard.server.common.msg.TbMsg) Test(org.junit.Test)

Example 73 with TbMsgMetaData

use of org.thingsboard.server.common.msg.TbMsgMetaData in project thingsboard by thingsboard.

the class TbDeviceProfileNodeTest method testEmptyProfile.

@Test
public void testEmptyProfile() throws Exception {
    init();
    DeviceProfile deviceProfile = new DeviceProfile();
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    deviceProfileData.setAlarms(Collections.emptyList());
    deviceProfile.setProfileData(deviceProfileData);
    Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile);
    ObjectNode data = mapper.createObjectNode();
    data.put("temperature", 42);
    TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg);
    verify(ctx).tellSuccess(msg);
    verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any());
}
Also used : DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) TbMsg(org.thingsboard.server.common.msg.TbMsg) Test(org.junit.Test)

Example 74 with TbMsgMetaData

use of org.thingsboard.server.common.msg.TbMsgMetaData in project thingsboard by thingsboard.

the class TbDeviceProfileNodeTest method testAlarmCreate.

@Test
public void testAlarmCreate() throws Exception {
    init();
    DeviceProfile deviceProfile = new DeviceProfile();
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    AlarmConditionFilter highTempFilter = new AlarmConditionFilter();
    highTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature"));
    highTempFilter.setValueType(EntityKeyValueType.NUMERIC);
    NumericFilterPredicate highTemperaturePredicate = new NumericFilterPredicate();
    highTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER);
    highTemperaturePredicate.setValue(new FilterPredicateValue<>(30.0));
    highTempFilter.setPredicate(highTemperaturePredicate);
    AlarmCondition alarmCondition = new AlarmCondition();
    alarmCondition.setCondition(Collections.singletonList(highTempFilter));
    AlarmRule alarmRule = new AlarmRule();
    alarmRule.setCondition(alarmCondition);
    DeviceProfileAlarm dpa = new DeviceProfileAlarm();
    dpa.setId("highTemperatureAlarmID");
    dpa.setAlarmType("highTemperatureAlarm");
    dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule)));
    AlarmConditionFilter lowTempFilter = new AlarmConditionFilter();
    lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature"));
    lowTempFilter.setValueType(EntityKeyValueType.NUMERIC);
    NumericFilterPredicate lowTemperaturePredicate = new NumericFilterPredicate();
    lowTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.LESS);
    lowTemperaturePredicate.setValue(new FilterPredicateValue<>(10.0));
    lowTempFilter.setPredicate(lowTemperaturePredicate);
    AlarmRule clearRule = new AlarmRule();
    AlarmCondition clearCondition = new AlarmCondition();
    clearCondition.setCondition(Collections.singletonList(lowTempFilter));
    clearRule.setCondition(clearCondition);
    dpa.setClearRule(clearRule);
    deviceProfileData.setAlarms(Collections.singletonList(dpa));
    deviceProfile.setProfileData(deviceProfileData);
    Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile);
    Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))).thenReturn(Futures.immediateFuture(Collections.emptyList()));
    Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "highTemperatureAlarm")).thenReturn(Futures.immediateFuture(null));
    Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg());
    TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), "");
    Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyString())).thenReturn(theMsg);
    ObjectNode data = mapper.createObjectNode();
    data.put("temperature", 42);
    TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg);
    verify(ctx).tellSuccess(msg);
    verify(ctx).enqueueForTellNext(theMsg, "Alarm Created");
    verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any());
    TbMsg theMsg2 = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), "2");
    Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyString())).thenReturn(theMsg2);
    TbMsg msg2 = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg2);
    verify(ctx).tellSuccess(msg2);
    verify(ctx).enqueueForTellNext(theMsg2, "Alarm Updated");
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) AlarmRule(org.thingsboard.server.common.data.device.profile.AlarmRule) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) AlarmConditionFilter(org.thingsboard.server.common.data.device.profile.AlarmConditionFilter) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) AlarmCondition(org.thingsboard.server.common.data.device.profile.AlarmCondition) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) AlarmConditionFilterKey(org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey) TbMsg(org.thingsboard.server.common.msg.TbMsg) Test(org.junit.Test)

Example 75 with TbMsgMetaData

use of org.thingsboard.server.common.msg.TbMsgMetaData in project thingsboard by thingsboard.

the class TbDeviceProfileNodeTest method testCurrentDeviceAttributeForDynamicValue.

@Test
public void testCurrentDeviceAttributeForDynamicValue() throws Exception {
    init();
    DeviceProfile deviceProfile = new DeviceProfile();
    deviceProfile.setId(deviceProfileId);
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    AttributeKvCompositeKey compositeKey = new AttributeKvCompositeKey(EntityType.TENANT, deviceId.getId(), "SERVER_SCOPE", "greaterAttribute");
    AttributeKvEntity attributeKvEntity = new AttributeKvEntity();
    attributeKvEntity.setId(compositeKey);
    attributeKvEntity.setLongValue(30L);
    attributeKvEntity.setLastUpdateTs(0L);
    AttributeKvEntry entry = attributeKvEntity.toData();
    ListenableFuture<List<AttributeKvEntry>> listListenableFutureWithLess = Futures.immediateFuture(Collections.singletonList(entry));
    AlarmConditionFilter highTempFilter = new AlarmConditionFilter();
    highTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature"));
    highTempFilter.setValueType(EntityKeyValueType.NUMERIC);
    NumericFilterPredicate highTemperaturePredicate = new NumericFilterPredicate();
    highTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER);
    highTemperaturePredicate.setValue(new FilterPredicateValue<>(0.0, null, new DynamicValue<>(DynamicValueSourceType.CURRENT_DEVICE, "greaterAttribute")));
    highTempFilter.setPredicate(highTemperaturePredicate);
    AlarmCondition alarmCondition = new AlarmCondition();
    alarmCondition.setCondition(Collections.singletonList(highTempFilter));
    AlarmRule alarmRule = new AlarmRule();
    alarmRule.setCondition(alarmCondition);
    DeviceProfileAlarm dpa = new DeviceProfileAlarm();
    dpa.setId("highTemperatureAlarmID");
    dpa.setAlarmType("highTemperatureAlarm");
    dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule)));
    deviceProfileData.setAlarms(Collections.singletonList(dpa));
    deviceProfile.setProfileData(deviceProfileData);
    Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile);
    Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))).thenReturn(Futures.immediateFuture(Collections.emptyList()));
    Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "highTemperatureAlarm")).thenReturn(Futures.immediateFuture(null));
    Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg());
    Mockito.when(ctx.getAttributesService()).thenReturn(attributesService);
    Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())).thenReturn(listListenableFutureWithLess);
    TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), "");
    Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyString())).thenReturn(theMsg);
    ObjectNode data = mapper.createObjectNode();
    data.put("temperature", 35);
    TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg);
    verify(ctx).tellSuccess(msg);
    verify(ctx).enqueueForTellNext(theMsg, "Alarm Created");
    verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any());
}
Also used : AttributeKvEntry(org.thingsboard.server.common.data.kv.AttributeKvEntry) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) AttributeKvEntity(org.thingsboard.server.dao.model.sql.AttributeKvEntity) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) AlarmRule(org.thingsboard.server.common.data.device.profile.AlarmRule) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) AlarmConditionFilter(org.thingsboard.server.common.data.device.profile.AlarmConditionFilter) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) AlarmCondition(org.thingsboard.server.common.data.device.profile.AlarmCondition) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) List(java.util.List) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) AlarmConditionFilterKey(org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey) AttributeKvCompositeKey(org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey) DynamicValue(org.thingsboard.server.common.data.query.DynamicValue) TbMsg(org.thingsboard.server.common.msg.TbMsg) Test(org.junit.Test)

Aggregations

TbMsgMetaData (org.thingsboard.server.common.msg.TbMsgMetaData)89 TbMsg (org.thingsboard.server.common.msg.TbMsg)56 Test (org.junit.Test)49 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)26 Device (org.thingsboard.server.common.data.Device)17 DeviceProfile (org.thingsboard.server.common.data.DeviceProfile)17 List (java.util.List)16 DeviceProfileData (org.thingsboard.server.common.data.device.profile.DeviceProfileData)16 DeviceId (org.thingsboard.server.common.data.id.DeviceId)15 EntityId (org.thingsboard.server.common.data.id.EntityId)15 AlarmCondition (org.thingsboard.server.common.data.device.profile.AlarmCondition)14 AlarmConditionFilter (org.thingsboard.server.common.data.device.profile.AlarmConditionFilter)14 AlarmConditionFilterKey (org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey)14 AlarmRule (org.thingsboard.server.common.data.device.profile.AlarmRule)14 DeviceProfileAlarm (org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm)14 AttributeKvEntry (org.thingsboard.server.common.data.kv.AttributeKvEntry)14 NumericFilterPredicate (org.thingsboard.server.common.data.query.NumericFilterPredicate)14 JsonNode (com.fasterxml.jackson.databind.JsonNode)13 DynamicValue (org.thingsboard.server.common.data.query.DynamicValue)13 AttributeKvCompositeKey (org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey)13