public class ApplinkHelpers extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ApplinkHelpers.Callback<U,T> |
Modifier and Type | Field and Description |
---|---|
private com.atlassian.applinks.api.ApplicationLinkService |
applicationLinkService |
static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
ApplinkHelpers(com.atlassian.applinks.api.ApplicationLinkService applicationLinkService) |
Modifier and Type | Method and Description |
---|---|
static String |
buildCallbackUrlFromStaticRequest(com.atlassian.applinks.api.CredentialsRequiredException e,
javax.servlet.http.HttpServletRequest request) |
<U,T> T |
createRequest(U descriptor,
ApplinkHelpers.Callback<U,T> callback,
com.atlassian.applinks.api.ApplicationLink applink,
Supplier<String> hostUrl,
Supplier<String> webpageUrl,
Supplier<javax.servlet.http.HttpServletRequest> request,
Supplier<String[]> currentUserKeyAndName)
This method is indended for IntegrationManagers in Jira and Confluence, to create a request with a few more features.
|
com.atlassian.applinks.api.ApplicationLinkRequestFactory |
createRequestFactory(com.atlassian.applinks.api.ApplicationLink applicationLink)
Deprecated.
Since 2.2.2, use IntegrationManager.createRequest() instead. This method can be used without problem, but I'd like
to centralize the management of OAuth/connection errors.
|
private com.atlassian.applinks.api.ApplicationLinkRequestFactory |
createRequestFactoryFromApplink(com.atlassian.applinks.api.ApplicationLink applicationLink)
Creates a classic RequestFactory straight from an applink.
|
static String |
extractOAuthProblem(com.atlassian.sal.api.net.Response response) |
List<com.atlassian.applinks.api.ApplicationLink> |
fetchCorrespondingApplinks(String applinkList,
MessageBean errorBean)
Given a comma-separated list of applinks, returns the list of ApplicationLink, and errors in the errorbean.
|
com.atlassian.applinks.api.ApplicationLink |
getApplinkByUrl(String applinkId,
String url) |
static String |
getBodyAsString(com.atlassian.sal.api.net.Response response) |
Map<String,com.atlassian.applinks.api.ApplicationLink> |
getConfluenceApplinksAsMap() |
List<com.atlassian.applinks.api.ApplicationLink> |
getJiraApplicationLinks() |
public static final org.apache.log4j.Logger log
private final com.atlassian.applinks.api.ApplicationLinkService applicationLinkService
public ApplinkHelpers(com.atlassian.applinks.api.ApplicationLinkService applicationLinkService)
public static String buildCallbackUrlFromStaticRequest(com.atlassian.applinks.api.CredentialsRequiredException e, javax.servlet.http.HttpServletRequest request)
public static String extractOAuthProblem(com.atlassian.sal.api.net.Response response)
public List<com.atlassian.applinks.api.ApplicationLink> getJiraApplicationLinks()
public com.atlassian.applinks.api.ApplicationLinkRequestFactory createRequestFactory(com.atlassian.applinks.api.ApplicationLink applicationLink)
applicationLink
- the link we want to create a factory forprivate com.atlassian.applinks.api.ApplicationLinkRequestFactory createRequestFactoryFromApplink(com.atlassian.applinks.api.ApplicationLink applicationLink)
applicationLink
- the link we want to create a factory forpublic List<com.atlassian.applinks.api.ApplicationLink> fetchCorrespondingApplinks(String applinkList, MessageBean errorBean)
applinkList
- null, "" or a comma-separated list of applink IDs.public com.atlassian.applinks.api.ApplicationLink getApplinkByUrl(String applinkId, String url)
public Map<String,com.atlassian.applinks.api.ApplicationLink> getConfluenceApplinksAsMap()
public static String getBodyAsString(com.atlassian.sal.api.net.Response response)
public <U,T> T createRequest(U descriptor, ApplinkHelpers.Callback<U,T> callback, com.atlassian.applinks.api.ApplicationLink applink, Supplier<String> hostUrl, @Nullable Supplier<String> webpageUrl, Supplier<javax.servlet.http.HttpServletRequest> request, Supplier<String[]> currentUserKeyAndName) throws ApplinkException
webpageUrl
- the URL of the webpage to visit after the OAuth dance, if necessaryApplinkException
- if an error was met, either in creating the request, either thrown by the callback directlyCredentialsException
Copyright © 2022 Requirement Yogi. All rights reserved.