Search in sources :

Example 1 with VmmHostDataVo

use of com.intel.mountwilson.datamodel.VmmHostDataVo in project OpenAttestation by OpenAttestation.

the class WLMDataController method getHostOSForVMM.

public ModelAndView getHostOSForVMM(HttpServletRequest req, HttpServletResponse res) {
    log.info("WLMDataController.getHostOSForVMM >>");
    ModelAndView responseView = new ModelAndView(new JSONView());
    List<VmmHostDataVo> list = new ArrayList<VmmHostDataVo>();
    VmmHostDataVo dataVo = null;
    List<String> VmmNames = getVMMNameList(WLMPConfig.getConfiguration().getString("mtwilson.wlmp.openSourceHypervisors"));
    try {
        List<OSDataVO> osList = osClientService.getAllOS(getWhitelistService(req));
        for (OSDataVO osDataVO : osList) {
            dataVo = new VmmHostDataVo();
            dataVo.setHostOS(osDataVO.getOsName());
            dataVo.setHostVersion(osDataVO.getOsVersion());
            dataVo.setVmmNames(VmmNames);
            dataVo.setAttestationType("PCR");
            list.add(dataVo);
        }
    } catch (WLMPortalException e) {
        log.error("Error While getting Host OS Data for VMM. Root cause " + e.getStackTrace());
        responseView.addObject("result", false);
        responseView.addObject("message", e.getMessage());
        return responseView;
    }
    responseView.addObject("HostList", list);
    responseView.addObject("result", true);
    responseView.addObject("message", "");
    log.info("WLMDataController.getHostOSForVMM <<<");
    return responseView;
}
Also used : WLMPortalException(com.intel.mountwilson.common.WLMPortalException) JSONView(com.intel.mountwilson.util.JSONView) ModelAndView(org.springframework.web.servlet.ModelAndView) ArrayList(java.util.ArrayList) VmmHostDataVo(com.intel.mountwilson.datamodel.VmmHostDataVo) OSDataVO(com.intel.mountwilson.datamodel.OSDataVO)

Aggregations

WLMPortalException (com.intel.mountwilson.common.WLMPortalException)1 OSDataVO (com.intel.mountwilson.datamodel.OSDataVO)1 VmmHostDataVo (com.intel.mountwilson.datamodel.VmmHostDataVo)1 JSONView (com.intel.mountwilson.util.JSONView)1 ArrayList (java.util.ArrayList)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1