use of org.eclipse.sw360.datahandler.thrift.cvesearch.VulnerabilityUpdateStatus in project sw360portal by sw360.
the class ComponentPortlet method updateVulnerabilitiesComponent.
private void updateVulnerabilitiesComponent(ResourceRequest request, ResourceResponse response) throws PortletException, IOException {
String componentId = request.getParameter(PortalConstants.COMPONENT_ID);
CveSearchService.Iface cveClient = thriftClients.makeCvesearchClient();
try {
VulnerabilityUpdateStatus importStatus = cveClient.updateForComponent(componentId);
JSONObject responseData = PortletUtils.importStatusToJSON(importStatus);
PrintWriter writer = response.getWriter();
writer.write(responseData.toString());
} catch (TException e) {
log.error("Error updating CVEs for component in backend.", e);
}
}
use of org.eclipse.sw360.datahandler.thrift.cvesearch.VulnerabilityUpdateStatus in project sw360portal by sw360.
the class ProjectPortlet method updateVulnerabilitiesProject.
private void updateVulnerabilitiesProject(ResourceRequest request, ResourceResponse response) throws PortletException, IOException {
String projectId = request.getParameter(PortalConstants.PROJECT_ID);
CveSearchService.Iface cveClient = thriftClients.makeCvesearchClient();
try {
VulnerabilityUpdateStatus importStatus = cveClient.updateForProject(projectId);
JSONObject responseData = PortletUtils.importStatusToJSON(importStatus);
PrintWriter writer = response.getWriter();
writer.write(responseData.toString());
} catch (TException e) {
log.error("Error updating CVEs for project in backend.", e);
}
}
Aggregations