|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.studio.jira.servlet.filter.ContextPathToApplicationInstanceTranslator
public class ContextPathToApplicationInstanceTranslator
Given a URL or a relative path and JIRA's context path, this translator works out the remote primary applinked instances of CONFLUENCE, FECRU or BAMBOO, and returns the ApplicationInstance and the context path it uses. This works in both production environment as well as the development environment (localhost) as well Example: When being redirected to a destination after login, we need to establish if the destination belongs to a remote primary applinked application. In production, if the destination is "/wiki/dashboard.action", JIRA context path is "/", this will work out that the destination is actually a remote primary Confluence instance. In development environment, the destination is "/jira/wiki/dashboard.action", JIRA context path is "/jira", this will still work out that the destination is remote primary Confluence instance.
Constructor Summary | |
---|---|
ContextPathToApplicationInstanceTranslator(com.atlassian.applinks.core.AppLinksManager appLinksManager)
|
Method Summary | |
---|---|
void |
destroy()
|
com.google.common.base.Function<com.atlassian.applinks.core.ApplicationInstance,com.atlassian.applinks.core.Application> |
extractApplication()
|
com.google.common.base.Function<? super com.atlassian.fugue.Pair<String,com.atlassian.applinks.core.ApplicationInstance>,com.atlassian.applinks.core.ApplicationInstance> |
extractApplicationInstance()
|
com.atlassian.fugue.Option<com.atlassian.applinks.core.Application> |
findApplicationByUri(String location,
String currentContextPath)
Returns application type of the remote primary application instance that the given location belongs to. |
com.atlassian.fugue.Option<com.atlassian.applinks.core.ApplicationInstance> |
findApplicationInstanceByUri(String location,
String currentContextPath)
Returns the remote primary application instance that the given location belongs to. |
com.atlassian.fugue.Option<com.atlassian.fugue.Pair<String,com.atlassian.applinks.core.ApplicationInstance>> |
findByUri(String location,
String currentContextPath)
Returns the context path and the remote primary application instance that the given location belongs to. |
void |
instanceAdded(com.atlassian.applinks.core.ApplicationInstanceEvent event)
|
void |
instanceMadePrimary(com.atlassian.applinks.core.ApplicationInstanceEvent event)
|
void |
instanceRemoved(com.atlassian.applinks.core.ApplicationInstanceEvent event)
|
void |
instanceUpdated(com.atlassian.applinks.core.ApplicationInstanceEvent event)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContextPathToApplicationInstanceTranslator(com.atlassian.applinks.core.AppLinksManager appLinksManager)
Method Detail |
---|
public com.atlassian.fugue.Option<com.atlassian.applinks.core.Application> findApplicationByUri(String location, String currentContextPath)
location
- the full URL, or a relative URI with or without the current context pathcurrentContextPath
- the current context path if location is a relative URI with the current context path,
or empty String if the location is a relative URI without the current context path. It doesn't matter if the
location is a full URL.
public com.google.common.base.Function<com.atlassian.applinks.core.ApplicationInstance,com.atlassian.applinks.core.Application> extractApplication()
public com.atlassian.fugue.Option<com.atlassian.applinks.core.ApplicationInstance> findApplicationInstanceByUri(String location, String currentContextPath)
location
- the full URL, or a relative URI with or without the current context pathcurrentContextPath
- the current context path if location is a relative URI with the current context path,
or empty String if the location is a relative URI without the current context path. It doesn't matter if the
location is a full URL.
public com.google.common.base.Function<? super com.atlassian.fugue.Pair<String,com.atlassian.applinks.core.ApplicationInstance>,com.atlassian.applinks.core.ApplicationInstance> extractApplicationInstance()
public com.atlassian.fugue.Option<com.atlassian.fugue.Pair<String,com.atlassian.applinks.core.ApplicationInstance>> findByUri(String location, String currentContextPath)
location
- the full URL, or a relative URI with or without the current context pathcurrentContextPath
- the current context path if location is a relative URI with the current context path,
or empty String if the location is a relative URI without the current context path. It doesn't matter if the
location is a full URL.
public void instanceAdded(com.atlassian.applinks.core.ApplicationInstanceEvent event)
instanceAdded
in interface com.atlassian.applinks.core.ApplicationInstanceEventListener
public void instanceMadePrimary(com.atlassian.applinks.core.ApplicationInstanceEvent event)
instanceMadePrimary
in interface com.atlassian.applinks.core.ApplicationInstanceEventListener
public void instanceRemoved(com.atlassian.applinks.core.ApplicationInstanceEvent event)
instanceRemoved
in interface com.atlassian.applinks.core.ApplicationInstanceEventListener
public void instanceUpdated(com.atlassian.applinks.core.ApplicationInstanceEvent event)
instanceUpdated
in interface com.atlassian.applinks.core.ApplicationInstanceEventListener
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |