use of com.synopsys.integration.jira.common.server.service.IssueService in project hub-alert by blackducksoftware.
the class JiraServerProcessorFactory method createProcessor.
@Override
public IssueTrackerProcessor<String> createProcessor(JiraServerJobDetailsModel distributionDetails) throws AlertException {
JiraServerProperties jiraProperties = jiraServerPropertiesFactory.createJiraPropertiesWithJobId(distributionDetails.getJobId());
JiraServerServiceFactory jiraServerServiceFactory = jiraProperties.createJiraServicesServerFactory(logger, gson);
if (!jiraProperties.isPluginCheckDisabled()) {
checkIfAlertPluginIsInstalled(jiraServerServiceFactory.createPluginManagerService());
}
// Jira Services
IssueService issueService = jiraServerServiceFactory.createIssueService();
IssueSearchService issueSearchService = jiraServerServiceFactory.createIssueSearchService();
IssuePropertyService issuePropertyService = jiraServerServiceFactory.createIssuePropertyService();
// Common Helpers
JiraIssueAlertPropertiesManager issuePropertiesManager = new JiraIssueAlertPropertiesManager(gson, issuePropertyService);
// Extractor Requirement
JiraIssueStatusCreator jiraIssueStatusCreator = new JiraIssueStatusCreator(distributionDetails.getResolveTransition(), distributionDetails.getReopenTransition());
JiraSearcherFactory jiraSearcherFactory = new JiraSearcherFactory(issuePropertiesManager, jiraIssueStatusCreator, issueService::getTransitions, issueCategoryRetriever, modelTransformer);
JiraServerQueryExecutor jiraCloudQueryExecutor = new JiraServerQueryExecutor(issueSearchService);
IssueTrackerSearcher<String> jiraSearcher = jiraSearcherFactory.createJiraSearcher(distributionDetails.getProjectNameOrKey(), jiraCloudQueryExecutor);
IssueTrackerModelExtractor<String> extractor = new IssueTrackerModelExtractor<>(jiraMessageFormatter, jiraSearcher);
ProjectService projectService = jiraServerServiceFactory.createProjectService();
FieldService fieldService = jiraServerServiceFactory.createFieldService();
JiraCustomFieldResolver customFieldResolver = new JiraCustomFieldResolver(fieldService::getUserVisibleFields);
JiraIssueCreationRequestCreator issueCreationRequestCreator = new JiraIssueCreationRequestCreator(customFieldResolver);
JiraErrorMessageUtility jiraErrorMessageUtility = new JiraErrorMessageUtility(gson, customFieldResolver);
IssueTrackerMessageSender<String> messageSender = jiraServerMessageSenderFactory.createMessageSender(issueService, distributionDetails, projectService, issueCreationRequestCreator, issuePropertiesManager, jiraErrorMessageUtility);
return new IssueTrackerProcessor<>(extractor, messageSender);
}
use of com.synopsys.integration.jira.common.server.service.IssueService in project hub-alert by blackducksoftware.
the class JiraServerMessageSenderFactory method createMessageSender.
@Override
public IssueTrackerMessageSender<String> createMessageSender(JiraServerJobDetailsModel distributionDetails) throws AlertException {
JiraServerProperties jiraServerProperties = jiraServerPropertiesFactory.createJiraPropertiesWithJobId(distributionDetails.getJobId());
JiraServerServiceFactory jiraServerServiceFactory = jiraServerProperties.createJiraServicesServerFactory(logger, gson);
// Jira Services
IssueService issueService = jiraServerServiceFactory.createIssueService();
IssuePropertyService issuePropertyService = jiraServerServiceFactory.createIssuePropertyService();
// Common Helpers
JiraIssueAlertPropertiesManager issuePropertiesManager = new JiraIssueAlertPropertiesManager(gson, issuePropertyService);
ProjectService projectService = jiraServerServiceFactory.createProjectService();
FieldService fieldService = jiraServerServiceFactory.createFieldService();
JiraCustomFieldResolver customFieldResolver = new JiraCustomFieldResolver(fieldService::getUserVisibleFields);
JiraIssueCreationRequestCreator issueCreationRequestCreator = new JiraIssueCreationRequestCreator(customFieldResolver);
JiraErrorMessageUtility jiraErrorMessageUtility = new JiraErrorMessageUtility(gson, customFieldResolver);
return createMessageSender(issueService, distributionDetails, projectService, issueCreationRequestCreator, issuePropertiesManager, jiraErrorMessageUtility);
}
Aggregations