Search in sources :

Example 16 with WLMPortalException

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

the class MLEClientServiceImpl method getSingleMleData.

/**
	 * Method to get Single MLE Details from a rest services.
	 * 
	 * @param dataVO
	 * @param apiClientServices
	 * @return
	 * @throws WLMPortalException
	 */
@Override
public MLEDataVO getSingleMleData(MLEDataVO dataVO, WhitelistService apiClientServices) throws WLMPortalException {
    log.info("MLEClientServiceImpl.getSingleMleData >>");
    MLEDataVO mleObject = null;
    try {
        MLESearchCriteria criteria = new MLESearchCriteria();
        criteria.mleName = dataVO.getMleName();
        criteria.mleVersion = dataVO.getMleVersion();
        if (dataVO.getOemName() != null) {
            criteria.oemName = dataVO.getOemName();
            criteria.osName = "";
            criteria.osVersion = "";
        } else {
            criteria.osName = dataVO.getOsName();
            criteria.osVersion = dataVO.getOsVersion();
            criteria.oemName = "";
        }
        mleObject = ConverterUtil.getMleDataVoObject(apiClientServices.getMLEManifest(criteria));
    } catch (Exception e) {
        throw ConnectionUtil.handleException(e);
    }
    log.info("MLEClientServiceImpl.getSingleMleData <<");
    return mleObject;
}
Also used : MLEDataVO(com.intel.mountwilson.datamodel.MLEDataVO) WLMPortalException(com.intel.mountwilson.common.WLMPortalException) MLESearchCriteria(com.intel.mtwilson.datatypes.MLESearchCriteria)

Example 17 with WLMPortalException

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

the class MLEClientServiceImpl method deleteMLE.

/**
	 * Method to delete MLE Type from a rest services
	 * 
	 * @param dataVO
	 * @param apiClientServices
	 * @return Boolean variable e.g true if MLE is deleted successfully 
	 * @throws WLMPortalException
	 */
@Override
public boolean deleteMLE(MLEDataVO dataVO, WhitelistService apiClientServices) throws WLMPortalException {
    log.info("MLEClientServiceImpl.deleteMLE >>");
    boolean result = false;
    try {
        MLESearchCriteria criteria = new MLESearchCriteria();
        criteria.mleName = dataVO.getMleName();
        criteria.mleVersion = dataVO.getMleVersion();
        if (dataVO.getOemName() != null) {
            criteria.oemName = dataVO.getOemName();
            criteria.osName = "";
            criteria.osVersion = "";
        } else {
            criteria.osName = dataVO.getOsName();
            criteria.osVersion = dataVO.getOsVersion();
            criteria.oemName = "";
        }
        result = apiClientServices.deleteMLE(criteria);
    } catch (Exception e) {
        log.error(e.getMessage());
        throw ConnectionUtil.handleException(e);
    }
    log.info("MLEClientServiceImpl.deleteMLE <<");
    return result;
}
Also used : WLMPortalException(com.intel.mountwilson.common.WLMPortalException) MLESearchCriteria(com.intel.mtwilson.datatypes.MLESearchCriteria)

Aggregations

WLMPortalException (com.intel.mountwilson.common.WLMPortalException)17 JSONView (com.intel.mountwilson.util.JSONView)11 ModelAndView (org.springframework.web.servlet.ModelAndView)11 ArrayList (java.util.ArrayList)7 List (java.util.List)6 OSDataVO (com.intel.mountwilson.datamodel.OSDataVO)4 MLEDataVO (com.intel.mountwilson.datamodel.MLEDataVO)3 FileUploadException (org.apache.commons.fileupload.FileUploadException)3 OEMDataVO (com.intel.mountwilson.datamodel.OEMDataVO)2 MLESearchCriteria (com.intel.mtwilson.datatypes.MLESearchCriteria)2 OemData (com.intel.mtwilson.datatypes.OemData)2 VmmHostDataVo (com.intel.mountwilson.datamodel.VmmHostDataVo)1 WhitelistService (com.intel.mtwilson.WhitelistService)1 MleData (com.intel.mtwilson.datatypes.MleData)1 HttpSession (javax.servlet.http.HttpSession)1