Search in sources :

Example 1 with EntityDataPageLink

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

the class BaseEntityQueryControllerTest method testSimpleFindEntityDataByQuery.

@Test
public void testSimpleFindEntityDataByQuery() throws Exception {
    List<Device> devices = new ArrayList<>();
    for (int i = 0; i < 97; i++) {
        Device device = new Device();
        device.setName("Device" + i);
        device.setType("default");
        device.setLabel("testLabel" + (int) (Math.random() * 1000));
        devices.add(doPost("/api/device", device, Device.class));
        Thread.sleep(1);
    }
    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"));
    EntityDataQuery query = new EntityDataQuery(filter, pageLink, entityFields, null, null);
    PageData<EntityData> data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
    });
    Assert.assertEquals(97, data.getTotalElements());
    Assert.assertEquals(10, data.getTotalPages());
    Assert.assertTrue(data.hasNext());
    Assert.assertEquals(10, data.getData().size());
    List<EntityData> loadedEntities = new ArrayList<>(data.getData());
    while (data.hasNext()) {
        query = query.next();
        data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
        });
        loadedEntities.addAll(data.getData());
    }
    Assert.assertEquals(97, loadedEntities.size());
    List<EntityId> loadedIds = loadedEntities.stream().map(EntityData::getEntityId).collect(Collectors.toList());
    List<EntityId> deviceIds = devices.stream().map(Device::getId).collect(Collectors.toList());
    Assert.assertEquals(deviceIds, loadedIds);
    List<String> loadedNames = loadedEntities.stream().map(entityData -> entityData.getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue()).collect(Collectors.toList());
    List<String> deviceNames = devices.stream().map(Device::getName).collect(Collectors.toList());
    Assert.assertEquals(deviceNames, loadedNames);
    sortOrder = new EntityDataSortOrder(new EntityKey(EntityKeyType.ENTITY_FIELD, "name"), EntityDataSortOrder.Direction.DESC);
    pageLink = new EntityDataPageLink(10, 0, "device1", sortOrder);
    query = new EntityDataQuery(filter, pageLink, entityFields, null, null);
    data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
    });
    Assert.assertEquals(11, data.getTotalElements());
    Assert.assertEquals("Device19", data.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue());
    EntityTypeFilter filter2 = new EntityTypeFilter();
    filter2.setEntityType(EntityType.DEVICE);
    EntityDataSortOrder sortOrder2 = new EntityDataSortOrder(new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime"), EntityDataSortOrder.Direction.ASC);
    EntityDataPageLink pageLink2 = new EntityDataPageLink(10, 0, null, sortOrder2);
    List<EntityKey> entityFields2 = Collections.singletonList(new EntityKey(EntityKeyType.ENTITY_FIELD, "name"));
    EntityDataQuery query2 = new EntityDataQuery(filter2, pageLink2, entityFields2, null, null);
    PageData<EntityData> data2 = doPostWithTypedResponse("/api/entitiesQuery/find", query2, new TypeReference<PageData<EntityData>>() {
    });
    Assert.assertEquals(97, data2.getTotalElements());
    Assert.assertEquals(10, data2.getTotalPages());
    Assert.assertTrue(data2.hasNext());
    Assert.assertEquals(10, data2.getData().size());
}
Also used : Device(org.thingsboard.server.common.data.Device) Tenant(org.thingsboard.server.common.data.Tenant) EntityTypeFilter(org.thingsboard.server.common.data.query.EntityTypeFilter) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) EntityCountQuery(org.thingsboard.server.common.data.query.EntityCountQuery) KeyFilter(org.thingsboard.server.common.data.query.KeyFilter) ArrayList(java.util.ArrayList) User(org.thingsboard.server.common.data.User) EntityListFilter(org.thingsboard.server.common.data.query.EntityListFilter) MockMvcResultMatchers.status(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status) After(org.junit.After) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityType(org.thingsboard.server.common.data.EntityType) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) TypeReference(com.fasterxml.jackson.core.type.TypeReference) EntityKey(org.thingsboard.server.common.data.query.EntityKey) Before(org.junit.Before) DeviceTypeFilter(org.thingsboard.server.common.data.query.DeviceTypeFilter) DeviceId(org.thingsboard.server.common.data.id.DeviceId) DataConstants(org.thingsboard.server.common.data.DataConstants) EntityData(org.thingsboard.server.common.data.query.EntityData) FilterPredicateValue(org.thingsboard.server.common.data.query.FilterPredicateValue) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) Test(org.junit.Test) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) Authority(org.thingsboard.server.common.data.security.Authority) Collectors(java.util.stream.Collectors) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) List(java.util.List) PageData(org.thingsboard.server.common.data.page.PageData) Assert(org.junit.Assert) Collections(java.util.Collections) Device(org.thingsboard.server.common.data.Device) DeviceTypeFilter(org.thingsboard.server.common.data.query.DeviceTypeFilter) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) ArrayList(java.util.ArrayList) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityTypeFilter(org.thingsboard.server.common.data.query.EntityTypeFilter) EntityKey(org.thingsboard.server.common.data.query.EntityKey) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) PageData(org.thingsboard.server.common.data.page.PageData) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) TypeReference(com.fasterxml.jackson.core.type.TypeReference) Test(org.junit.Test)

Example 2 with EntityDataPageLink

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

the class BaseEntityQueryControllerTest method testFindEntityDataByQueryWithAttributes.

@Test
public void testFindEntityDataByQueryWithAttributes() throws Exception {
    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();
        String name = "Device" + i;
        device.setName(name);
        device.setType("default");
        device.setLabel("testLabel" + (int) (Math.random() * 1000));
        devices.add(doPost("/api/device?accessToken=" + name, device, Device.class));
        Thread.sleep(1);
        long temperature = (long) (Math.random() * 100);
        temperatures.add(temperature);
        if (temperature > 45) {
            highTemperatures.add(temperature);
        }
    }
    for (int i = 0; i < devices.size(); i++) {
        Device device = devices.get(i);
        String payload = "{\"temperature\":" + temperatures.get(i) + "}";
        doPost("/api/plugins/telemetry/" + device.getId() + "/" + DataConstants.SHARED_SCOPE, payload, String.class, status().isOk());
    }
    Thread.sleep(1000);
    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"));
    List<EntityKey> latestValues = Collections.singletonList(new EntityKey(EntityKeyType.ATTRIBUTE, "temperature"));
    EntityDataQuery query = new EntityDataQuery(filter, pageLink, entityFields, latestValues, null);
    PageData<EntityData> data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
    });
    List<EntityData> loadedEntities = new ArrayList<>(data.getData());
    while (data.hasNext()) {
        query = query.next();
        data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
        });
        loadedEntities.addAll(data.getData());
    }
    Assert.assertEquals(67, loadedEntities.size());
    List<String> loadedTemperatures = loadedEntities.stream().map(entityData -> entityData.getLatest().get(EntityKeyType.ATTRIBUTE).get("temperature").getValue()).collect(Collectors.toList());
    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 = new KeyFilter();
    highTemperatureFilter.setKey(new EntityKey(EntityKeyType.ATTRIBUTE, "temperature"));
    NumericFilterPredicate predicate = new NumericFilterPredicate();
    predicate.setValue(FilterPredicateValue.fromDouble(45));
    predicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER);
    highTemperatureFilter.setPredicate(predicate);
    List<KeyFilter> keyFilters = Collections.singletonList(highTemperatureFilter);
    query = new EntityDataQuery(filter, pageLink, entityFields, latestValues, keyFilters);
    data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
    });
    loadedEntities = new ArrayList<>(data.getData());
    while (data.hasNext()) {
        query = query.next();
        data = doPostWithTypedResponse("/api/entitiesQuery/find", query, new TypeReference<PageData<EntityData>>() {
        });
        loadedEntities.addAll(data.getData());
    }
    Assert.assertEquals(highTemperatures.size(), loadedEntities.size());
    List<String> loadedHighTemperatures = loadedEntities.stream().map(entityData -> entityData.getLatest().get(EntityKeyType.ATTRIBUTE).get("temperature").getValue()).collect(Collectors.toList());
    List<String> deviceHighTemperatures = highTemperatures.stream().map(aLong -> Long.toString(aLong)).collect(Collectors.toList());
    Assert.assertEquals(deviceHighTemperatures, loadedHighTemperatures);
}
Also used : Device(org.thingsboard.server.common.data.Device) Tenant(org.thingsboard.server.common.data.Tenant) EntityTypeFilter(org.thingsboard.server.common.data.query.EntityTypeFilter) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) EntityCountQuery(org.thingsboard.server.common.data.query.EntityCountQuery) KeyFilter(org.thingsboard.server.common.data.query.KeyFilter) ArrayList(java.util.ArrayList) User(org.thingsboard.server.common.data.User) EntityListFilter(org.thingsboard.server.common.data.query.EntityListFilter) MockMvcResultMatchers.status(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status) After(org.junit.After) EntityId(org.thingsboard.server.common.data.id.EntityId) EntityType(org.thingsboard.server.common.data.EntityType) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) TypeReference(com.fasterxml.jackson.core.type.TypeReference) EntityKey(org.thingsboard.server.common.data.query.EntityKey) Before(org.junit.Before) DeviceTypeFilter(org.thingsboard.server.common.data.query.DeviceTypeFilter) DeviceId(org.thingsboard.server.common.data.id.DeviceId) DataConstants(org.thingsboard.server.common.data.DataConstants) EntityData(org.thingsboard.server.common.data.query.EntityData) FilterPredicateValue(org.thingsboard.server.common.data.query.FilterPredicateValue) EntityKeyType(org.thingsboard.server.common.data.query.EntityKeyType) Test(org.junit.Test) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) Authority(org.thingsboard.server.common.data.security.Authority) Collectors(java.util.stream.Collectors) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) List(java.util.List) PageData(org.thingsboard.server.common.data.page.PageData) Assert(org.junit.Assert) Collections(java.util.Collections) 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) TypeReference(com.fasterxml.jackson.core.type.TypeReference) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) Device(org.thingsboard.server.common.data.Device) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) EntityData(org.thingsboard.server.common.data.query.EntityData) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) PageData(org.thingsboard.server.common.data.page.PageData) KeyFilter(org.thingsboard.server.common.data.query.KeyFilter) Test(org.junit.Test)

Example 3 with EntityDataPageLink

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

the class DefaultEntityQueryService method buildEntityDataQuery.

private EntityDataQuery buildEntityDataQuery(AlarmDataQuery query) {
    EntityDataSortOrder sortOrder = query.getPageLink().getSortOrder();
    EntityDataSortOrder entitiesSortOrder;
    if (sortOrder == null || sortOrder.getKey().getType().equals(EntityKeyType.ALARM_FIELD)) {
        entitiesSortOrder = new EntityDataSortOrder(new EntityKey(EntityKeyType.ENTITY_FIELD, ModelConstants.CREATED_TIME_PROPERTY));
    } else {
        entitiesSortOrder = sortOrder;
    }
    EntityDataPageLink edpl = new EntityDataPageLink(maxEntitiesPerAlarmSubscription, 0, null, entitiesSortOrder);
    return new EntityDataQuery(query.getEntityFilter(), edpl, query.getEntityFields(), query.getLatestValues(), query.getKeyFilters());
}
Also used : EntityKey(org.thingsboard.server.common.data.query.EntityKey) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) EntityDataSortOrder(org.thingsboard.server.common.data.query.EntityDataSortOrder) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink)

Example 4 with EntityDataPageLink

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

the class AbstractLwM2MIntegrationTest method basicTestConnectionObserveTelemetry.

public void basicTestConnectionObserveTelemetry(Security security, LwM2MDeviceCredentials deviceCredentials, Configuration coapConfig, String endpoint) throws Exception {
    Lwm2mDeviceProfileTransportConfiguration transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITH_PARAMS, getBootstrapServerCredentialsNoSec(NONE));
    createDeviceProfile(transportConfiguration);
    Device device = createDevice(deviceCredentials, endpoint);
    SingleEntityFilter sef = new SingleEntityFilter();
    sef.setSingleEntity(device.getId());
    LatestValueCmd latestCmd = new LatestValueCmd();
    latestCmd.setKeys(Collections.singletonList(new EntityKey(EntityKeyType.TIME_SERIES, "batteryLevel")));
    EntityDataQuery edq = new EntityDataQuery(sef, new EntityDataPageLink(1, 0, null, null), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    EntityDataCmd cmd = new EntityDataCmd(1, edq, null, latestCmd, null);
    TelemetryPluginCmdsWrapper wrapper = new TelemetryPluginCmdsWrapper();
    wrapper.setEntityDataCmds(Collections.singletonList(cmd));
    wsClient.send(mapper.writeValueAsString(wrapper));
    wsClient.waitForReply();
    wsClient.registerWaitForUpdate();
    createNewClient(security, coapConfig, false, endpoint, false, null);
    String msg = wsClient.waitForUpdate();
    EntityDataUpdate 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.TIME_SERIES));
    var tsValue = eData.get(0).getLatest().get(EntityKeyType.TIME_SERIES).get("batteryLevel");
    Assert.assertThat(Long.parseLong(tsValue.getValue()), instanceOf(Long.class));
    int expectedMax = 50;
    int expectedMin = 5;
    Assert.assertTrue(expectedMax >= Long.parseLong(tsValue.getValue()));
    Assert.assertTrue(expectedMin <= Long.parseLong(tsValue.getValue()));
}
Also used : Device(org.thingsboard.server.common.data.Device) EntityDataPageLink(org.thingsboard.server.common.data.query.EntityDataPageLink) Lwm2mDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration) 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) LatestValueCmd(org.thingsboard.server.service.telemetry.cmd.v2.LatestValueCmd) EntityDataQuery(org.thingsboard.server.common.data.query.EntityDataQuery) SingleEntityFilter(org.thingsboard.server.common.data.query.SingleEntityFilter) EntityDataCmd(org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd) TelemetryPluginCmdsWrapper(org.thingsboard.server.service.telemetry.cmd.TelemetryPluginCmdsWrapper)

Example 5 with EntityDataPageLink

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

the class BaseWebsocketApiTest method testEntityDataLatestTsWsCmd.

@Test
public void testEntityDataLatestTsWsCmd() 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.TIME_SERIES, "temperature")));
    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();
    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.TIME_SERIES).get("temperature"));
    Assert.assertEquals(0, pageData.getData().get(0).getLatest().get(EntityKeyType.TIME_SERIES).get("temperature").getTs());
    Assert.assertEquals("", pageData.getData().get(0).getLatest().get(EntityKeyType.TIME_SERIES).get("temperature").getValue());
    TsKvEntry dataPoint1 = new BasicTsKvEntry(now - TimeUnit.MINUTES.toMillis(1), new LongDataEntry("temperature", 42L));
    List<TsKvEntry> tsData = Arrays.asList(dataPoint1);
    sendTelemetry(device, tsData);
    Thread.sleep(100);
    cmd = new EntityDataCmd(1, edq, null, latestCmd, null);
    wrapper = new TelemetryPluginCmdsWrapper();
    wrapper.setEntityDataCmds(Collections.singletonList(cmd));
    wsClient.send(mapper.writeValueAsString(wrapper));
    msg = wsClient.waitForReply();
    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.TIME_SERIES));
    TsValue tsValue = listData.get(0).getLatest().get(EntityKeyType.TIME_SERIES).get("temperature");
    Assert.assertEquals(new TsValue(dataPoint1.getTs(), dataPoint1.getValueAsString()), tsValue);
    now = System.currentTimeMillis();
    TsKvEntry dataPoint2 = new BasicTsKvEntry(now, new LongDataEntry("temperature", 52L));
    wsClient.registerWaitForUpdate();
    sendTelemetry(device, Arrays.asList(dataPoint2));
    msg = wsClient.waitForUpdate();
    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.TIME_SERIES));
    tsValue = eData.get(0).getLatest().get(EntityKeyType.TIME_SERIES).get("temperature");
    Assert.assertEquals(new TsValue(dataPoint2.getTs(), dataPoint2.getValueAsString()), tsValue);
    // Sending update from the past, while latest value has new timestamp;
    wsClient.registerWaitForUpdate();
    sendTelemetry(device, Arrays.asList(dataPoint1));
    msg = wsClient.waitForUpdate(TimeUnit.SECONDS.toMillis(1));
    Assert.assertNull(msg);
    // Sending duplicate update again
    wsClient.registerWaitForUpdate();
    sendTelemetry(device, Arrays.asList(dataPoint2));
    msg = wsClient.waitForUpdate(TimeUnit.SECONDS.toMillis(1));
    Assert.assertNull(msg);
}
Also used : TsValue(org.thingsboard.server.common.data.query.TsValue) BasicTsKvEntry(org.thingsboard.server.common.data.kv.BasicTsKvEntry) TsKvEntry(org.thingsboard.server.common.data.kv.TsKvEntry) BasicTsKvEntry(org.thingsboard.server.common.data.kv.BasicTsKvEntry) 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) LongDataEntry(org.thingsboard.server.common.data.kv.LongDataEntry) TelemetryPluginCmdsWrapper(org.thingsboard.server.service.telemetry.cmd.TelemetryPluginCmdsWrapper) Test(org.junit.Test)

Aggregations

EntityDataPageLink (org.thingsboard.server.common.data.query.EntityDataPageLink)25 EntityDataQuery (org.thingsboard.server.common.data.query.EntityDataQuery)24 DeviceTypeFilter (org.thingsboard.server.common.data.query.DeviceTypeFilter)21 EntityData (org.thingsboard.server.common.data.query.EntityData)21 EntityKey (org.thingsboard.server.common.data.query.EntityKey)21 Device (org.thingsboard.server.common.data.Device)20 Test (org.junit.Test)19 EntityDataSortOrder (org.thingsboard.server.common.data.query.EntityDataSortOrder)17 LongDataEntry (org.thingsboard.server.common.data.kv.LongDataEntry)16 ArrayList (java.util.ArrayList)14 BasicTsKvEntry (org.thingsboard.server.common.data.kv.BasicTsKvEntry)14 Collections (java.util.Collections)13 List (java.util.List)13 Collectors (java.util.stream.Collectors)13 EntityType (org.thingsboard.server.common.data.EntityType)13 EntityId (org.thingsboard.server.common.data.id.EntityId)13 PageData (org.thingsboard.server.common.data.page.PageData)13 EntityCountQuery (org.thingsboard.server.common.data.query.EntityCountQuery)13 EntityKeyType (org.thingsboard.server.common.data.query.EntityKeyType)13 EntityListFilter (org.thingsboard.server.common.data.query.EntityListFilter)13