@Override public IDevice deleteDeviceElementMapping(String hardwareId, String path) throws SiteWhereException { return delegate.deleteDeviceElementMapping(hardwareId, path); }
@Override public IDevice deleteDeviceElementMapping(UUID id, String path) throws SiteWhereException { return getDelegate().deleteDeviceElementMapping(id, path); }
@Override public void deleteDeviceElementMapping(GDeleteDeviceElementMappingRequest request, StreamObserver<GDeleteDeviceElementMappingResponse> responseObserver) { try { GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getDeleteDeviceElementMappingMethod()); IDevice apiResult = getDeviceManagement() .deleteDeviceElementMapping(CommonModelConverter.asApiUuid(request.getId()), request.getPath()); GDeleteDeviceElementMappingResponse.Builder response = GDeleteDeviceElementMappingResponse.newBuilder(); response.setDevice(DeviceModelConverter.asGrpcDevice(apiResult)); responseObserver.onNext(response.build()); responseObserver.onCompleted(); } catch (Throwable e) { GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getDeleteDeviceElementMappingMethod(), e, responseObserver); } finally { GrpcUtils.handleServerMethodExit(DeviceManagementGrpc.getDeleteDeviceElementMappingMethod()); } }
@RequestMapping(value = "/{hardwareId}/mappings", method = RequestMethod.DELETE) @ResponseBody @ApiOperation(value = "Delete existing device element mapping") @Secured({ SiteWhereRoles.REST }) @Documented(examples = { @Example(stage = Stage.Response, json = Devices.DeleteMappingResponse.class, description = "deleteDeviceElementMappingResponse.md") }) public IDevice deleteDeviceElementMapping( @ApiParam(value = "Hardware id", required = true) @PathVariable String hardwareId, @ApiParam(value = "Device element path", required = true) @RequestParam(required = true) String path, HttpServletRequest servletRequest) throws SiteWhereException { Tracer.start(TracerCategory.RestApiCall, "deleteDeviceElementMapping", LOGGER); try { IDevice updated = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)) .deleteDeviceElementMapping(hardwareId, path); DeviceMarshalHelper helper = new DeviceMarshalHelper(getTenant(servletRequest)); helper.setIncludeAsset(false); helper.setIncludeAssignment(false); return helper.convert(updated, SiteWhere.getServer().getAssetModuleManager(getTenant(servletRequest))); } finally { Tracer.stop(LOGGER); } }