/** * clean up template data on staging area * @param newTemplate: The template on the secondary storage that needs to be cleaned up */ protected void cleanupStagingNfs(TemplateObjectTO newTemplate) { try { DeleteCommand deleteCommand = new DeleteCommand(newTemplate); execute(deleteCommand); } catch (Exception e) { s_logger.debug("Failed to clean up staging area:", e); } }
@Override public void deleteAsync(DataStore dataStore, DataObject data, AsyncCompletionCallback<CommandResult> callback) { CommandResult result = new CommandResult(); try { DeleteCommand cmd = new DeleteCommand(data.getTO()); EndPoint ep = _epSelector.select(data); Answer answer = null; if (ep == null) { String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; s_logger.error(errMsg); answer = new Answer(cmd, false, errMsg); } else { answer = ep.sendMessage(cmd); } if (answer != null && !answer.getResult()) { result.setResult(answer.getDetails()); } } catch (Exception ex) { s_logger.debug("Unable to destoy " + data.getType().toString() + ": " + data.getId(), ex); result.setResult(ex.toString()); } callback.complete(result); }
@Override public void deleteAsync(DataStore dataStore, DataObject data, AsyncCompletionCallback<CommandResult> callback) { DeleteCommand cmd = new DeleteCommand(data.getTO()); CommandResult result = new CommandResult(); try { EndPoint ep = null; if (data.getType() == DataObjectType.VOLUME) { ep = epSelector.select(data, StorageAction.DELETEVOLUME); } else { ep = epSelector.select(data); } if (ep == null) { String errMsg = "No remote endpoint to send DeleteCommand, check if host or ssvm is down?"; s_logger.error(errMsg); result.setResult(errMsg); } else { Answer answer = ep.sendMessage(cmd); if (answer != null && !answer.getResult()) { result.setResult(answer.getDetails()); } } } catch (Exception ex) { s_logger.debug("Unable to destoy volume" + data.getId(), ex); result.setResult(ex.toString()); } callback.complete(result); }
tmplTO.setPath(tInfo.getInstallPath()); tmplTO.setId(tInfo.getId()); DeleteCommand dtCommand = new DeleteCommand(tmplTO); EndPoint ep = _epSelector.select(store); Answer answer = null;
tmplTO.setPath(tInfo.getInstallPath()); tmplTO.setId(tInfo.getId()); DeleteCommand dtCommand = new DeleteCommand(tmplTO); EndPoint ep = _epSelector.select(store); Answer answer = null;
cmd = new DeleteCommand(volumeInfo.getTO());