use of org.eclipse.sw360.datahandler.thrift.vulnerabilities.VulnerabilityWithReleaseRelations in project sw360portal by sw360.
the class Sw360VulnerabilityService method getVulnerabilityWithReleaseRelationsByExternalId.
public Vulnerability getVulnerabilityWithReleaseRelationsByExternalId(String externalId, User sw360User) {
try {
VulnerabilityService.Iface sw360VulnerabilityClient = getThriftVulnerabilityClient();
final VulnerabilityWithReleaseRelations vulWithRel = sw360VulnerabilityClient.getVulnerabilityWithReleaseRelationsByExternalId(externalId, sw360User);
return vulWithRel.getVulnerability();
} catch (TException e) {
throw new RuntimeException(e);
}
}
use of org.eclipse.sw360.datahandler.thrift.vulnerabilities.VulnerabilityWithReleaseRelations in project sw360portal by sw360.
the class VulnerabilitiesPortlet method prepareDetailView.
private void prepareDetailView(RenderRequest request, RenderResponse response) throws IOException, PortletException {
User user = UserCacheHolder.getUserFromRequest(request);
String externalId = request.getParameter(VULNERABILITY_ID);
if (externalId != null) {
try {
VulnerabilityService.Iface client = thriftClients.makeVulnerabilityClient();
VulnerabilityWithReleaseRelations vulnerabilityWithReleaseRelations = client.getVulnerabilityWithReleaseRelationsByExternalId(externalId, user);
if (vulnerabilityWithReleaseRelations != null) {
Vulnerability vulnerability = vulnerabilityWithReleaseRelations.getVulnerability();
List<Release> releases = getReleasesFromRelations(user, vulnerabilityWithReleaseRelations);
request.setAttribute(VULNERABILITY, vulnerability);
request.setAttribute(DOCUMENT_ID, externalId);
request.setAttribute(USING_RELEASES, releases);
addVulnerabilityBreadcrumb(request, response, vulnerability);
}
} catch (TException e) {
log.error("Error fetching vulnerability from backend!", e);
}
}
}
Aggregations