Search in sources :

Example 26 with EntityKey

use of org.thingsboard.server.common.data.query.EntityKey in project thingsboard by thingsboard.

the class BaseWebsocketApiTest method testEntityDataLatestAttrWsCmd.

@Test
public void testEntityDataLatestAttrWsCmd() throws Exception {
    Device device = new Device();
    device.setName("Device");
    device.setType("default");
    device.setLabel("testLabel" + (int) (Math.random() * 1000));
    device = doPost("/api/device", device, Device.class);
    long now = System.currentTimeMillis();
    DeviceTypeFilter dtf = new DeviceTypeFilter();
    dtf.setDeviceNameFilter("D");
    dtf.setDeviceType("default");
    EntityDataQuery edq = new EntityDataQuery(dtf, new EntityDataPageLink(1, 0, null, null), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    LatestValueCmd latestCmd = new LatestValueCmd();
    latestCmd.setKeys(Collections.singletonList(new EntityKey(EntityKeyType.SERVER_ATTRIBUTE, "serverAttributeKey")));
    EntityDataCmd cmd = new EntityDataCmd(1, edq, null, latestCmd, null);
    TelemetryPluginCmdsWrapper wrapper = new TelemetryPluginCmdsWrapper();
    wrapper.setEntityDataCmds(Collections.singletonList(cmd));
    wsClient.send(mapper.writeValueAsString(wrapper));
    String msg = wsClient.waitForReply();
    Assert.assertNotNull(msg);
    EntityDataUpdate update = mapper.readValue(msg, EntityDataUpdate.class);
    Assert.assertEquals(1, update.getCmdId());
    PageData<EntityData> pageData = update.getData();
    Assert.assertNotNull(pageData);
    Assert.assertEquals(1, pageData.getData().size());
    Assert.assertEquals(device.getId(), pageData.getData().get(0).getEntityId());
    Assert.assertNotNull(pageData.getData().get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE).get("serverAttributeKey"));
    Assert.assertEquals(0, pageData.getData().get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE).get("serverAttributeKey").getTs());
    Assert.assertEquals("", pageData.getData().get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE).get("serverAttributeKey").getValue());
    wsClient.registerWaitForUpdate();
    Thread.sleep(500);
    AttributeKvEntry dataPoint1 = new BaseAttributeKvEntry(now - TimeUnit.MINUTES.toMillis(1), new LongDataEntry("serverAttributeKey", 42L));
    List<AttributeKvEntry> tsData = Arrays.asList(dataPoint1);
    sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, tsData);
    msg = wsClient.waitForUpdate();
    Assert.assertNotNull(msg);
    update = mapper.readValue(msg, EntityDataUpdate.class);
    Assert.assertEquals(1, update.getCmdId());
    List<EntityData> listData = update.getUpdate();
    Assert.assertNotNull(listData);
    Assert.assertEquals(1, listData.size());
    Assert.assertEquals(device.getId(), listData.get(0).getEntityId());
    Assert.assertNotNull(listData.get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE));
    TsValue tsValue = listData.get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE).get("serverAttributeKey");
    Assert.assertEquals(new TsValue(dataPoint1.getLastUpdateTs(), dataPoint1.getValueAsString()), tsValue);
    now = System.currentTimeMillis();
    AttributeKvEntry dataPoint2 = new BaseAttributeKvEntry(now, new LongDataEntry("serverAttributeKey", 52L));
    wsClient.registerWaitForUpdate();
    Thread.sleep(500);
    sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Arrays.asList(dataPoint2));
    msg = wsClient.waitForUpdate();
    Assert.assertNotNull(msg);
    update = mapper.readValue(msg, EntityDataUpdate.class);
    Assert.assertEquals(1, update.getCmdId());
    List<EntityData> eData = update.getUpdate();
    Assert.assertNotNull(eData);
    Assert.assertEquals(1, eData.size());
    Assert.assertEquals(device.getId(), eData.get(0).getEntityId());
    Assert.assertNotNull(eData.get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE));
    tsValue = eData.get(0).getLatest().get(EntityKeyType.SERVER_ATTRIBUTE).get("serverAttributeKey");
    Assert.assertEquals(new TsValue(dataPoint2.getLastUpdateTs(), dataPoint2.getValueAsString()), tsValue);
    // Sending update from the past, while latest value has new timestamp;
    wsClient.registerWaitForUpdate();
    Thread.sleep(500);
    sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Arrays.asList(dataPoint1));
    msg = wsClient.waitForUpdate(TimeUnit.SECONDS.toMillis(1));
    Assert.assertNull(msg);
    // Sending duplicate update again
    wsClient.registerWaitForUpdate();
    Thread.sleep(500);
    sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Arrays.asList(dataPoint2));
    msg = wsClient.waitForUpdate(TimeUnit.SECONDS.toMillis(1));
    Assert.assertNull(msg);
}
Also used : TsValue(org.thingsboard.server.common.data.query.TsValue) AttributeKvEntry(org.thingsboard.server.common.data.kv.AttributeKvEntry) BaseAttributeKvEntry(org.thingsboard.server.common.data.kv.BaseAttributeKvEntry) Device(org.thingsboard.server.common.data.Device) DeviceTypeFilter(org.thingsboard.server.common.data.query.DeviceTypeFilter) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityDataUpdate(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate) EntityKey(org.thingsboard.server.common.data.query.EntityKey) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) LatestValueCmd(org.thingsboard.server.service.telemetry.cmd.v2.LatestValueCmd) EntityDataCmd(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd) BaseAttributeKvEntry(org.thingsboard.server.common.data.kv.BaseAttributeKvEntry) LongDataEntry(org.thingsboard.server.common.data.kv.LongDataEntry) TelemetryPluginCmdsWrapper(org.thingsboard.server.service.telemetry.cmd.TelemetryPluginCmdsWrapper) Test(org.junit.Test)

Example 27 with EntityKey

use of org.thingsboard.server.common.data.query.EntityKey in project thingsboard by thingsboard.

the class BaseAlarmServiceTest method testFindAlarmUsingAlarmDataQuery.

@Test
public void testFindAlarmUsingAlarmDataQuery() throws ExecutionException, InterruptedException {
    AssetId parentId = new AssetId(Uuids.timeBased());
    AssetId parentId2 = new AssetId(Uuids.timeBased());
    AssetId childId = new AssetId(Uuids.timeBased());
    EntityRelation relation = new EntityRelation(parentId, childId, EntityRelation.CONTAINS_TYPE);
    EntityRelation relation2 = new EntityRelation(parentId2, childId, EntityRelation.CONTAINS_TYPE);
    Assert.assertTrue(relationService.saveRelationAsync(tenantId, relation).get());
    Assert.assertTrue(relationService.saveRelationAsync(tenantId, relation2).get());
    long ts = System.currentTimeMillis();
    Alarm alarm = Alarm.builder().tenantId(tenantId).originator(childId).type(TEST_ALARM).propagate(false).severity(AlarmSeverity.CRITICAL).status(AlarmStatus.ACTIVE_UNACK).startTs(ts).build();
    AlarmOperationResult result = alarmService.createOrUpdateAlarm(alarm);
    Alarm created = result.getAlarm();
    AlarmDataPageLink pageLink = new AlarmDataPageLink();
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(false);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    PageData<AlarmData> alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(childId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, alarms.getData().get(0));
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(false);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(childId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, new Alarm(alarms.getData().get(0)));
    pageLink.setSearchPropagatedAlarms(true);
    alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(childId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, new Alarm(alarms.getData().get(0)));
    // Check child relation
    created.setPropagate(true);
    result = alarmService.createOrUpdateAlarm(created);
    created = result.getAlarm();
    // Check child relation
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(true);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(childId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, alarms.getData().get(0));
    // Check parent relation
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(true);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(parentId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, alarms.getData().get(0));
    PageData<AlarmInfo> alarmsInfoData = alarmService.findAlarms(tenantId, AlarmQuery.builder().affectedEntityId(childId).status(AlarmStatus.ACTIVE_UNACK).pageLink(new TimePageLink(10, 0, "", new SortOrder("createdTime", SortOrder.Direction.DESC), 0L, System.currentTimeMillis())).build()).get();
    Assert.assertNotNull(alarmsInfoData.getData());
    Assert.assertEquals(1, alarmsInfoData.getData().size());
    Assert.assertEquals(created, alarmsInfoData.getData().get(0));
    alarmsInfoData = alarmService.findAlarms(tenantId, AlarmQuery.builder().affectedEntityId(parentId).status(AlarmStatus.ACTIVE_UNACK).pageLink(new TimePageLink(10, 0, "", new SortOrder("createdTime", SortOrder.Direction.DESC), 0L, System.currentTimeMillis())).build()).get();
    Assert.assertNotNull(alarmsInfoData.getData());
    Assert.assertEquals(1, alarmsInfoData.getData().size());
    Assert.assertEquals(created, alarmsInfoData.getData().get(0));
    alarmsInfoData = alarmService.findAlarms(tenantId, AlarmQuery.builder().affectedEntityId(parentId2).status(AlarmStatus.ACTIVE_UNACK).pageLink(new TimePageLink(10, 0, "", new SortOrder("createdTime", SortOrder.Direction.DESC), 0L, System.currentTimeMillis())).build()).get();
    Assert.assertNotNull(alarmsInfoData.getData());
    Assert.assertEquals(1, alarmsInfoData.getData().size());
    Assert.assertEquals(created, alarmsInfoData.getData().get(0));
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(true);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(parentId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, alarms.getData().get(0));
    alarmService.ackAlarm(tenantId, created.getId(), System.currentTimeMillis()).get();
    created = alarmService.findAlarmByIdAsync(tenantId, created.getId()).get();
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(true);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    alarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(childId));
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(created, alarms.getData().get(0));
}
Also used : SortOrder(org.thingsboard.server.common.data.page.SortOrder) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) EntityRelation(org.thingsboard.server.common.data.relation.EntityRelation) EntityKey(org.thingsboard.server.common.data.query.EntityKey) Alarm(org.thingsboard.server.common.data.alarm.Alarm) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) AlarmInfo(org.thingsboard.server.common.data.alarm.AlarmInfo) TimePageLink(org.thingsboard.server.common.data.page.TimePageLink) AssetId(org.thingsboard.server.common.data.id.AssetId) AlarmOperationResult(org.thingsboard.server.dao.alarm.AlarmOperationResult) AlarmDataPageLink(org.thingsboard.server.common.data.query.AlarmDataPageLink) AlarmData(org.thingsboard.server.common.data.query.AlarmData) Test(org.junit.Test)

Example 28 with EntityKey

use of org.thingsboard.server.common.data.query.EntityKey in project thingsboard by thingsboard.

the class BaseAlarmServiceTest method testFindCustomerAlarm.

@Test
public void testFindCustomerAlarm() throws ExecutionException, InterruptedException {
    Customer customer = new Customer();
    customer.setTitle("TestCustomer");
    customer.setTenantId(tenantId);
    customer = customerService.saveCustomer(customer);
    Device tenantDevice = new Device();
    tenantDevice.setName("TestTenantDevice");
    tenantDevice.setType("default");
    tenantDevice.setTenantId(tenantId);
    tenantDevice = deviceService.saveDevice(tenantDevice);
    Device customerDevice = new Device();
    customerDevice.setName("TestCustomerDevice");
    customerDevice.setType("default");
    customerDevice.setTenantId(tenantId);
    customerDevice.setCustomerId(customer.getId());
    customerDevice = deviceService.saveDevice(customerDevice);
    long ts = System.currentTimeMillis();
    Alarm tenantAlarm = Alarm.builder().tenantId(tenantId).originator(tenantDevice.getId()).type(TEST_ALARM).propagate(true).severity(AlarmSeverity.CRITICAL).status(AlarmStatus.ACTIVE_UNACK).startTs(ts).build();
    AlarmOperationResult result = alarmService.createOrUpdateAlarm(tenantAlarm);
    tenantAlarm = result.getAlarm();
    Alarm deviceAlarm = Alarm.builder().tenantId(tenantId).originator(customerDevice.getId()).type(TEST_ALARM).propagate(true).severity(AlarmSeverity.CRITICAL).status(AlarmStatus.ACTIVE_UNACK).startTs(ts).build();
    result = alarmService.createOrUpdateAlarm(deviceAlarm);
    deviceAlarm = result.getAlarm();
    AlarmDataPageLink pageLink = new AlarmDataPageLink();
    pageLink.setPage(0);
    pageLink.setPageSize(10);
    pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "createdTime")));
    pageLink.setStartTs(0L);
    pageLink.setEndTs(System.currentTimeMillis());
    pageLink.setSearchPropagatedAlarms(true);
    pageLink.setSeverityList(Arrays.asList(AlarmSeverity.CRITICAL, AlarmSeverity.WARNING));
    pageLink.setStatusList(Arrays.asList(AlarmSearchStatus.ACTIVE));
    PageData<AlarmData> tenantAlarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Arrays.asList(tenantDevice.getId(), customerDevice.getId()));
    Assert.assertEquals(2, tenantAlarms.getData().size());
    PageData<AlarmData> customerAlarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(customerDevice.getId()));
    Assert.assertEquals(1, customerAlarms.getData().size());
    Assert.assertEquals(deviceAlarm, customerAlarms.getData().get(0));
    PageData<AlarmInfo> alarms = alarmService.findAlarms(tenantId, AlarmQuery.builder().affectedEntityId(tenantDevice.getId()).status(AlarmStatus.ACTIVE_UNACK).pageLink(new TimePageLink(10, 0, "", new SortOrder("createdTime", SortOrder.Direction.DESC), 0L, System.currentTimeMillis())).build()).get();
    Assert.assertNotNull(alarms.getData());
    Assert.assertEquals(1, alarms.getData().size());
    Assert.assertEquals(tenantAlarm, alarms.getData().get(0));
}
Also used : Customer(org.thingsboard.server.common.data.Customer) Device(org.thingsboard.server.common.data.Device) SortOrder(org.thingsboard.server.common.data.page.SortOrder) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) EntityKey(org.thingsboard.server.common.data.query.EntityKey) Alarm(org.thingsboard.server.common.data.alarm.Alarm) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) AlarmInfo(org.thingsboard.server.common.data.alarm.AlarmInfo) TimePageLink(org.thingsboard.server.common.data.page.TimePageLink) AlarmOperationResult(org.thingsboard.server.dao.alarm.AlarmOperationResult) AlarmDataPageLink(org.thingsboard.server.common.data.query.AlarmDataPageLink) AlarmData(org.thingsboard.server.common.data.query.AlarmData) Test(org.junit.Test)

Example 29 with EntityKey

use of org.thingsboard.server.common.data.query.EntityKey in project thingsboard by thingsboard.

the class EntityKeyMapping method prepareEntityCountKeyMapping.

public static List<EntityKeyMapping> prepareEntityCountKeyMapping(EntityCountQuery query) {
    Map<EntityKey, List<KeyFilter>> filters = query.getKeyFilters() != null ? query.getKeyFilters().stream().collect(Collectors.groupingBy(KeyFilter::getKey)) : Collections.emptyMap();
    int index = 2;
    List<EntityKeyMapping> mappings = new ArrayList<>();
    if (!filters.isEmpty()) {
        for (EntityKey filterField : filters.keySet()) {
            EntityKeyMapping mapping = new EntityKeyMapping();
            mapping.setIndex(index);
            mapping.setAlias(String.format("alias%s", index));
            mapping.setKeyFilters(filters.get(filterField));
            mapping.setLatest(!filterField.getType().equals(EntityKeyType.ENTITY_FIELD));
            mapping.setSelection(false);
            mapping.setEntityKey(filterField);
            mappings.add(mapping);
            index += 1;
        }
    }
    return mappings;
}
Also used : EntityKey(org.thingsboard.server.common.data.query.EntityKey) KeyFilter(org.thingsboard.server.common.data.query.KeyFilter) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 30 with EntityKey

use of org.thingsboard.server.common.data.query.EntityKey in project thingsboard by thingsboard.

the class EntityDataAdapter method toEntityData.

private static EntityData toEntityData(Map<String, Object> row, List<EntityKeyMapping> selectionMapping) {
    UUID id = (UUID) row.get("id");
    EntityType entityType = EntityType.valueOf((String) row.get("entity_type"));
    EntityId entityId = EntityIdFactory.getByTypeAndUuid(entityType, id);
    Map<EntityKeyType, Map<String, TsValue>> latest = new HashMap<>();
    Map<String, TsValue[]> timeseries = new HashMap<>();
    EntityData entityData = new EntityData(entityId, latest, timeseries);
    for (EntityKeyMapping mapping : selectionMapping) {
        if (!mapping.isIgnore()) {
            EntityKey entityKey = mapping.getEntityKey();
            Object value = row.get(mapping.getValueAlias());
            String strValue;
            long ts;
            if (entityKey.getType().equals(EntityKeyType.ENTITY_FIELD)) {
                strValue = value != null ? value.toString() : "";
                ts = System.currentTimeMillis();
            } else {
                strValue = convertValue(value);
                Object tsObject = row.get(mapping.getTsAlias());
                ts = tsObject != null ? Long.parseLong(tsObject.toString()) : 0;
            }
            TsValue tsValue = new TsValue(ts, strValue);
            latest.computeIfAbsent(entityKey.getType(), entityKeyType -> new HashMap<>()).put(entityKey.getKey(), tsValue);
        }
    }
    return entityData;
}
Also used : TsValue(org.thingsboard.server.common.data.query.TsValue) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) TsValue(org.thingsboard.server.common.data.query.TsValue) HashMap(java.util.HashMap) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) ByteBuffer(java.nio.ByteBuffer) EntityIdFactory(org.thingsboard.server.common.data.id.EntityIdFactory) List(java.util.List) PageData(org.thingsboard.server.common.data.page.PageData) Map(java.util.Map) NumberUtils(org.apache.commons.lang3.math.NumberUtils) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityType(org.thingsboard.server.common.data.EntityType) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) UUIDConverter(org.thingsboard.server.common.data.UUIDConverter) EntityKey(org.thingsboard.server.common.data.query.EntityKey) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) HashMap(java.util.HashMap) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityType(org.thingsboard.server.common.data.EntityType) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityKey(org.thingsboard.server.common.data.query.EntityKey) UUID(java.util.UUID) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

EntityKey (org.thingsboard.server.common.data.query.EntityKey)36 EntityDataQuery (org.thingsboard.server.common.data.query.EntityDataQuery)24 EntityData (org.thingsboard.server.common.data.query.EntityData)23 Test (org.junit.Test)22 Device (org.thingsboard.server.common.data.Device)22 EntityDataPageLink (org.thingsboard.server.common.data.query.EntityDataPageLink)22 ArrayList (java.util.ArrayList)21 EntityDataSortOrder (org.thingsboard.server.common.data.query.EntityDataSortOrder)21 List (java.util.List)19 DeviceTypeFilter (org.thingsboard.server.common.data.query.DeviceTypeFilter)19 EntityKeyType (org.thingsboard.server.common.data.query.EntityKeyType)19 KeyFilter (org.thingsboard.server.common.data.query.KeyFilter)19 HashMap (java.util.HashMap)16 Map (java.util.Map)16 Collectors (java.util.stream.Collectors)16 EntityId (org.thingsboard.server.common.data.id.EntityId)15 LongDataEntry (org.thingsboard.server.common.data.kv.LongDataEntry)15 PageData (org.thingsboard.server.common.data.page.PageData)15 NumericFilterPredicate (org.thingsboard.server.common.data.query.NumericFilterPredicate)15 EntityType (org.thingsboard.server.common.data.EntityType)14