public class ProxyUriUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROXY_APPROVAL_PARAM
Query Parameter indicating that the URI was approved.
|
static String |
PROXY_BASE
Base path where the proxy servlet will handle requests.
|
static String |
PROXY_PATH_SPEC
Path Specification for the proxy servlet.
|
static String |
PROXY_SERVLET_NAME
Name of the servlet to use when registering the proxy servlet.
|
Constructor and Description |
---|
ProxyUriUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getPath(ApplicationId id)
Get the proxied path for an application.
|
static String |
getPath(ApplicationId id,
String path)
Get the proxied path for an application.
|
static String |
getPathAndQuery(ApplicationId id,
String path,
String query,
boolean approved)
Get the proxied path for an application
|
static URI |
getProxyUri(URI originalUri,
URI proxyUri,
ApplicationId id)
Get a proxied URI for the original URI.
|
static String |
getSchemeFromUrl(String url)
Returns the scheme if present in the url
eg.
|
static URI |
getUriFromAMUrl(String url)
Create a URI form a no scheme Url, such as is returned by the AM.
|
static URI |
getUriFromAMUrl(String scheme,
String noSchemeUrl)
Create a URI form a no scheme Url, such as is returned by the AM.
|
static URI |
getUriFromTrackingPlugins(ApplicationId id,
List<TrackingUriPlugin> trackingUriPlugins)
Returns the first valid tracking link, if any, from the given id from the
given list of plug-ins, if any.
|
public static final String PROXY_SERVLET_NAME
public static final String PROXY_BASE
public static final String PROXY_PATH_SPEC
public static final String PROXY_APPROVAL_PARAM
public static String getPath(ApplicationId id)
id
- the application id to use.public static String getPath(ApplicationId id, String path)
id
- the application id to use.path
- the rest of the path to the application.public static String getPathAndQuery(ApplicationId id, String path, String query, boolean approved)
id
- the id of the applicationpath
- the path of the application.query
- the query parametersapproved
- true if the user has approved accessing this app.public static URI getProxyUri(URI originalUri, URI proxyUri, ApplicationId id)
originalUri
- the original URI to go through the proxy, or null if
a default path "/" can be used.proxyUri
- the URI of the proxy itself, scheme, host and port are used.id
- the id of the applicationpublic static URI getUriFromAMUrl(String url) throws URISyntaxException
url
- the URL format returned by an AM. This may or may not contain
scheme.URISyntaxException
- if the url is not formatted correctly.public static URI getUriFromAMUrl(String scheme, String noSchemeUrl) throws URISyntaxException
noSchemeUrl
- the URL formate returned by an AMURISyntaxException
- if the url is not formatted correctly.public static URI getUriFromTrackingPlugins(ApplicationId id, List<TrackingUriPlugin> trackingUriPlugins) throws URISyntaxException
id
- the id of the application for which the tracking link is desiredtrackingUriPlugins
- list of plugins from which to get the tracking linkURISyntaxException
Copyright © 2013 Apache Software Foundation. All rights reserved.