Search in sources :

Example 6 with EntityKeyType

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

the class TbEntityDataSubCtx method sendLatestWsMsg.

private void sendLatestWsMsg(EntityId entityId, String sessionId, TelemetrySubscriptionUpdate subscriptionUpdate, EntityKeyType keyType) {
    Map<String, TsValue> latestUpdate = new HashMap<>();
    subscriptionUpdate.getData().forEach((k, v) -> {
        Object[] data = (Object[]) v.get(0);
        latestUpdate.put(k, new TsValue((Long) data[0], (String) data[1]));
    });
    EntityData entityData = getDataForEntity(entityId);
    if (entityData != null && entityData.getLatest() != null) {
        Map<String, TsValue> latestCtxValues = entityData.getLatest().get(keyType);
        log.trace("[{}][{}][{}] Going to compare update with {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), latestCtxValues);
        if (latestCtxValues != null) {
            latestCtxValues.forEach((k, v) -> {
                TsValue update = latestUpdate.get(k);
                if (update != null) {
                    // Ignore notifications about deleted keys
                    if (!(update.getTs() == 0 && (update.getValue() == null || update.getValue().isEmpty()))) {
                        if (update.getTs() < v.getTs()) {
                            log.trace("[{}][{}][{}] Removed stale update for key: {} and ts: {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), k, update.getTs());
                            latestUpdate.remove(k);
                        } else if ((update.getTs() == v.getTs() && update.getValue().equals(v.getValue()))) {
                            log.trace("[{}][{}][{}] Removed duplicate update for key: {} and ts: {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), k, update.getTs());
                            latestUpdate.remove(k);
                        }
                    } else {
                        log.trace("[{}][{}][{}] Received deleted notification for: {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), k);
                    }
                }
            });
            // Setting new values
            latestUpdate.forEach(latestCtxValues::put);
        }
    }
    if (!latestUpdate.isEmpty()) {
        Map<EntityKeyType, Map<String, TsValue>> latestMap = Collections.singletonMap(keyType, latestUpdate);
        entityData = new EntityData(entityId, latestMap, null);
        wsService.sendWsMsg(sessionId, new EntityDataUpdate(cmdId, null, Collections.singletonList(entityData), maxEntitiesPerDataSubscription));
    }
}
Also used : TsValue(org.thingsboard.server.common.data.query.TsValue) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) HashMap(java.util.HashMap) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityDataUpdate(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate) HashMap(java.util.HashMap) Map(java.util.Map)

Example 7 with EntityKeyType

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

the class TbEntityDataSubCtx method doUpdate.

@Override
public synchronized void doUpdate(Map<EntityId, EntityData> newDataMap) {
    List<Integer> subIdsToCancel = new ArrayList<>();
    List<TbSubscription> subsToAdd = new ArrayList<>();
    Set<EntityId> currentSubs = new HashSet<>();
    subToEntityIdMap.forEach((subId, entityId) -> {
        if (!newDataMap.containsKey(entityId)) {
            subIdsToCancel.add(subId);
        } else {
            currentSubs.add(entityId);
        }
    });
    log.trace("[{}][{}] Subscriptions that are invalid: {}", sessionRef.getSessionId(), cmdId, subIdsToCancel);
    subIdsToCancel.forEach(subToEntityIdMap::remove);
    List<EntityData> newSubsList = newDataMap.entrySet().stream().filter(entry -> !currentSubs.contains(entry.getKey())).map(Map.Entry::getValue).collect(Collectors.toList());
    if (!newSubsList.isEmpty()) {
        // NOTE: We ignore the TS subscriptions for new entities here, because widgets will re-init it's content and will create new subscriptions.
        if (curTsCmd == null && latestValueCmd != null) {
            List<EntityKey> keys = latestValueCmd.getKeys();
            if (keys != null && !keys.isEmpty()) {
                Map<EntityKeyType, List<EntityKey>> keysByType = getEntityKeyByTypeMap(keys);
                newSubsList.forEach(entity -> {
                    log.trace("[{}][{}] Found new subscription for entity: {}", sessionRef.getSessionId(), cmdId, entity.getEntityId());
                    subsToAdd.addAll(addSubscriptions(entity, keysByType, true, 0, 0));
                });
            }
        }
    }
    wsService.sendWsMsg(sessionRef.getSessionId(), new EntityDataUpdate(cmdId, data, null, maxEntitiesPerDataSubscription));
    subIdsToCancel.forEach(subId -> localSubscriptionService.cancelSubscription(getSessionId(), subId));
    subsToAdd.forEach(localSubscriptionService::addSubscription);
}
Also used : EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) ArrayList(java.util.ArrayList) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityDataUpdate(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate) EntityKey(org.thingsboard.server.common.data.query.EntityKey) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 8 with EntityKeyType

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

the class TbEntityDataSubCtx method sendTsWsMsg.

private void sendTsWsMsg(EntityId entityId, String sessionId, TelemetrySubscriptionUpdate subscriptionUpdate, EntityKeyType keyType) {
    Map<String, List<TsValue>> tsUpdate = new HashMap<>();
    subscriptionUpdate.getData().forEach((k, v) -> {
        Object[] data = (Object[]) v.get(0);
        tsUpdate.computeIfAbsent(k, key -> new ArrayList<>()).add(new TsValue((Long) data[0], (String) data[1]));
    });
    EntityData entityData = getDataForEntity(entityId);
    if (entityData != null && entityData.getLatest() != null) {
        Map<String, TsValue> latestCtxValues = entityData.getLatest().get(keyType);
        log.trace("[{}][{}][{}] Going to compare update with {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), latestCtxValues);
        if (latestCtxValues != null) {
            latestCtxValues.forEach((k, v) -> {
                List<TsValue> updateList = tsUpdate.get(k);
                if (updateList != null) {
                    for (TsValue update : new ArrayList<>(updateList)) {
                        if (update.getTs() < v.getTs()) {
                            log.trace("[{}][{}][{}] Removed stale update for key: {} and ts: {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), k, update.getTs());
                        // Looks like this is redundant feature and our UI is ready to merge the updates.
                        // updateList.remove(update);
                        } else if ((update.getTs() == v.getTs() && update.getValue().equals(v.getValue()))) {
                            log.trace("[{}][{}][{}] Removed duplicate update for key: {} and ts: {}", sessionId, cmdId, subscriptionUpdate.getSubscriptionId(), k, update.getTs());
                            updateList.remove(update);
                        }
                        if (updateList.isEmpty()) {
                            tsUpdate.remove(k);
                        }
                    }
                }
            });
            // Setting new values
            tsUpdate.forEach((k, v) -> {
                Optional<TsValue> maxValue = v.stream().max(Comparator.comparingLong(TsValue::getTs));
                maxValue.ifPresent(max -> latestCtxValues.put(k, max));
            });
        }
    }
    if (!tsUpdate.isEmpty()) {
        Map<String, TsValue[]> tsMap = new HashMap<>();
        tsUpdate.forEach((key, tsValue) -> tsMap.put(key, tsValue.toArray(new TsValue[tsValue.size()])));
        entityData = new EntityData(entityId, null, tsMap);
        wsService.sendWsMsg(sessionId, new EntityDataUpdate(cmdId, null, Collections.singletonList(entityData), maxEntitiesPerDataSubscription));
    }
}
Also used : Setter(lombok.Setter) Getter(lombok.Getter) TsValue(org.thingsboard.server.common.data.query.TsValue) LatestValueCmd(org.thingsboard.server.service.telemetry.cmd.v2.LatestValueCmd) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) EntityDataCmd(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd) Map(java.util.Map) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityService(org.thingsboard.server.dao.entity.EntityService) TimeSeriesCmd(org.thingsboard.server.service.telemetry.cmd.v2.TimeSeriesCmd) EntityKey(org.thingsboard.server.common.data.query.EntityKey) AttributesService(org.thingsboard.server.dao.attributes.AttributesService) EntityDataUpdate(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) Set(java.util.Set) TelemetryWebSocketSessionRef(org.thingsboard.server.service.telemetry.TelemetryWebSocketSessionRef) Collectors(java.util.stream.Collectors) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) Optional(java.util.Optional) TelemetrySubscriptionUpdate(org.thingsboard.server.service.telemetry.sub.TelemetrySubscriptionUpdate) Comparator(java.util.Comparator) TelemetryWebSocketService(org.thingsboard.server.service.telemetry.TelemetryWebSocketService) Collections(java.util.Collections) TsValue(org.thingsboard.server.common.data.query.TsValue) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityDataUpdate(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate) ArrayList(java.util.ArrayList) List(java.util.List)

Example 9 with EntityKeyType

use of org.thingsboard.server.common.data.query.EntityKeyType 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)

Example 10 with EntityKeyType

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

the class BaseEntityServiceTest method testFindEntityDataByQueryWithAttributes.

@Test
public void testFindEntityDataByQueryWithAttributes() throws ExecutionException, InterruptedException {
    List<EntityKeyType> attributesEntityTypes = new ArrayList<>(Arrays.asList(EntityKeyType.CLIENT_ATTRIBUTE, EntityKeyType.SHARED_ATTRIBUTE, EntityKeyType.SERVER_ATTRIBUTE));
    List<Device> devices = new ArrayList<>();
    List<Long> temperatures = new ArrayList<>();
    List<Long> highTemperatures = new ArrayList<>();
    for (int i = 0; i < 67; i++) {
        Device device = new Device();
        device.setTenantId(tenantId);
        device.setName("Device" + i);
        device.setType("default");
        device.setLabel("testLabel" + (int) (Math.random() * 1000));
        devices.add(deviceService.saveDevice(device));
        // TO make sure devices have different created time
        Thread.sleep(1);
        long temperature = (long) (Math.random() * 100);
        temperatures.add(temperature);
        if (temperature > 45) {
            highTemperatures.add(temperature);
        }
    }
    List<ListenableFuture<List<Void>>> attributeFutures = new ArrayList<>();
    for (int i = 0; i < devices.size(); i++) {
        Device device = devices.get(i);
        for (String currentScope : DataConstants.allScopes()) {
            attributeFutures.add(saveLongAttribute(device.getId(), "temperature", temperatures.get(i), currentScope));
        }
    }
    Futures.successfulAsList(attributeFutures).get();
    DeviceTypeFilter filter = new DeviceTypeFilter();
    filter.setDeviceType("default");
    filter.setDeviceNameFilter("");
    EntityDataSortOrder sortOrder = new EntityDataSortOrder(new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime"), EntityDataSortOrder.Direction.ASC);
    EntityDataPageLink pageLink = new EntityDataPageLink(10, 0, null, sortOrder);
    List<EntityKey> entityFields = Collections.singletonList(new EntityKey(EntityKeyType.ENTITY_FIELD, "name"));
    for (EntityKeyType currentAttributeKeyType : attributesEntityTypes) {
        List<EntityKey> latestValues = Collections.singletonList(new EntityKey(currentAttributeKeyType, "temperature"));
        EntityDataQuery query = new EntityDataQuery(filter, pageLink, entityFields, latestValues, null);
        PageData<EntityData> data = entityService.findEntityDataByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), query);
        List<EntityData> loadedEntities = new ArrayList<>(data.getData());
        while (data.hasNext()) {
            query = query.next();
            data = entityService.findEntityDataByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), query);
            loadedEntities.addAll(data.getData());
        }
        Assert.assertEquals(67, loadedEntities.size());
        List<String> loadedTemperatures = new ArrayList<>();
        for (Device device : devices) {
            loadedTemperatures.add(loadedEntities.stream().filter(entityData -> entityData.getEntityId().equals(device.getId())).findFirst().orElse(null).getLatest().get(currentAttributeKeyType).get("temperature").getValue());
        }
        List<String> deviceTemperatures = temperatures.stream().map(aLong -> Long.toString(aLong)).collect(Collectors.toList());
        Assert.assertEquals(deviceTemperatures, loadedTemperatures);
        pageLink = new EntityDataPageLink(10, 0, null, sortOrder);
        KeyFilter highTemperatureFilter = createNumericKeyFilter("temperature", currentAttributeKeyType, NumericFilterPredicate.NumericOperation.GREATER, 45);
        List<KeyFilter> keyFiltersHighTemperature = Collections.singletonList(highTemperatureFilter);
        query = new EntityDataQuery(filter, pageLink, entityFields, latestValues, keyFiltersHighTemperature);
        data = entityService.findEntityDataByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), query);
        loadedEntities = new ArrayList<>(data.getData());
        while (data.hasNext()) {
            query = query.next();
            data = entityService.findEntityDataByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), query);
            loadedEntities.addAll(data.getData());
        }
        Assert.assertEquals(highTemperatures.size(), loadedEntities.size());
        List<String> loadedHighTemperatures = loadedEntities.stream().map(entityData -> entityData.getLatest().get(currentAttributeKeyType).get("temperature").getValue()).collect(Collectors.toList());
        List<String> deviceHighTemperatures = highTemperatures.stream().map(aLong -> Long.toString(aLong)).collect(Collectors.toList());
        Assert.assertEquals(deviceHighTemperatures, loadedHighTemperatures);
    }
    deviceService.deleteDevicesByTenantId(tenantId);
}
Also used : Arrays(java.util.Arrays) Edge(org.thingsboard.server.common.data.edge.Edge) EntitySearchDirection(org.thingsboard.server.common.data.relation.EntitySearchDirection) Autowired(org.springframework.beans.factory.annotation.Autowired) Random(java.util.Random) StringUtils(org.apache.commons.lang3.StringUtils) KeyFilter(org.thingsboard.server.common.data.query.KeyFilter) TenantId(org.thingsboard.server.common.data.id.TenantId) EntityRelation(org.thingsboard.server.common.data.relation.EntityRelation) IdBased(org.thingsboard.server.common.data.id.IdBased) BasicTsKvEntry(org.thingsboard.server.common.data.kv.BasicTsKvEntry) AttributeKvEntry(org.thingsboard.server.common.data.kv.AttributeKvEntry) StringFilterPredicate(org.thingsboard.server.common.data.query.StringFilterPredicate) EntityListFilter(org.thingsboard.server.common.data.query.EntityListFilter) After(org.junit.After) RelationsQueryFilter(org.thingsboard.server.common.data.query.RelationsQueryFilter) Map(java.util.Map) EntityType(org.thingsboard.server.common.data.EntityType) AttributesService(org.thingsboard.server.dao.attributes.AttributesService) EdgeId(org.thingsboard.server.common.data.id.EdgeId) DeviceTypeFilter(org.thingsboard.server.common.data.query.DeviceTypeFilter) DeviceId(org.thingsboard.server.common.data.id.DeviceId) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) RelationRepository(org.thingsboard.server.dao.sql.relation.RelationRepository) TimeseriesService(org.thingsboard.server.dao.timeseries.TimeseriesService) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) AssetSearchQueryFilter(org.thingsboard.server.common.data.query.AssetSearchQueryFilter) Stream(java.util.stream.Stream) RelationEntityTypeFilter(org.thingsboard.server.common.data.relation.RelationEntityTypeFilter) StringOperation(org.thingsboard.server.common.data.query.StringFilterPredicate.StringOperation) KvEntry(org.thingsboard.server.common.data.kv.KvEntry) RandomStringUtils(org.apache.commons.lang3.RandomStringUtils) LongDataEntry(org.thingsboard.server.common.data.kv.LongDataEntry) CustomerId(org.thingsboard.server.common.data.id.CustomerId) RandomUtils(org.apache.commons.lang3.RandomUtils) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) Device(org.thingsboard.server.common.data.Device) Tenant(org.thingsboard.server.common.data.Tenant) HashMap(java.util.HashMap) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) DeviceSearchQueryFilter(org.thingsboard.server.common.data.query.DeviceSearchQueryFilter) EntityCountQuery(org.thingsboard.server.common.data.query.EntityCountQuery) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) ArrayList(java.util.ArrayList) Lists(com.google.common.collect.Lists) TsKvEntity(org.thingsboard.server.dao.model.sqlts.ts.TsKvEntity) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) EdgeTypeFilter(org.thingsboard.server.common.data.query.EdgeTypeFilter) EntityKey(org.thingsboard.server.common.data.query.EntityKey) DoubleDataEntry(org.thingsboard.server.common.data.kv.DoubleDataEntry) Before(org.junit.Before) DataConstants(org.thingsboard.server.common.data.DataConstants) EntityData(org.thingsboard.server.common.data.query.EntityData) FilterPredicateValue(org.thingsboard.server.common.data.query.FilterPredicateValue) Matchers(org.hamcrest.Matchers) Test(org.junit.Test) EdgeSearchQueryFilter(org.thingsboard.server.common.data.query.EdgeSearchQueryFilter) BaseAttributeKvEntry(org.thingsboard.server.common.data.kv.BaseAttributeKvEntry) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) ExecutionException(java.util.concurrent.ExecutionException) Futures(com.google.common.util.concurrent.Futures) PageData(org.thingsboard.server.common.data.page.PageData) RelationTypeGroup(org.thingsboard.server.common.data.relation.RelationTypeGroup) Assert(org.junit.Assert) Comparator(java.util.Comparator) Collections(java.util.Collections) ResultSetExtractor(org.springframework.jdbc.core.ResultSetExtractor) Assert.assertEquals(org.junit.Assert.assertEquals) Asset(org.thingsboard.server.common.data.asset.Asset) StringDataEntry(org.thingsboard.server.common.data.kv.StringDataEntry) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) DeviceTypeFilter(org.thingsboard.server.common.data.query.DeviceTypeFilter) ArrayList(java.util.ArrayList) EntityKey(org.thingsboard.server.common.data.query.EntityKey) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) Device(org.thingsboard.server.common.data.Device) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) EntityData(org.thingsboard.server.common.data.query.EntityData) CustomerId(org.thingsboard.server.common.data.id.CustomerId) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) KeyFilter(org.thingsboard.server.common.data.query.KeyFilter) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) Test(org.junit.Test)

Aggregations

EntityKeyType (org.thingsboard.server.common.data.query.EntityKeyType)10 EntityData (org.thingsboard.server.common.data.query.EntityData)9 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)8 List (java.util.List)8 Map (java.util.Map)8 EntityKey (org.thingsboard.server.common.data.query.EntityKey)8 Collectors (java.util.stream.Collectors)5 EntityId (org.thingsboard.server.common.data.id.EntityId)5 HashSet (java.util.HashSet)4 Slf4j (lombok.extern.slf4j.Slf4j)4 TsValue (org.thingsboard.server.common.data.query.TsValue)4 Collections (java.util.Collections)3 LinkedHashMap (java.util.LinkedHashMap)3 Set (java.util.Set)3 Getter (lombok.Getter)3 PageData (org.thingsboard.server.common.data.page.PageData)3 EntityDataPageLink (org.thingsboard.server.common.data.query.EntityDataPageLink)3 EntityDataQuery (org.thingsboard.server.common.data.query.EntityDataQuery)3 AttributesService (org.thingsboard.server.dao.attributes.AttributesService)3