コード例 #1
0
ファイル: OpsAction.java プロジェクト: RexG/hscloud-3.0.x
 /**
  * <获得虚拟机最后一次的备份> <功能详细描述>
  *
  * @return
  * @see [类、类#方法、类#成员]
  */
 public String getLastestVmSnapshot() {
   long beginRunTime = 0;
   if (logger.isDebugEnabled()) {
     beginRunTime = System.currentTimeMillis();
     logger.debug("enter getLastestVmSnapshot method.");
   }
   Map<String, Object> map = new HashMap<String, Object>();
   ControlPanelUser controlPanelUser =
       (ControlPanelUser) super.getSession().getAttribute(Constants.LOGIN_CURRENTUSER);
   if (controlPanelUser == null) {
     super.fillActionResult(Constants.OPTIONS_TIMEOUT);
     return null;
   }
   String vmId = controlPanelUser.getVmId();
   try {
     VmSnapShotVO vmSnapShotVO = facade.getLastestVmSnapshot(vmId);
     map.put("totalCount", 1);
     map.put("result", vmSnapShotVO);
   } catch (Exception ex) {
     dealThrow(
         new HsCloudException(Constants.OPTIONS_FAILURE, "getLastestVmSnapshot异常", logger, ex),
         Constants.OPTIONS_FAILURE);
   }
   super.fillActionResult(map);
   if (logger.isDebugEnabled()) {
     long takeTime = System.currentTimeMillis() - beginRunTime;
     logger.debug("exit getLastestVmSnapshot method.takeTime:" + takeTime + "ms");
   }
   return null;
 }