Search in sources :

Example 1 with GetSnmpDevicesResponseMsg

use of org.thingsboard.server.gen.transport.TransportProtos.GetSnmpDevicesResponseMsg in project thingsboard by thingsboard.

the class DefaultTransportApiService method handle.

private ListenableFuture<TransportApiResponseMsg> handle(GetSnmpDevicesRequestMsg requestMsg) {
    PageLink pageLink = new PageLink(requestMsg.getPageSize(), requestMsg.getPage());
    PageData<UUID> result = deviceService.findDevicesIdsByDeviceProfileTransportType(DeviceTransportType.SNMP, pageLink);
    GetSnmpDevicesResponseMsg responseMsg = GetSnmpDevicesResponseMsg.newBuilder().addAllIds(result.getData().stream().map(UUID::toString).collect(Collectors.toList())).setHasNextPage(result.hasNext()).build();
    return Futures.immediateFuture(TransportApiResponseMsg.newBuilder().setSnmpDevicesResponseMsg(responseMsg).build());
}
Also used : GetSnmpDevicesResponseMsg(org.thingsboard.server.gen.transport.TransportProtos.GetSnmpDevicesResponseMsg) PageLink(org.thingsboard.server.common.data.page.PageLink) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 PageLink (org.thingsboard.server.common.data.page.PageLink)1 GetSnmpDevicesResponseMsg (org.thingsboard.server.gen.transport.TransportProtos.GetSnmpDevicesResponseMsg)1