@InterfaceAudience.Private public class JspHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CURRENT_CONF |
static String |
DELEGATION_PARAMETER_NAME |
static String |
NAMENODE_ADDRESS |
Modifier and Type | Method and Description |
---|---|
static void |
addTableFooter(javax.servlet.jsp.JspWriter out) |
static void |
addTableHeader(javax.servlet.jsp.JspWriter out) |
static void |
addTableRow(javax.servlet.jsp.JspWriter out,
String[] columns) |
static void |
addTableRow(javax.servlet.jsp.JspWriter out,
String[] columns,
int row) |
static DatanodeInfo |
bestNode(DatanodeInfo[] nodes,
boolean doRandom,
Configuration conf) |
static DatanodeInfo |
bestNode(LocatedBlock blk,
Configuration conf) |
static DatanodeInfo |
bestNode(LocatedBlocks blks,
Configuration conf) |
static void |
createTitle(javax.servlet.jsp.JspWriter out,
javax.servlet.http.HttpServletRequest req,
String file) |
static UserGroupInformation |
getDefaultWebUser(Configuration conf)
If security is turned off, what is the default web user?
|
static String |
getDelegationTokenUrlParam(String tokenString)
Returns the url parameter for the given token string.
|
static UserGroupInformation |
getUGI(javax.servlet.http.HttpServletRequest request,
Configuration conf)
Same as getUGI(null, request, conf).
|
static UserGroupInformation |
getUGI(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
Configuration conf)
Same as getUGI(context, request, conf, KERBEROS_SSL, true).
|
static UserGroupInformation |
getUGI(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
Configuration conf,
UserGroupInformation.AuthenticationMethod secureAuthMethod,
boolean tryUgiParameter)
Get
UserGroupInformation and possibly the delegation token out of
the request. |
static String |
getUrlParam(String name,
String val)
Returns the url parameter for the given string, prefixed with '&'.
|
static String |
getUrlParam(String name,
String val,
boolean firstParam)
Returns the url parameter for the given string, prefixed with '?' if
firstParam is true, prefixed with '&' if firstParam is false.
|
static String |
getUrlParam(String name,
String val,
String paramSeparator)
Returns the url parameter for the given string, prefixed with
paramSeparator.
|
static String |
getVersionTable()
Return a table containing version information.
|
static void |
printGotoForm(javax.servlet.jsp.JspWriter out,
int namenodeInfoPort,
String tokenString,
String file,
String nnAddress) |
static void |
printPathWithLinks(String dir,
javax.servlet.jsp.JspWriter out,
int namenodeInfoPort,
String tokenString,
String nnAddress) |
static void |
sortNodeList(List<DatanodeDescriptor> nodes,
String field,
String order) |
static void |
streamBlockInAscii(InetSocketAddress addr,
String poolId,
long blockId,
Token<BlockTokenIdentifier> blockToken,
long genStamp,
long blockSize,
long offsetIntoBlock,
long chunkSizeToView,
javax.servlet.jsp.JspWriter out,
Configuration conf,
DFSClient.Conf dfsConf,
DataEncryptionKey encryptionKey) |
static int |
string2ChunkSizeToView(String s,
int defaultValue)
Convert a String to chunk-size-to-view.
|
static Long |
validateLong(String value)
Validate a long value.
|
static String |
validatePath(String p)
Validate filename.
|
static String |
validateURL(String value)
Validate a URL.
|
public static final String CURRENT_CONF
public static final String DELEGATION_PARAMETER_NAME
public static final String NAMENODE_ADDRESS
public static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf) throws IOException
IOException
public static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf) throws IOException
IOException
public static DatanodeInfo bestNode(DatanodeInfo[] nodes, boolean doRandom, Configuration conf) throws IOException
IOException
public static void streamBlockInAscii(InetSocketAddress addr, String poolId, long blockId, Token<BlockTokenIdentifier> blockToken, long genStamp, long blockSize, long offsetIntoBlock, long chunkSizeToView, javax.servlet.jsp.JspWriter out, Configuration conf, DFSClient.Conf dfsConf, DataEncryptionKey encryptionKey) throws IOException
IOException
public static void addTableHeader(javax.servlet.jsp.JspWriter out) throws IOException
IOException
public static void addTableRow(javax.servlet.jsp.JspWriter out, String[] columns) throws IOException
IOException
public static void addTableRow(javax.servlet.jsp.JspWriter out, String[] columns, int row) throws IOException
IOException
public static void addTableFooter(javax.servlet.jsp.JspWriter out) throws IOException
IOException
public static void sortNodeList(List<DatanodeDescriptor> nodes, String field, String order)
public static void printPathWithLinks(String dir, javax.servlet.jsp.JspWriter out, int namenodeInfoPort, String tokenString, String nnAddress) throws IOException
IOException
public static void printGotoForm(javax.servlet.jsp.JspWriter out, int namenodeInfoPort, String tokenString, String file, String nnAddress) throws IOException
IOException
public static void createTitle(javax.servlet.jsp.JspWriter out, javax.servlet.http.HttpServletRequest req, String file) throws IOException
IOException
public static int string2ChunkSizeToView(String s, int defaultValue)
public static String getVersionTable()
public static String validatePath(String p)
public static Long validateLong(String value)
public static String validateURL(String value)
public static UserGroupInformation getDefaultWebUser(Configuration conf) throws IOException
conf
- the configuration to look inIOException
public static UserGroupInformation getUGI(javax.servlet.http.HttpServletRequest request, Configuration conf) throws IOException
IOException
public static UserGroupInformation getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, Configuration conf) throws IOException
IOException
public static UserGroupInformation getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, Configuration conf, UserGroupInformation.AuthenticationMethod secureAuthMethod, boolean tryUgiParameter) throws IOException
UserGroupInformation
and possibly the delegation token out of
the request.context
- the ServletContext that is serving this request.request
- the http requestconf
- configurationsecureAuthMethod
- the AuthenticationMethod used in secure mode.tryUgiParameter
- Should it try the ugi parameter?AccessControlException
- if the request has no tokenIOException
public static String getDelegationTokenUrlParam(String tokenString)
tokenString
- public static String getUrlParam(String name, String val, String paramSeparator)
name
- parameter nameval
- parameter valueparamSeparator
- URL parameter prefix, i.e. either '?' or '&'public static String getUrlParam(String name, String val, boolean firstParam)
name
- parameter nameval
- parameter valuefirstParam
- true if this is the first parameter in the list, false otherwiseCopyright © 2013 Apache Software Foundation. All rights reserved.