Search in sources :

Example 1 with MLESearchCriteria

use of com.intel.mtwilson.datatypes.MLESearchCriteria 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 2 with MLESearchCriteria

use of com.intel.mtwilson.datatypes.MLESearchCriteria 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)2 MLESearchCriteria (com.intel.mtwilson.datatypes.MLESearchCriteria)2 MLEDataVO (com.intel.mountwilson.datamodel.MLEDataVO)1