*/
private boolean snapshotTaskDetail(TaskType type, String snapName,
String messageInSuccess, String messageInFailure)
{
VirtualMachineSnapshot vmsnap = null;
if (type != TaskType.CREATE) {
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;