@Override public ISearchResults<IDevice> listDevices(boolean includeDeleted, IDeviceSearchCriteria criteria) throws SiteWhereException { return delegate.listDevices(includeDeleted, criteria); }
@Override public ISearchResults<IDevice> listDevices(IDeviceSearchCriteria criteria) throws SiteWhereException { return getDelegate().listDevices(criteria); }
/** * Common logic executed before deleting a device type. * * @param deviceType * @param deviceManagement * @throws SiteWhereException */ public static void deviceTypeDeleteLogic(IDeviceType deviceType, IDeviceManagement deviceManagement) throws SiteWhereException { DeviceSearchCriteria criteria = new DeviceSearchCriteria(1, 1, null, null); criteria.setDeviceTypeToken(deviceType.getToken()); ISearchResults<IDevice> devices = deviceManagement.listDevices(criteria); if (devices.getNumResults() > 0) { throw new SiteWhereSystemException(ErrorCode.DeviceTypeInUseByDevices, ErrorLevel.ERROR); } }
startDate, endDate); ISearchResults<IDevice> results = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)) .listDevices(includeDeleted, criteria); DeviceMarshalHelper helper = new DeviceMarshalHelper(getTenant(servletRequest)); helper.setIncludeAsset(true);
deviceManagement, assetManagement); } else { matches = deviceManagement.listDevices(deviceSearch).getResults();
matches = DeviceGroupUtils.getDevicesInGroupsWithRole(criteria.getGroupsWithRole(), deviceSearch, tenant); } else { matches = SiteWhere.getServer().getDeviceManagement(tenant).listDevices(false, deviceSearch).getResults();
pageSize, startDate, endDate); ISearchResults<IDevice> results = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)) .listDevices(includeDeleted, criteria); DeviceMarshalHelper helper = new DeviceMarshalHelper(getTenant(servletRequest)); helper.setIncludeAsset(true);
@Override public void listDevices(GListDevicesRequest request, StreamObserver<GListDevicesResponse> responseObserver) { try { GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getListDevicesMethod()); ISearchResults<IDevice> apiResult = getDeviceManagement() .listDevices(DeviceModelConverter.asApiDeviceSearchCriteria(request.getCriteria())); GListDevicesResponse.Builder response = GListDevicesResponse.newBuilder(); GDeviceSearchResults.Builder results = GDeviceSearchResults.newBuilder(); for (IDevice apiDevice : apiResult.getResults()) { results.addDevices(DeviceModelConverter.asGrpcDevice(apiDevice)); } results.setCount(apiResult.getNumResults()); response.setResults(results.build()); responseObserver.onNext(response.build()); responseObserver.onCompleted(); } catch (Throwable e) { GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getListDevicesMethod(), e, responseObserver); } finally { GrpcUtils.handleServerMethodExit(DeviceManagementGrpc.getListDevicesMethod()); } }
criteria.setSpecificationToken(token); criteria.setExcludeAssigned(false); ISearchResults<IDevice> matches = devices.listDevices(false, criteria); if (matches.getNumResults() > 0) { throw new SiteWhereException("Unable to delete device specification. Specification is being used by "