use of com.synopsys.integration.alert.common.enumeration.ProcessingType in project hub-alert by blackducksoftware.
the class DefaultProcessingJobAccessor method convertToFilteredDistributionJobResponseModel.
private FilteredDistributionJobResponseModel convertToFilteredDistributionJobResponseModel(DistributionJobEntity jobEntity) {
UUID jobId = jobEntity.getJobId();
ProcessingType processingType = Enum.valueOf(ProcessingType.class, jobEntity.getProcessingType());
String channelName = jobEntity.getChannelDescriptorName();
String jobName = jobEntity.getName();
BlackDuckJobDetailsEntity blackDuckJobDetails = jobEntity.getBlackDuckJobDetails();
List<String> notificationTypes = blackDuckJobDetailsAccessor.retrieveNotificationTypesForJob(jobId);
List<BlackDuckProjectDetailsModel> projectDetails = blackDuckJobDetailsAccessor.retrieveProjectDetailsForJob(jobId);
List<String> policyNames = blackDuckJobDetailsAccessor.retrievePolicyNamesForJob(jobId);
List<String> vulnerabilitySeverityNames = blackDuckJobDetailsAccessor.retrieveVulnerabilitySeverityNamesForJob(jobId);
boolean filterByProject = blackDuckJobDetails.getFilterByProject();
String projectNamePattern = blackDuckJobDetails.getProjectNamePattern();
String projectVersionNamePattern = blackDuckJobDetails.getProjectVersionNamePattern();
return new FilteredDistributionJobResponseModel(jobId, processingType, channelName, jobName, notificationTypes, projectDetails, policyNames, vulnerabilitySeverityNames, filterByProject, projectNamePattern, projectVersionNamePattern);
}
use of com.synopsys.integration.alert.common.enumeration.ProcessingType in project hub-alert by blackducksoftware.
the class ProcessingSelectCustomFunctionAction method createActionResponse.
@Override
public ActionResponse<LabelValueSelectOptions> createActionResponse(FieldModel fieldModel, HttpServletContentWrapper servletContentWrapper) {
String channelName = fieldModel.getFieldValue(ChannelDescriptor.KEY_CHANNEL_NAME).orElse("");
List<LabelValueSelectOption> options = Arrays.stream(ProcessingType.values()).filter(processingType -> this.shouldInclude(processingType, channelName)).map(processingType -> new LabelValueSelectOption(processingType.getLabel(), processingType.name())).collect(Collectors.toList());
LabelValueSelectOptions optionList = new LabelValueSelectOptions(options);
return new ActionResponse<>(HttpStatus.OK, optionList);
}
Aggregations