@Override public IDeviceCommand deleteDeviceCommand(String token, boolean force) throws SiteWhereException { return delegate.deleteDeviceCommand(token, force); }
@Override public IDeviceCommand deleteDeviceCommand(UUID id) throws SiteWhereException { return getDelegate().deleteDeviceCommand(id); }
/** * Delete an existing device command. * * @param token * @param force * @return * @throws SiteWhereException */ @RequestMapping(value = "/{token}", method = RequestMethod.DELETE) @ResponseBody @ApiOperation(value = "Delete device command by unique token") @Secured({ SiteWhereRoles.REST }) @Documented(examples = { @Example(stage = Stage.Response, json = Commands.DeviceCommandByTokenResponse.class, description = "deleteDeviceCommandResponse.md") }) public IDeviceCommand deleteDeviceCommand(@ApiParam(value = "Token", required = true) @PathVariable String token, @ApiParam(value = "Delete permanently", required = false) @RequestParam(defaultValue = "false") boolean force, HttpServletRequest servletRequest) throws SiteWhereException { Tracer.start(TracerCategory.RestApiCall, "deleteDeviceCommand", LOGGER); try { return SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)).deleteDeviceCommand(token, force); } finally { Tracer.stop(LOGGER); } }
@Override public void deleteDeviceCommand(GDeleteDeviceCommandRequest request, StreamObserver<GDeleteDeviceCommandResponse> responseObserver) { try { GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getDeleteDeviceCommandMethod()); IDeviceCommand apiResult = getDeviceManagement() .deleteDeviceCommand(CommonModelConverter.asApiUuid(request.getId())); GDeleteDeviceCommandResponse.Builder response = GDeleteDeviceCommandResponse.newBuilder(); response.setCommand(DeviceModelConverter.asGrpcDeviceCommand(apiResult)); responseObserver.onNext(response.build()); responseObserver.onCompleted(); } catch (Throwable e) { GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getDeleteDeviceCommandMethod(), e, responseObserver); } finally { GrpcUtils.handleServerMethodExit(DeviceManagementGrpc.getDeleteDeviceCommandMethod()); } }