Search in sources :

Example 1 with ComponentUnknownVersionStatus

use of com.synopsys.integration.blackduck.api.manual.enumeration.ComponentUnknownVersionStatus in project hub-alert by blackducksoftware.

the class ComponentUnknownVersionExtractor method createComponentConcerns.

private List<ComponentConcern> createComponentConcerns(ComponentUnknownVersionWithStatusNotificationContent notificationContent) {
    ComponentUnknownVersionStatus status = notificationContent.getStatus();
    String componentName = notificationContent.getComponentName();
    ItemOperation itemOperation = ComponentUnknownVersionStatus.REMOVED == status ? ItemOperation.DELETE : ItemOperation.ADD;
    ComponentConcern criticalCount = createComponentConcernWithCount(itemOperation, ComponentConcernSeverity.CRITICAL, notificationContent.getCriticalVulnerabilityCount(), componentName, notificationContent.getCriticalVulnerabilityVersionName(), notificationContent.getCriticalVulnerabilityVersion());
    ComponentConcern highCount = createComponentConcernWithCount(itemOperation, ComponentConcernSeverity.MAJOR_HIGH, notificationContent.getHighVulnerabilityCount(), componentName, notificationContent.getHighVulnerabilityVersionName(), notificationContent.getHighVulnerabilityVersion());
    ComponentConcern mediumCount = createComponentConcernWithCount(itemOperation, ComponentConcernSeverity.MINOR_MEDIUM, notificationContent.getMediumVulnerabilityCount(), componentName, notificationContent.getMediumVulnerabilityVersionName(), notificationContent.getMediumVulnerabilityVersion());
    ComponentConcern lowCount = createComponentConcernWithCount(itemOperation, ComponentConcernSeverity.TRIVIAL_LOW, notificationContent.getLowVulnerabilityCount(), componentName, notificationContent.getLowVulnerabilityVersionName(), notificationContent.getLowVulnerabilityVersion());
    return List.of(criticalCount, highCount, mediumCount, lowCount);
}
Also used : ComponentUnknownVersionStatus(com.synopsys.integration.blackduck.api.manual.enumeration.ComponentUnknownVersionStatus) ItemOperation(com.synopsys.integration.alert.common.enumeration.ItemOperation) ComponentConcern(com.synopsys.integration.alert.processor.api.extract.model.project.ComponentConcern)

Aggregations

ItemOperation (com.synopsys.integration.alert.common.enumeration.ItemOperation)1 ComponentConcern (com.synopsys.integration.alert.processor.api.extract.model.project.ComponentConcern)1 ComponentUnknownVersionStatus (com.synopsys.integration.blackduck.api.manual.enumeration.ComponentUnknownVersionStatus)1