use of com.synopsys.integration.blackduck.service.dataservice.IssueService in project hub-alert by blackducksoftware.
the class BlackDuckIssueTrackerCallbackEventHandler method handle.
@Override
public void handle(IssueTrackerCallbackEvent event) {
String eventId = event.getEventId();
logger.debug("Handling issue-tracker callback event with id '{}'", eventId);
IssueTrackerCallbackInfo callbackInfo = event.getCallbackInfo();
Optional<BlackDuckServicesFactory> optionalBlackDuckServicesFactory = createBlackDuckProperties(callbackInfo.getProviderConfigId()).flatMap(this::createBlackDuckServicesFactory);
if (optionalBlackDuckServicesFactory.isPresent()) {
BlackDuckServicesFactory blackDuckServicesFactory = optionalBlackDuckServicesFactory.get();
BlackDuckApiClient blackDuckApiClient = blackDuckServicesFactory.getBlackDuckApiClient();
IssueService blackDuckIssueService = blackDuckServicesFactory.createIssueService();
BlackDuckProviderIssueHandler blackDuckProviderIssueHandler = new BlackDuckProviderIssueHandler(gson, blackDuckApiClient, blackDuckIssueService);
BlackDuckProviderIssueModel issueModel = createBlackDuckIssueModel(event);
createOrUpdateBlackDuckIssue(blackDuckProviderIssueHandler, issueModel, callbackInfo);
}
logger.debug("Finished handling issue-tracker callback event with id '{}'", eventId);
}
Aggregations