@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;
}