StatusInfo statusInfo = new StatusInfo(cmdLine_);
for (String vmMoref: targetVmMorefList_) {
VmInfo vmInfo = profAllVm_.makeVmInfoWithMoref(vmMoref);
if (vmInfo == null) {
logger_.warning(vmMoref + " not found.");
continue;
}
/* Check archive existance. */
if (! VmArchiveManager.isExistSucceededGeneration(cfgGlobal_, vmInfo)) {
System.out.printf("[%s][%s] ##########_NO_ARCHIVE_##########\n",
vmInfo.getMoref(), vmInfo.getName());
continue;
}
/* Try to load archive metadata. */
VmArchiveManager vmArcMgr;
try {
vmArcMgr = new VmArchiveManager(cfgGlobal_, vmInfo);
} catch (Exception e) {
logException(e);
System.out.printf("[%s][%s] ##########_ERROR_##########\n",
vmInfo.getMoref(), vmInfo.getName());
continue;
}
/* Get status information from the metadata. */
try {
vmArcMgr.lock(0);
vmArcMgr.reload();
boolean isAvailable = profAllVm_.isAvailableWithMoref(vmMoref);
System.out.println
(vmArcMgr.getStatusString(statusInfo, isAvailable));
} catch (LockTimeoutException e) {
logException(e, "lock timeout" + vmInfo.toString());
System.out.printf("[%s][%s] ##########_LOCKED_##########\n",
vmInfo.getMoref(), vmInfo.getName());
} catch (Exception e) {
logException
(e, String.format
("Reload profile of %s failed.", vmInfo.toString()));
} finally {
vmArcMgr.unlock();
}
}
}