protected Void deleteAsynCallback(AsyncCallbackDispatcher<DataObjectManagerImpl, CommandResult> callback, DeleteContext<CommandResult> context) { DataObject destObj = context.obj; CommandResult res = callback.getResult(); if (res.isFailed()) { try { objectInDataStoreMgr.update(destObj, Event.OperationFailed); } catch (NoTransitionException e) { s_logger.debug("delete failed", e); } catch (ConcurrentOperationException e) { s_logger.debug("delete failed", e); } } else { try { objectInDataStoreMgr.update(destObj, Event.OperationSuccessed); } catch (NoTransitionException e) { s_logger.debug("delete failed", e); } catch (ConcurrentOperationException e) { s_logger.debug("delete failed", e); } } context.getParentCallback().complete(res); return null; }
protected Void revertSnapshotCallback(AsyncCallbackDispatcher<SnapshotServiceImpl, CommandResult> callback, RevertSnapshotContext<CommandResult> context) { CommandResult result = callback.getResult(); AsyncCallFuture<SnapshotResult> future = context.future; SnapshotResult res = null; try { if (result.isFailed()) { s_logger.debug("revert snapshot failed" + result.getResult()); res = new SnapshotResult(context.snapshot, null); res.setResult(result.getResult()); } else { res = new SnapshotResult(context.snapshot, null); } } catch (Exception e) { s_logger.debug("Failed to in revertSnapshotCallback", e); res.setResult(e.toString()); } future.complete(res); return null; }
try { CommandResult result = future.get(); if (result.isFailed()) { s_logger.debug("Failed to migrated vm " + vm + " along with its volumes. " + result.getResult()); throw new CloudRuntimeException("Failed to migrated vm " + vm + " along with its volumes. ");
protected Void deleteSnapshotCallback(AsyncCallbackDispatcher<SnapshotServiceImpl, CommandResult> callback, DeleteSnapshotContext<CommandResult> context) { CommandResult result = callback.getResult(); AsyncCallFuture<SnapshotResult> future = context.future; SnapshotInfo snapshot = context.snapshot; SnapshotResult res = null; try { if (result.isFailed()) { s_logger.debug("delete snapshot failed" + result.getResult()); snapshot.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed); res = new SnapshotResult(context.snapshot, null); res.setResult(result.getResult()); } else { snapshot.processEvent(ObjectInDataStoreStateMachine.Event.OperationSuccessed); res = new SnapshotResult(context.snapshot, null); } } catch (Exception e) { s_logger.debug("Failed to in deleteSnapshotCallback", e); res.setResult(e.toString()); } future.complete(res); return null; }
result = future.get(); if (result.isFailed()) { privateTemplate = null; s_logger.debug("Failed to create template" + result.getResult());