use of com.intel.mtwilson.AttestationService in project OpenAttestation by OpenAttestation.
the class DemoPortalServicesImpl method getHostTrustReport.
@Override
public List<HostReportTypeVO> getHostTrustReport(List<String> hostNames, ApiClient client) throws DemoPortalException {
AttestationService service = (AttestationService) client;
HostsTrustReportType report = null;
List<HostReportTypeVO> hostReportTypeVO = new ArrayList<HostReportTypeVO>();
try {
List<Hostname> hostList = new ArrayList<Hostname>();
for (String host : hostNames) {
hostList.add(new Hostname(host));
}
report = service.getHostTrustReport(hostList);
} catch (Exception e) {
log.error(e.getMessage());
throw ConnectionUtil.handleException(e);
}
List<HostType> list = report.getHost();
for (HostType hostType : list) {
HostReportTypeVO vo = new HostReportTypeVO();
vo.setHostName(hostType.getHostName());
vo.setMleInfo(hostType.getMLEInfo());
vo.setCreatedOn("");
vo.setTrustStatus(hostType.getTrustStatus());
vo.setVerifiedOn(formatter.format(hostType.getVerifiedOn().toGregorianCalendar().getTime()));
hostReportTypeVO.add(vo);
}
return hostReportTypeVO;
}
Aggregations