hostVO.setErrorCode(1);
return hostVO;
}
public static TrustedHostVO getTrustedHostVoFromHostTrustResponseAndTxtHostRecord(HostTrustResponse hostTrustResponse, TxtHostRecord txtHostRecord) {
TrustedHostVO hostVO = new TrustedHostVO();
hostVO.setHostName(hostTrustResponse.hostname.toString());
if( hostTrustResponse.trust.bios ) {
hostVO.setBiosStatus(TDPConfig.getConfiguration().getString(HelperConstant.IMAGE_TRUSTED_TRUE));
}
else {
hostVO.setBiosStatus(TDPConfig.getConfiguration().getString(HelperConstant.IMAGE_TRUSTED_FALSE));
}
if( hostTrustResponse.trust.vmm ) {
hostVO.setVmmStatus(TDPConfig.getConfiguration().getString(HelperConstant.IMAGE_TRUSTED_TRUE));
}
else {
hostVO.setVmmStatus(TDPConfig.getConfiguration().getString(HelperConstant.IMAGE_TRUSTED_FALSE));
}
if( hostTrustResponse.trust.bios && hostTrustResponse.trust.vmm ) {
hostVO.setOverAllStatus(TDPConfig.getConfiguration().getString(HelperConstant.IMAGE_TRUSTED_TRUE));
hostVO.setOverAllStatusBoolean(true);
}
else {
hostVO.setOverAllStatus(TDPConfig.getConfiguration().getString(HelperConstant.IMAGE_TRUSTED_FALSE));
hostVO.setOverAllStatusBoolean(false);
}
doMoreThingsWithHostVmmName(hostVO, txtHostRecord);
// current json api does not return the timestamp of the latest trust status, so instead we implement fix for bug #445 and show the current time
// Bug: 457 - Refresh button is not updating the time stamp
// hostVO.setUpdatedOn(null);
// Bug: 445 - To shown the updated date when the host is in the unknown state
hostVO.setUpdatedOn(new SimpleDateFormat("EEE MMM d HH:MM:ss z yyyy").format(new Date()));
return hostVO;
}