use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method updateOEMData.
public ModelAndView updateOEMData(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.updateOEMData >>");
ModelAndView responseView = new ModelAndView(new JSONView());
int selectedPage;
try {
selectedPage = Integer.parseInt(req.getParameter("selectedPageNo"));
OEMDataVO dataVONew = new OEMDataVO();
dataVONew.setOemName(req.getParameter("oemName"));
dataVONew.setOemDescription(req.getParameter("inputDec"));
boolean updateDone = oemClientService.updateOEMInfo(dataVONew, getWhitelistService(req));
if (updateDone) {
Map<Integer, List<OEMDataVO>> mapOfData = getPartitionListOfAllOEM(req);
responseView.addObject("OEMDataVo", mapOfData.get(selectedPage));
responseView.addObject("noOfPages", mapOfData.size());
responseView.addObject("result", updateDone);
}
} catch (Exception e) {
log.error("Error Wile Editing OEM Data. Root cause " + e.getMessage());
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
}
log.info("WLMDataController.updateOEMData <<<");
return responseView;
}
use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method addOEMData.
public ModelAndView addOEMData(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.addOEMData>>");
ModelAndView responseView = new ModelAndView(new JSONView());
try {
OEMDataVO dataVONew = new OEMDataVO();
dataVONew.setOemName(req.getParameter("oemName"));
dataVONew.setOemDescription(req.getParameter("oemDescription"));
System.out.println("New OEM data >>> " + dataVONew.toString());
responseView.addObject("result", oemClientService.addOEMInfo(dataVONew, getWhitelistService(req)));
} catch (WLMPortalException e) {
log.error("Error Wile Adding OEM Data. Root cause " + e.getStackTrace());
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
}
log.info("WLMDataController.addOEMData <<<");
return responseView;
}
use of com.intel.mountwilson.util.JSONView 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;
}
use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method deleteOEMData.
public ModelAndView deleteOEMData(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.deleteOEMData >>");
ModelAndView responseView = new ModelAndView(new JSONView());
int selectedPage;
try {
selectedPage = Integer.parseInt(req.getParameter("selectedPageNo"));
OEMDataVO dataVONew = new OEMDataVO();
dataVONew.setOemName(req.getParameter("oemName"));
//dataVONew.setOemDescription(req.getParameter("inputDec"));
boolean updateDone = oemClientService.deleteOEM(dataVONew, getWhitelistService(req));
if (updateDone) {
Map<Integer, List<OEMDataVO>> mapOfData = getPartitionListOfAllOEM(req);
if (selectedPage > mapOfData.size()) {
selectedPage = mapOfData.size();
}
responseView.addObject("OEMDataVo", mapOfData.get(selectedPage));
responseView.addObject("noOfPages", mapOfData.size());
responseView.addObject("result", updateDone);
}
} catch (Exception e) {
log.error("Error Wile Deleting OEM Data. Root cause " + e.getMessage());
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
}
log.info("WLMDataController.deleteOEMData <<<");
return responseView;
}
use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method getViewOSForPageNo.
@SuppressWarnings("unchecked")
public ModelAndView getViewOSForPageNo(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.getViewOSForPageNo >>");
ModelAndView responseView = new ModelAndView(new JSONView());
try {
HttpSession session = req.getSession();
Map<Integer, List<MLEDataVO>> map = (Map<Integer, List<MLEDataVO>>) session.getAttribute("OSList");
responseView.addObject("OSDataVo", map.get(Integer.parseInt(req.getParameter("pageNo"))));
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
responseView.addObject("OSDataVo", "");
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
return responseView;
}
responseView.addObject("result", true);
responseView.addObject("message", "");
log.info("WLMDataController.getViewOSForPageNo <<");
return responseView;
}
Aggregations