Search in sources :

Example 6 with JiraCloudServiceFactory

use of com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory in project hub-alert by blackducksoftware.

the class JiraCloudPropertiesTest method testServerServiceFactory.

@Test
public void testServerServiceFactory() {
    try {
        JiraCloudProperties properties = new JiraCloudProperties("http://localhost:2990", "token", "user", false, ProxyInfo.NO_PROXY_INFO);
        JiraCloudServiceFactory serviceFactory = properties.createJiraServicesCloudFactory(LoggerFactory.getLogger(getClass()), new Gson());
        assertNotNull(serviceFactory);
    } catch (IssueTrackerException ex) {
        ex.printStackTrace();
        fail();
    }
}
Also used : IssueTrackerException(com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException) JiraCloudServiceFactory(com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory) Gson(com.google.gson.Gson) Test(org.junit.jupiter.api.Test)

Example 7 with JiraCloudServiceFactory

use of com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory in project hub-alert by blackducksoftware.

the class JiraCloudProperties method createJiraServicesCloudFactory.

public JiraCloudServiceFactory createJiraServicesCloudFactory(Logger logger, Gson gson) throws IssueTrackerException {
    JiraCloudRestConfig jiraServerConfig = createJiraServerConfig();
    Slf4jIntLogger intLogger = new Slf4jIntLogger(logger);
    JiraHttpClient jiraHttpClient = jiraServerConfig.createJiraHttpClient(intLogger);
    return new JiraCloudServiceFactory(intLogger, jiraHttpClient, gson);
}
Also used : JiraHttpClient(com.synopsys.integration.jira.common.rest.JiraHttpClient) Slf4jIntLogger(com.synopsys.integration.log.Slf4jIntLogger) JiraCloudRestConfig(com.synopsys.integration.jira.common.cloud.configuration.JiraCloudRestConfig) JiraCloudServiceFactory(com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory)

Example 8 with JiraCloudServiceFactory

use of com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory in project hub-alert by blackducksoftware.

the class JiraCloudMessageSenderFactory method createMessageSender.

@Override
public IssueTrackerMessageSender<String> createMessageSender(JiraCloudJobDetailsModel distributionDetails) throws AlertException {
    JiraCloudProperties jiraCloudProperties = jiraCloudPropertiesFactory.createJiraProperties();
    JiraCloudServiceFactory jiraCloudServiceFactory = jiraCloudProperties.createJiraServicesCloudFactory(logger, gson);
    // Jira Services
    IssueService issueService = jiraCloudServiceFactory.createIssueService();
    IssuePropertyService issuePropertyService = jiraCloudServiceFactory.createIssuePropertyService();
    // Common Helpers
    JiraIssueAlertPropertiesManager issuePropertiesManager = new JiraIssueAlertPropertiesManager(gson, issuePropertyService);
    ProjectService projectService = jiraCloudServiceFactory.createProjectService();
    FieldService fieldService = jiraCloudServiceFactory.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);
}
Also used : IssueService(com.synopsys.integration.jira.common.cloud.service.IssueService) FieldService(com.synopsys.integration.jira.common.cloud.service.FieldService) JiraCustomFieldResolver(com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraCustomFieldResolver) JiraErrorMessageUtility(com.synopsys.integration.alert.api.channel.jira.distribution.JiraErrorMessageUtility) JiraIssueCreationRequestCreator(com.synopsys.integration.alert.api.channel.jira.distribution.JiraIssueCreationRequestCreator) JiraCloudServiceFactory(com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory) IssuePropertyService(com.synopsys.integration.jira.common.rest.service.IssuePropertyService) JiraCloudProperties(com.synopsys.integration.alert.channel.jira.cloud.JiraCloudProperties) ProjectService(com.synopsys.integration.jira.common.cloud.service.ProjectService) JiraIssueAlertPropertiesManager(com.synopsys.integration.alert.api.channel.jira.distribution.search.JiraIssueAlertPropertiesManager)

Aggregations

JiraCloudServiceFactory (com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory)8 JiraCloudProperties (com.synopsys.integration.alert.channel.jira.cloud.JiraCloudProperties)6 JiraErrorMessageUtility (com.synopsys.integration.alert.api.channel.jira.distribution.JiraErrorMessageUtility)2 JiraIssueCreationRequestCreator (com.synopsys.integration.alert.api.channel.jira.distribution.JiraIssueCreationRequestCreator)2 JiraCustomFieldResolver (com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraCustomFieldResolver)2 JiraIssueAlertPropertiesManager (com.synopsys.integration.alert.api.channel.jira.distribution.search.JiraIssueAlertPropertiesManager)2 FieldService (com.synopsys.integration.jira.common.cloud.service.FieldService)2 IssueSearchService (com.synopsys.integration.jira.common.cloud.service.IssueSearchService)2 IssueService (com.synopsys.integration.jira.common.cloud.service.IssueService)2 ProjectService (com.synopsys.integration.jira.common.cloud.service.ProjectService)2 IssuePropertyService (com.synopsys.integration.jira.common.rest.service.IssuePropertyService)2 PluginManagerService (com.synopsys.integration.jira.common.rest.service.PluginManagerService)2 Gson (com.google.gson.Gson)1 IssueTrackerModelExtractor (com.synopsys.integration.alert.api.channel.issue.IssueTrackerModelExtractor)1 IssueTrackerProcessor (com.synopsys.integration.alert.api.channel.issue.IssueTrackerProcessor)1 JiraIssueStatusCreator (com.synopsys.integration.alert.api.channel.jira.distribution.search.JiraIssueStatusCreator)1 JiraSearcherFactory (com.synopsys.integration.alert.api.channel.jira.distribution.search.JiraSearcherFactory)1 ActionResponse (com.synopsys.integration.alert.common.action.ActionResponse)1 IssueTrackerException (com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException)1 IntegrationException (com.synopsys.integration.exception.IntegrationException)1