org.apache.hadoop.yarn.server.webproxy
Class ProxyUriUtils

java.lang.Object
  extended by org.apache.hadoop.yarn.server.webproxy.ProxyUriUtils

public class ProxyUriUtils
extends Object


Field Summary
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 Summary
ProxyUriUtils()
           
 
Method Summary
static String getPath(org.apache.hadoop.yarn.api.records.ApplicationId id)
          Get the proxied path for an application.
static String getPath(org.apache.hadoop.yarn.api.records.ApplicationId id, String path)
          Get the proxied path for an application.
static String getPathAndQuery(org.apache.hadoop.yarn.api.records.ApplicationId id, String path, String query, boolean approved)
          Get the proxied path for an application
static URI getProxyUri(URI originalUri, URI proxyUri, org.apache.hadoop.yarn.api.records.ApplicationId id)
          Get a proxied URI for the original URI.
static URI getUriFromAMUrl(String noSchemeUrl)
          Create a URI form a no scheme Url, such as is returned by the AM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_SERVLET_NAME

public static final String PROXY_SERVLET_NAME
Name of the servlet to use when registering the proxy servlet.

See Also:
Constant Field Values

PROXY_BASE

public static final String PROXY_BASE
Base path where the proxy servlet will handle requests.

See Also:
Constant Field Values

PROXY_PATH_SPEC

public static final String PROXY_PATH_SPEC
Path Specification for the proxy servlet.

See Also:
Constant Field Values

PROXY_APPROVAL_PARAM

public static final String PROXY_APPROVAL_PARAM
Query Parameter indicating that the URI was approved.

See Also:
Constant Field Values
Constructor Detail

ProxyUriUtils

public ProxyUriUtils()
Method Detail

getPath

public static String getPath(org.apache.hadoop.yarn.api.records.ApplicationId id)
Get the proxied path for an application.

Parameters:
id - the application id to use.
Returns:
the base path to that application through the proxy.

getPath

public static String getPath(org.apache.hadoop.yarn.api.records.ApplicationId id,
                             String path)
Get the proxied path for an application.

Parameters:
id - the application id to use.
path - the rest of the path to the application.
Returns:
the base path to that application through the proxy.

getPathAndQuery

public static String getPathAndQuery(org.apache.hadoop.yarn.api.records.ApplicationId id,
                                     String path,
                                     String query,
                                     boolean approved)
Get the proxied path for an application

Parameters:
id - the id of the application
path - the path of the application.
query - the query parameters
approved - true if the user has approved accessing this app.
Returns:
the proxied path for this app.

getProxyUri

public static URI getProxyUri(URI originalUri,
                              URI proxyUri,
                              org.apache.hadoop.yarn.api.records.ApplicationId id)
Get a proxied URI for the original URI.

Parameters:
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 application
Returns:
the proxied URI

getUriFromAMUrl

public static URI getUriFromAMUrl(String noSchemeUrl)
                           throws URISyntaxException
Create a URI form a no scheme Url, such as is returned by the AM.

Parameters:
noSchemeUrl - the URL formate returned by an AM
Returns:
a URI with an http scheme
Throws:
URISyntaxException - if the url is not formatted correctly.


Copyright © 2012 Apache Software Foundation. All Rights Reserved.