com.atlassian.jira.plugin.link.remotejira
Class RemoteJiraRestServiceImpl

java.lang.Object
  extended by com.atlassian.jira.plugin.link.remotejira.RemoteJiraRestServiceImpl
All Implemented Interfaces:
RemoteJiraRestService

public class RemoteJiraRestServiceImpl
extends Object
implements RemoteJiraRestService

Helper class for making REST calls to JIRA servers. Supported REST API versions are: - 2.0alpha1 - 2

Since:
v5.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.plugin.link.remotejira.RemoteJiraRestService
RemoteJiraRestService.RestVersion
 
Constructor Summary
RemoteJiraRestServiceImpl(com.atlassian.applinks.host.spi.InternalHostApplication internalHostApplication, com.atlassian.sal.api.net.RequestFactory<com.atlassian.sal.api.net.Request<?,com.atlassian.sal.api.net.Response>> requestFactory)
           
 
Method Summary
static String buildIssueUrl(String baseUri, String issueKey)
           
 RemoteResponse createRemoteIssueLink(com.atlassian.applinks.api.ApplicationLink applicationLink, String remoteIssueKey, Issue issue, String relationship, RemoteJiraRestService.RestVersion restVersion)
          Creates a remote issue link between the given remote issue and the given local issue.
 RemoteResponse<RemoteJiraIssue> getIssue(com.atlassian.applinks.api.ApplicationLink applicationLink, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion)
          Gets the issue with the given key, on the JIRA server given by the application link.
 RemoteResponse<RemoteJiraIssue> getIssue(String baseUri, String issueIdOrKey, RemoteJiraRestService.RestVersion restVersion)
          Gets the issue with the given key, on the JIRA server given by the application link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteJiraRestServiceImpl

public RemoteJiraRestServiceImpl(com.atlassian.applinks.host.spi.InternalHostApplication internalHostApplication,
                                 com.atlassian.sal.api.net.RequestFactory<com.atlassian.sal.api.net.Request<?,com.atlassian.sal.api.net.Response>> requestFactory)
Method Detail

getIssue

public RemoteResponse<RemoteJiraIssue> getIssue(com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                String issueIdOrKey,
                                                RemoteJiraRestService.RestVersion restVersion)
                                         throws com.atlassian.applinks.api.CredentialsRequiredException,
                                                com.atlassian.sal.api.net.ResponseException
Description copied from interface: RemoteJiraRestService
Gets the issue with the given key, on the JIRA server given by the application link.

Specified by:
getIssue in interface RemoteJiraRestService
Parameters:
applicationLink - the application link of the JIRA server
issueIdOrKey - the issue ID or key
restVersion - the version of the REST API to invoke
Returns:
an RemoteResponse containing a JSONObject and properties of the HTTP response
Throws:
com.atlassian.applinks.api.CredentialsRequiredException - thrown if authentication is required
com.atlassian.sal.api.net.ResponseException - thrown if the response cannot be retrieved

getIssue

public RemoteResponse<RemoteJiraIssue> getIssue(String baseUri,
                                                String issueIdOrKey,
                                                RemoteJiraRestService.RestVersion restVersion)
                                         throws com.atlassian.applinks.api.CredentialsRequiredException,
                                                com.atlassian.sal.api.net.ResponseException
Description copied from interface: RemoteJiraRestService
Gets the issue with the given key, on the JIRA server given by the application link.

Specified by:
getIssue in interface RemoteJiraRestService
Parameters:
baseUri - the base URI of the JIRA instance
issueIdOrKey - the issue ID or key
restVersion - the version of the REST API to invoke
Returns:
an RemoteResponse containing a JSONObject and properties of the HTTP response
Throws:
com.atlassian.applinks.api.CredentialsRequiredException - thrown if authentication is required
com.atlassian.sal.api.net.ResponseException - thrown if the response cannot be retrieved

createRemoteIssueLink

public RemoteResponse createRemoteIssueLink(com.atlassian.applinks.api.ApplicationLink applicationLink,
                                            String remoteIssueKey,
                                            Issue issue,
                                            String relationship,
                                            RemoteJiraRestService.RestVersion restVersion)
                                     throws com.atlassian.applinks.api.CredentialsRequiredException,
                                            com.atlassian.sal.api.net.ResponseException
Description copied from interface: RemoteJiraRestService
Creates a remote issue link between the given remote issue and the given local issue.

Specified by:
createRemoteIssueLink in interface RemoteJiraRestService
Parameters:
applicationLink - the application link of the remote JIRA server
remoteIssueKey - the issue key of the remote issue
issue - the local issue
relationship - the relationship for the link
restVersion - the version of the REST API to invoke
Returns:
an RemoteResponse containing a JSONObject and properties of the HTTP response
Throws:
com.atlassian.applinks.api.CredentialsRequiredException - thrown if authentication is required
com.atlassian.sal.api.net.ResponseException - thrown if the response cannot be retrieved

buildIssueUrl

public static String buildIssueUrl(String baseUri,
                                   String issueKey)


Copyright © 2002-2012 Atlassian. All Rights Reserved.