vmsnap = getSnapshotInTree(snapName);
if (vmsnap == null) { return false; }
}
try {
Task task = null;
switch (type) {
case CREATE:
task = vm_.createSnapshot_Task(snapName, null, false, false);
break;
case DELETE:
task = vmsnap.removeSnapshot_Task(true);
break;
case REVERT:
task = vmsnap.revertToSnapshot_Task(null, true);
break;
default:
throw new Exception("Snapshot TaskType is wrong.");
}
assert task != null;
String ret = task.waitForTask();
if (ret.equals("success")) {
logger_.info(messageInSuccess);
return true;
} else {
logger_.info(messageInFailure);