use of com.intel.mountwilson.datamodel.MleDetailsEntityVO in project OpenAttestation by OpenAttestation.
the class DemoPortalServicesImpl method getOSAndVMMInfo.
/**
* This method is used to Get All OS details from REST Services.
*
* @param client (Object of ApiClient)
* @return
* @throws DemoPortalException
*/
@Override
public Map<String, Boolean> getOSAndVMMInfo(ApiClient client) throws DemoPortalException {
List<MleDetailsEntityVO> mleList = null;
//This is a MAP of OS/VMM name and boolean variable which denote about current os/vmm info is VMWare type or not.
Map<String, Boolean> maps = new HashMap<String, Boolean>();
WhitelistService service = (WhitelistService) client;
try {
//Call to REST Services to get all details of MLE, will extract all MLE from that data where OEM info is null.
mleList = ConverterUtil.getMleVOListWhereOEMIsNull(service.searchMLE(""));
for (MleDetailsEntityVO mleDetailsEntityVO : mleList) {
maps.put(ConverterUtil.getOSAndVMMInfoString(mleDetailsEntityVO), mleDetailsEntityVO.getOsName().toLowerCase().contains(HelperConstant.OS_IMAGE_VMWARE.toLowerCase()) ? true : false);
}
} catch (Exception e) {
throw ConnectionUtil.handleException(e);
}
return maps;
}
use of com.intel.mountwilson.datamodel.MleDetailsEntityVO in project OpenAttestation by OpenAttestation.
the class ConverterUtil method getMleVOListWhereOEMIsNull.
public static List<MleDetailsEntityVO> getMleVOListWhereOEMIsNull(List<MleData> searchMLE) {
List<MleDetailsEntityVO> detailsEntityVOs = new ArrayList<MleDetailsEntityVO>();
for (MleData data : searchMLE) {
if (data.getOemName() == null || data.getOemName().length() == 0) {
MleDetailsEntityVO entityVO = new MleDetailsEntityVO();
entityVO.setMleId(null);
entityVO.setMleName(data.getName());
entityVO.setMleVersion(data.getVersion());
entityVO.setAttestationType(data.getAttestationType());
entityVO.setMleType(data.getMleType());
//entityVO.setManifestList(data.getManifestList().toString());
entityVO.setOsName(data.getOsName());
entityVO.setOsVersion(data.getOsVersion());
entityVO.setOemName(data.getOemName());
detailsEntityVOs.add(entityVO);
}
}
return detailsEntityVOs;
}
use of com.intel.mountwilson.datamodel.MleDetailsEntityVO in project OpenAttestation by OpenAttestation.
the class ConverterUtil method getMleVOListWhereOEMNotNull.
public static List<MleDetailsEntityVO> getMleVOListWhereOEMNotNull(List<MleData> mleDataList) {
List<MleDetailsEntityVO> detailsEntityVOs = new ArrayList<MleDetailsEntityVO>();
for (MleData data : mleDataList) {
if (data.getOemName() != null && !(data.getOemName().length() == 0)) {
MleDetailsEntityVO entityVO = new MleDetailsEntityVO();
entityVO.setMleId(null);
entityVO.setMleName(data.getName());
entityVO.setMleVersion(data.getVersion());
entityVO.setAttestationType(data.getAttestationType());
entityVO.setMleType(data.getMleType());
//entityVO.setManifestList(data.getManifestList().toString());
entityVO.setOsName(data.getOsName());
entityVO.setOsVersion(data.getOsVersion());
entityVO.setOemName(data.getOemName());
detailsEntityVOs.add(entityVO);
}
}
return detailsEntityVOs;
}
use of com.intel.mountwilson.datamodel.MleDetailsEntityVO in project OpenAttestation by OpenAttestation.
the class DemoPortalServicesImpl method getAllOemInfo.
/**
* This method is used to get all OEM details from REST Services.
* Call to searchMLE method present in ApiClient class by passing empty string as parameter. this Method will return all MLE from services.
*
* @param client (Object of ApiClient)
* @return
* @throws DemoPortalException
*/
@Override
public Map<String, List<Map<String, String>>> getAllOemInfo(ApiClient client) throws DemoPortalException {
Map<String, List<Map<String, String>>> map = new HashMap<String, List<Map<String, String>>>();
List<MleDetailsEntityVO> mleList = null;
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
try {
WhitelistService service = (WhitelistService) client;
//This statement will get all MLE information from REST services, will get only OEM information from that list.
mleList = ConverterUtil.getMleVOListWhereOEMNotNull(service.searchMLE(""));
//convert data into a MAP of Strings which is used in UI (JQuery) to display on screen.
if (mleList != null && mleList.size() > 0) {
for (MleDetailsEntityVO mleDetailsEntityVO : mleList) {
if (map.get(mleDetailsEntityVO.getOemName()) == null) {
list = new ArrayList<Map<String, String>>();
map.put(mleDetailsEntityVO.getOemName(), list);
} else {
list = map.get(mleDetailsEntityVO.getOemName());
}
Map<String, String> oemInfo = new HashMap<String, String>();
oemInfo.put(mleDetailsEntityVO.getMleName(), mleDetailsEntityVO.getMleVersion());
list.add(oemInfo);
}
} else {
throw new DemoPortalException("Currently no MLEs are configured in the system.");
}
} catch (Exception e) {
throw ConnectionUtil.handleException(e);
}
return map;
}
Aggregations