@DeleteMapping( path = "backup/{backupId:.+}", produces = { MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_XML_VALUE, MediaType.APPLICATION_XML_VALUE } ) public Object backupDelete( @RequestParam(name = "format", required = false) String format, @PathVariable String backupId) throws IOException { final String executionId = getExecutionIdFilter(backupId); Object lookup = lookupBackupExecutionsContext(executionId, true, false); if (lookup != null) { if (lookup instanceof BackupExecutionAdapter) { try { getBackupFacade().abandonExecution(Long.valueOf(executionId)); } catch (Exception e) { throw new IOException(e); } return wrapObject((BackupExecutionAdapter) lookup, BackupExecutionAdapter.class); } else { return wrapList( (List<BackupExecutionAdapter>) lookup, BackupExecutionAdapter.class); } } return null; }
@DeleteMapping( path = "restore/{restoreId:.+}", produces = { MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_XML_VALUE, MediaType.APPLICATION_XML_VALUE } ) public Object restoreDelete( @RequestParam(name = "format", required = false) String format, @PathVariable String restoreId) throws IOException { final String executionId = getExecutionIdFilter(restoreId); Object lookup = lookupRestoreExecutionsContext(executionId, true, false); if (lookup != null) { if (lookup instanceof RestoreExecutionAdapter) { try { getBackupFacade().abandonExecution(Long.valueOf(executionId)); } catch (Exception e) { throw new IOException(e); } return wrapObject((RestoreExecutionAdapter) lookup, RestoreExecutionAdapter.class); } else { return wrapList( (List<RestoreExecutionAdapter>) lookup, RestoreExecutionAdapter.class); } } return null; }