Search in sources :

Example 1 with AzureWorkItemQueryService

use of com.synopsys.integration.azure.boards.common.service.query.AzureWorkItemQueryService in project hub-alert by blackducksoftware.

the class AzureBoardsProcessorFactory method createProcessor.

@Override
public IssueTrackerProcessor<Integer> createProcessor(AzureBoardsJobDetailsModel distributionDetails) throws AlertException {
    AzureBoardsProperties azureBoardsProperties = azureBoardsPropertiesFactory.createAzureBoardsProperties();
    String organizationName = azureBoardsProperties.getOrganizationName();
    azureBoardsProperties.validateProperties();
    // Initialize Http Service
    ProxyInfo proxy = proxyManager.createProxyInfoForHost(AzureHttpRequestCreatorFactory.DEFAULT_BASE_URL);
    AzureHttpRequestCreator azureHttpRequestCreator = azureBoardsProperties.createAzureHttpRequestCreator(proxy, gson);
    AzureHttpService azureHttpService = new AzureHttpService(gson, azureHttpRequestCreator);
    // Common Azure Boards Services
    AzureApiVersionAppender apiVersionAppender = new AzureApiVersionAppender();
    AzureProjectService projectService = new AzureProjectService(azureHttpService, apiVersionAppender);
    AzureWorkItemService workItemService = new AzureWorkItemService(azureHttpService, azureHttpRequestCreator);
    AzureWorkItemQueryService workItemQueryService = new AzureWorkItemQueryService(azureHttpService, apiVersionAppender);
    String projectNameOrId = distributionDetails.getProjectNameOrId();
    String teamProjectName = retrieveProjectNameIfNecessary(projectService, organizationName, projectNameOrId);
    installCustomFieldsIfNecessary(organizationName, teamProjectName, distributionDetails.getWorkItemType(), projectService, new AzureProcessService(azureHttpService, apiVersionAppender));
    // Searcher Requirements
    AzureBoardsIssueStatusResolver azureBoardsIssueStatusResolver = new AzureBoardsIssueStatusResolver(distributionDetails.getWorkItemCompletedState(), distributionDetails.getWorkItemReopenState());
    AzureBoardsIssueTrackerQueryManager queryManager = new AzureBoardsIssueTrackerQueryManager(organizationName, distributionDetails, workItemService, workItemQueryService);
    // Extractor Requirements
    AzureBoardsExistingIssueDetailsCreator issueDetailsCreator = new AzureBoardsExistingIssueDetailsCreator(organizationName, issueCategoryRetriever, azureBoardsIssueStatusResolver);
    AzureBoardsWorkItemFinder workItemFinder = new AzureBoardsWorkItemFinder(queryManager, teamProjectName);
    AzureBoardsProjectAndVersionIssueFinder projectAndVersionIssueFinder = new AzureBoardsProjectAndVersionIssueFinder(gson, issueDetailsCreator, workItemFinder);
    AzureBoardsComponentIssueFinder componentIssueFinder = new AzureBoardsComponentIssueFinder(gson, workItemFinder, issueDetailsCreator);
    IssueTrackerSearcher<Integer> azureBoardsSearcher = new IssueTrackerSearcher<>(projectAndVersionIssueFinder, projectAndVersionIssueFinder, componentIssueFinder, componentIssueFinder, modelTransformer);
    IssueTrackerModelExtractor<Integer> extractor = new IssueTrackerModelExtractor<>(formatter, azureBoardsSearcher);
    // Message Sender Requirements
    AzureWorkItemTypeStateService workItemTypeStateService = new AzureWorkItemTypeStateService(azureHttpService, apiVersionAppender);
    AzureWorkItemCommentService workItemCommentService = new AzureWorkItemCommentService(azureHttpService, apiVersionAppender);
    IssueTrackerMessageSender<Integer> messageSender = azureBoardsMessageSenderFactory.createMessageSender(workItemService, workItemTypeStateService, workItemCommentService, organizationName, distributionDetails);
    return new IssueTrackerProcessor<>(extractor, messageSender);
}
Also used : AzureBoardsProjectAndVersionIssueFinder(com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsProjectAndVersionIssueFinder) AzureBoardsWorkItemFinder(com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsWorkItemFinder) AzureWorkItemTypeStateService(com.synopsys.integration.azure.boards.common.service.state.AzureWorkItemTypeStateService) AzureWorkItemQueryService(com.synopsys.integration.azure.boards.common.service.query.AzureWorkItemQueryService) ProxyInfo(com.synopsys.integration.rest.proxy.ProxyInfo) IssueTrackerModelExtractor(com.synopsys.integration.alert.api.channel.issue.IssueTrackerModelExtractor) AzureWorkItemCommentService(com.synopsys.integration.azure.boards.common.service.comment.AzureWorkItemCommentService) AzureHttpRequestCreator(com.synopsys.integration.azure.boards.common.http.AzureHttpRequestCreator) AzureHttpService(com.synopsys.integration.azure.boards.common.http.AzureHttpService) AzureBoardsExistingIssueDetailsCreator(com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsExistingIssueDetailsCreator) AzureBoardsProperties(com.synopsys.integration.alert.channel.azure.boards.AzureBoardsProperties) IssueTrackerProcessor(com.synopsys.integration.alert.api.channel.issue.IssueTrackerProcessor) IssueTrackerSearcher(com.synopsys.integration.alert.api.channel.issue.search.IssueTrackerSearcher) AzureProjectService(com.synopsys.integration.azure.boards.common.service.project.AzureProjectService) AzureApiVersionAppender(com.synopsys.integration.azure.boards.common.http.AzureApiVersionAppender) AzureBoardsComponentIssueFinder(com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsComponentIssueFinder) AzureBoardsIssueStatusResolver(com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsIssueStatusResolver) AzureWorkItemService(com.synopsys.integration.azure.boards.common.service.workitem.AzureWorkItemService) AzureProcessService(com.synopsys.integration.azure.boards.common.service.process.AzureProcessService)

Aggregations

IssueTrackerModelExtractor (com.synopsys.integration.alert.api.channel.issue.IssueTrackerModelExtractor)1 IssueTrackerProcessor (com.synopsys.integration.alert.api.channel.issue.IssueTrackerProcessor)1 IssueTrackerSearcher (com.synopsys.integration.alert.api.channel.issue.search.IssueTrackerSearcher)1 AzureBoardsProperties (com.synopsys.integration.alert.channel.azure.boards.AzureBoardsProperties)1 AzureBoardsComponentIssueFinder (com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsComponentIssueFinder)1 AzureBoardsExistingIssueDetailsCreator (com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsExistingIssueDetailsCreator)1 AzureBoardsIssueStatusResolver (com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsIssueStatusResolver)1 AzureBoardsProjectAndVersionIssueFinder (com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsProjectAndVersionIssueFinder)1 AzureBoardsWorkItemFinder (com.synopsys.integration.alert.channel.azure.boards.distribution.search.AzureBoardsWorkItemFinder)1 AzureApiVersionAppender (com.synopsys.integration.azure.boards.common.http.AzureApiVersionAppender)1 AzureHttpRequestCreator (com.synopsys.integration.azure.boards.common.http.AzureHttpRequestCreator)1 AzureHttpService (com.synopsys.integration.azure.boards.common.http.AzureHttpService)1 AzureWorkItemCommentService (com.synopsys.integration.azure.boards.common.service.comment.AzureWorkItemCommentService)1 AzureProcessService (com.synopsys.integration.azure.boards.common.service.process.AzureProcessService)1 AzureProjectService (com.synopsys.integration.azure.boards.common.service.project.AzureProjectService)1 AzureWorkItemQueryService (com.synopsys.integration.azure.boards.common.service.query.AzureWorkItemQueryService)1 AzureWorkItemTypeStateService (com.synopsys.integration.azure.boards.common.service.state.AzureWorkItemTypeStateService)1 AzureWorkItemService (com.synopsys.integration.azure.boards.common.service.workitem.AzureWorkItemService)1 ProxyInfo (com.synopsys.integration.rest.proxy.ProxyInfo)1