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;
}
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;
}
Aggregations