org.apache.hadoop.hdfs.server.common
Class JspHelper

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.common.JspHelper

@InterfaceAudience.Private
public class JspHelper
extends Object


Field Summary
static String DELEGATION_PARAMETER_NAME
           
static String SET_DELEGATION
           
static String WEB_UGI_PROPERTY_NAME
           
 
Method Summary
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(LocatedBlock blk)
           
static void createTitle(javax.servlet.jsp.JspWriter out, javax.servlet.http.HttpServletRequest req, String file)
           
static org.apache.hadoop.security.UserGroupInformation getDefaultWebUser(org.apache.hadoop.conf.Configuration conf)
          If security is turned off, what is the default web user?
static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf)
          Get UserGroupInformation and possibly the delegation token out of the request.
static String getVersionTable()
          Return a table containing version information.
static void printGotoForm(javax.servlet.jsp.JspWriter out, int namenodeInfoPort, String tokenString, String file)
           
static void printPathWithLinks(String dir, javax.servlet.jsp.JspWriter out, int namenodeInfoPort, String tokenString)
           
static void sortNodeList(ArrayList<DatanodeDescriptor> nodes, String field, String order)
           
static void streamBlockInAscii(InetSocketAddress addr, long blockId, BlockAccessToken accessToken, long genStamp, long blockSize, long offsetIntoBlock, long chunkSizeToView, javax.servlet.jsp.JspWriter out, org.apache.hadoop.conf.Configuration conf)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEB_UGI_PROPERTY_NAME

public static final String WEB_UGI_PROPERTY_NAME
See Also:
Constant Field Values

DELEGATION_PARAMETER_NAME

public static final String DELEGATION_PARAMETER_NAME
See Also:
Constant Field Values

SET_DELEGATION

public static final String SET_DELEGATION
See Also:
Constant Field Values
Method Detail

bestNode

public static DatanodeInfo bestNode(LocatedBlock blk)
                             throws IOException
Throws:
IOException

streamBlockInAscii

public static void streamBlockInAscii(InetSocketAddress addr,
                                      long blockId,
                                      BlockAccessToken accessToken,
                                      long genStamp,
                                      long blockSize,
                                      long offsetIntoBlock,
                                      long chunkSizeToView,
                                      javax.servlet.jsp.JspWriter out,
                                      org.apache.hadoop.conf.Configuration conf)
                               throws IOException
Throws:
IOException

addTableHeader

public static void addTableHeader(javax.servlet.jsp.JspWriter out)
                           throws IOException
Throws:
IOException

addTableRow

public static void addTableRow(javax.servlet.jsp.JspWriter out,
                               String[] columns)
                        throws IOException
Throws:
IOException

addTableRow

public static void addTableRow(javax.servlet.jsp.JspWriter out,
                               String[] columns,
                               int row)
                        throws IOException
Throws:
IOException

addTableFooter

public static void addTableFooter(javax.servlet.jsp.JspWriter out)
                           throws IOException
Throws:
IOException

sortNodeList

public static void sortNodeList(ArrayList<DatanodeDescriptor> nodes,
                                String field,
                                String order)

printPathWithLinks

public static void printPathWithLinks(String dir,
                                      javax.servlet.jsp.JspWriter out,
                                      int namenodeInfoPort,
                                      String tokenString)
                               throws IOException
Throws:
IOException

printGotoForm

public static void printGotoForm(javax.servlet.jsp.JspWriter out,
                                 int namenodeInfoPort,
                                 String tokenString,
                                 String file)
                          throws IOException
Throws:
IOException

createTitle

public static void createTitle(javax.servlet.jsp.JspWriter out,
                               javax.servlet.http.HttpServletRequest req,
                               String file)
                        throws IOException
Throws:
IOException

string2ChunkSizeToView

public static int string2ChunkSizeToView(String s,
                                         int defaultValue)
Convert a String to chunk-size-to-view.


getVersionTable

public static String getVersionTable()
Return a table containing version information.


validatePath

public static String validatePath(String p)
Validate filename.

Returns:
null if the filename is invalid. Otherwise, return the validated filename.

validateLong

public static Long validateLong(String value)
Validate a long value.

Returns:
null if the value is invalid. Otherwise, return the validated Long object.

validateURL

public static String validateURL(String value)
Validate a URL.

Returns:
null if the value is invalid. Otherwise, return the validated URL String.

getDefaultWebUser

public static org.apache.hadoop.security.UserGroupInformation getDefaultWebUser(org.apache.hadoop.conf.Configuration conf)
                                                                         throws IOException
If security is turned off, what is the default web user?

Parameters:
conf - the configuration to look in
Returns:
the remote user that was configuration
Throws:
IOException

getUGI

public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.http.HttpServletRequest request,
                                                                     org.apache.hadoop.conf.Configuration conf)
                                                              throws IOException
Get UserGroupInformation and possibly the delegation token out of the request.

Parameters:
request - the http request
Returns:
a new user from the request
Throws:
org.apache.hadoop.security.AccessControlException - if the request has no token
IOException


Copyright © 2009 The Apache Software Foundation