com.atlassian.bamboo.jira.jiraissues
Class JiraRemoteIssueManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.jira.jiraissues.JiraRemoteIssueManagerImpl
All Implemented Interfaces:
JiraRemoteIssueManager

public class JiraRemoteIssueManagerImpl
extends java.lang.Object
implements JiraRemoteIssueManager


Constructor Summary
JiraRemoteIssueManagerImpl(JiraApplinksService jiraApplinksService, JiraIssueDetailsBuilderFactory jiraIssueDetailsBuilderFactory)
           
 
Method Summary
protected  java.lang.String constructSearchUrl(java.lang.String projectKey, java.util.List<java.lang.String> issueKeys)
          Construct JIRA search URL
 Result<com.atlassian.applinks.api.CredentialsRequiredException,java.util.List<JiraIssueDetails>> fetchIssueDetailsFromJira(com.atlassian.applinks.api.ApplicationLink applicationLink, java.lang.String jiraProjectKey, java.util.Set<java.lang.String> jiraIssueKeys)
          Fetch issue details from JIRA via XML Search.
protected  Result<com.atlassian.applinks.api.CredentialsRequiredException,java.lang.Iterable<JiraIssueDetails>> fetchPartitionedIssueDetailsFromJira(com.atlassian.applinks.api.ApplicationLink applicationLink, java.lang.String jiraProjectKey, java.util.List<java.lang.String> jiraIssueKeysBatch)
          Fetch details of JIRA issues using JQL and XML search
 java.lang.Iterable<com.atlassian.applinks.host.spi.EntityReference> fetchProjectInformationFromJira(com.atlassian.applinks.api.ApplicationLink applicationLink)
          Fetch project list from JIRA using REST service provided by applinks.
 com.atlassian.applinks.api.ApplicationLink getJiraApplicationLink(java.lang.String jiraProjectKey, Project project)
          Retrieves the 'best' application link for a given JIRA project key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraRemoteIssueManagerImpl

public JiraRemoteIssueManagerImpl(JiraApplinksService jiraApplinksService,
                                  JiraIssueDetailsBuilderFactory jiraIssueDetailsBuilderFactory)
Method Detail

fetchIssueDetailsFromJira

@NotNull
public Result<com.atlassian.applinks.api.CredentialsRequiredException,java.util.List<JiraIssueDetails>> fetchIssueDetailsFromJira(@NotNull
                                                                                                                                          com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                                                                                                          @NotNull
                                                                                                                                          java.lang.String jiraProjectKey,
                                                                                                                                          @NotNull
                                                                                                                                          java.util.Set<java.lang.String> jiraIssueKeys)
Description copied from interface: JiraRemoteIssueManager
Fetch issue details from JIRA via XML Search. Internally issue keys are partitioned to avoid too big queries to JIRA.

Specified by:
fetchIssueDetailsFromJira in interface JiraRemoteIssueManager
Parameters:
applicationLink - identifies JIRA application to fetch issue details from
jiraProjectKey - JIRA project key (all issue keys should be from this project)
jiraIssueKeys - keys of issues to be searched in JIRA
Returns:
List of JiraIssueDetails objects representing JIRA issues or CredentialsRequiredException when authentication is required in order to establish connection with JIRA

fetchProjectInformationFromJira

@NotNull
public java.lang.Iterable<com.atlassian.applinks.host.spi.EntityReference> fetchProjectInformationFromJira(@NotNull
                                                                                                                   com.atlassian.applinks.api.ApplicationLink applicationLink)
                                                                                                    throws CredentialsRequiredContextException,
                                                                                                           com.atlassian.sal.api.net.ResponseException
Description copied from interface: JiraRemoteIssueManager
Fetch project list from JIRA using REST service provided by applinks.

Specified by:
fetchProjectInformationFromJira in interface JiraRemoteIssueManager
Parameters:
applicationLink - identifies JIRA application to fetch project list from
Returns:
Iterable of EntityReference objects representing JIRA projects
Throws:
CredentialsRequiredContextException
com.atlassian.sal.api.net.ResponseException

getJiraApplicationLink

public com.atlassian.applinks.api.ApplicationLink getJiraApplicationLink(@NotNull
                                                                         java.lang.String jiraProjectKey,
                                                                         @Nullable
                                                                         Project project)
                                                                  throws CredentialsRequiredContextException,
                                                                         com.atlassian.sal.api.net.ResponseException
Description copied from interface: JiraRemoteIssueManager
Retrieves the 'best' application link for a given JIRA project key. If project is supplied, It checks the primary entity link first, then proceeds with all other links. If project is not supplied, or no entity link has been found, then application links are searched: primary first, the all others.

Specified by:
getJiraApplicationLink in interface JiraRemoteIssueManager
Parameters:
jiraProjectKey - the JIRA project key that has to be available in the returned application.
project - the project to check for entity links (optional)
Returns:
application link to an application with a defined jiraProjectKey
Throws:
CredentialsRequiredContextException
com.atlassian.sal.api.net.ResponseException

fetchPartitionedIssueDetailsFromJira

protected Result<com.atlassian.applinks.api.CredentialsRequiredException,java.lang.Iterable<JiraIssueDetails>> fetchPartitionedIssueDetailsFromJira(@NotNull
                                                                                                                                                    com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                                                                                                                    @NotNull
                                                                                                                                                    java.lang.String jiraProjectKey,
                                                                                                                                                    @NotNull
                                                                                                                                                    java.util.List<java.lang.String> jiraIssueKeysBatch)
Fetch details of JIRA issues using JQL and XML search

Parameters:
applicationLink - link to JIRA application which will handle search operation
jiraProjectKey - JIRA project key
jiraIssueKeysBatch - JIRA issue keys (up to XML_SEARCH_MAX_QUERY_SIZE)
Returns:
Iterable of JiraIssueDetails fetched from JIRA or CredentialsRequiredException when authentication is required

constructSearchUrl

@NotNull
protected java.lang.String constructSearchUrl(@NotNull
                                                      java.lang.String projectKey,
                                                      @NotNull
                                                      java.util.List<java.lang.String> issueKeys)
Construct JIRA search URL

Parameters:
projectKey - JIRA project key
issueKeys - JIRA issue keys to be searched
Returns:
String to be added to JIRA RPC url to be used in http request


Copyright © 2012 Atlassian. All Rights Reserved.