Search in sources :

Example 1 with IssueService

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);
}
Also used : IssueService(com.synopsys.integration.blackduck.service.dataservice.IssueService) BlackDuckApiClient(com.synopsys.integration.blackduck.service.BlackDuckApiClient) IssueTrackerCallbackInfo(com.synopsys.integration.alert.common.channel.issuetracker.message.IssueTrackerCallbackInfo) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)

Aggregations

IssueTrackerCallbackInfo (com.synopsys.integration.alert.common.channel.issuetracker.message.IssueTrackerCallbackInfo)1 BlackDuckApiClient (com.synopsys.integration.blackduck.service.BlackDuckApiClient)1 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)1 IssueService (com.synopsys.integration.blackduck.service.dataservice.IssueService)1