private void translateDomainToDto(List<Advisory> advs, List<AdvisoryDetails> advDetails)
throws InterruptedException {
AdvisoryManagerLocal advManager = LookupUtil.getAdvisoryManagerLocal();
for (Advisory d : advs) {
AdvisoryDetails detail = new AdvisoryDetails(d.getAdvisory(), d.getAdvisoryType(), d.getSynopsis());
detail.setAdvisory(d.getAdvisory());
detail.setAdvisory_name(d.getAdvisory_name());
detail.setAdvisory_type(d.getAdvisoryType());
detail.setDescription(d.getDescription());
detail.setSolution(d.getSolution());
detail.setIssue_date(d.getIssue_date());
detail.setTopic(d.getTopic());
detail.setUpdate_date(d.getUpdate_date());
List<AdvisoryPackage> pkgs = advManager.findPackageByAdvisory(overlord, d.getId(), pc);
for (AdvisoryPackage pkg : pkgs) {
PackageVersion pv = advManager.findPackageVersionByPkgId(overlord, pkg.getPkg().getFileName(), pc);
AdvisoryPackageDetails apkg = new AdvisoryPackageDetails(pv.getDisplayName(), pv.getVersion(), pv
.getArchitecture().getName(), pv.getFileName());
detail.addPkg(apkg);
}
List<AdvisoryCVE> cves = advManager.getAdvisoryCVEByAdvId(overlord, d.getId(), pc);
for (AdvisoryCVE cve : cves) {
AdvisoryCVEDetails acve = new AdvisoryCVEDetails(cve.getCVE().getName());
detail.addCVE(acve);
}
List<AdvisoryBuglist> abugs = advManager.getAdvisoryBuglistByAdvId(overlord, d.getId());
if (abugs != null && abugs.size() > 0) {
for (AdvisoryBuglist abug : abugs) {
AdvisoryBugDetails abugdetail = new AdvisoryBugDetails(abug.getBugid());
detail.addBug(abugdetail);
}
}
advDetails.add(detail);
ThreadUtil.checkInterrupted();
}