Search in sources :

Example 16 with DemoPortalException

use of com.intel.mountwilson.common.DemoPortalException in project OpenAttestation by OpenAttestation.

the class DemoPortalDataController method getHostTrustStatus.

/**
	 * @param req (HttpServletRequest Object)
	 * @param res (HttpServletResponse Object)
	 * @return
	 */
public ModelAndView getHostTrustStatus(HttpServletRequest req, HttpServletResponse res) {
    log.info("DemoPortalDataController.getHostTrustStatus >>");
    ModelAndView responseView = new ModelAndView(new JSONView());
    try {
        boolean forceVerify = Boolean.parseBoolean(req.getParameter("force_verify"));
        responseView.addObject("hostVo", demoPortalServices.getSingleHostTrust(req.getParameter("hostName"), getAttestationService(req, AttestationService.class), getTrustedCertificates(req), forceVerify));
    } catch (DemoPortalException e) {
        log.error("getHostTrustStatus: " + e.toString());
        e.printStackTrace();
        responseView.addObject("hostVo", "");
        responseView.addObject("result", false);
        responseView.addObject("message", e.getMessage());
        return responseView;
    }
    responseView.addObject("result", true);
    responseView.addObject("message", "");
    log.info("DemoPortalDataController.getHostTrustStatus <<<");
    return responseView;
}
Also used : JSONView(com.intel.mountwilson.util.JSONView) ModelAndView(org.springframework.web.servlet.ModelAndView) DemoPortalException(com.intel.mountwilson.common.DemoPortalException)

Example 17 with DemoPortalException

use of com.intel.mountwilson.common.DemoPortalException in project OpenAttestation by OpenAttestation.

the class DemoPortalDataController method getAllOemInfo.

/**
	 * @param req (HttpServletRequest Object)
	 * @param res (HttpServletResponse Object)
	 * @return
	 */
public ModelAndView getAllOemInfo(HttpServletRequest req, HttpServletResponse res) {
    log.info("DemoPortalDataController.getAllOemInfo >>");
    ModelAndView responseView = new ModelAndView(new JSONView());
    try {
        responseView.addObject("oemInfo", demoPortalServices.getAllOemInfo(getAttestationService(req, ApiClient.class)));
    } catch (DemoPortalException e) {
        log.error(e.toString());
        e.printStackTrace();
        responseView.addObject("oemInfo", "");
        responseView.addObject("result", false);
        responseView.addObject("message", e.getMessage());
        return responseView;
    }
    responseView.addObject("result", true);
    responseView.addObject("message", "");
    log.info("DemoPortalDataController.getAllOemInfo <<<");
    return responseView;
}
Also used : JSONView(com.intel.mountwilson.util.JSONView) ModelAndView(org.springframework.web.servlet.ModelAndView) DemoPortalException(com.intel.mountwilson.common.DemoPortalException)

Aggregations

DemoPortalException (com.intel.mountwilson.common.DemoPortalException)17 IOException (java.io.IOException)10 JSONView (com.intel.mountwilson.util.JSONView)8 ModelAndView (org.springframework.web.servlet.ModelAndView)8 ApiException (com.intel.mtwilson.ApiException)7 SignatureException (java.security.SignatureException)7 Hostname (com.intel.mtwilson.util.net.Hostname)5 List (java.util.List)3 JsonParseException (org.codehaus.jackson.JsonParseException)3 JsonMappingException (org.codehaus.jackson.map.JsonMappingException)3 HostDetailsEntityVO (com.intel.mountwilson.datamodel.HostDetailsEntityVO)2 MleDetailsEntityVO (com.intel.mountwilson.datamodel.MleDetailsEntityVO)2 AttestationService (com.intel.mtwilson.AttestationService)2 WhitelistService (com.intel.mtwilson.WhitelistService)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 HttpSession (javax.servlet.http.HttpSession)2 HostType (com.intel.mountwilson.as.hosttrustreport.data.HostType)1 HostsTrustReportType (com.intel.mountwilson.as.hosttrustreport.data.HostsTrustReportType)1 HostReportTypeVO (com.intel.mountwilson.datamodel.HostReportTypeVO)1