Class JspHelper

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

@Private public class JspHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkUsername(String expected, String name)
    Expected user name should be a short name.
    static String
    getDefaultWebUserName(org.apache.hadoop.conf.Configuration conf)
     
    static String
    getRemoteAddr(javax.servlet.http.HttpServletRequest request)
     
    static int
    getRemotePort(javax.servlet.http.HttpServletRequest request)
     
    static org.apache.hadoop.security.UserGroupInformation
    getUGI(javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf)
    Same as getUGI(null, request, conf).
    static org.apache.hadoop.security.UserGroupInformation
    getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf)
    Same as getUGI(context, request, conf, KERBEROS_SSL, true).
    static org.apache.hadoop.security.UserGroupInformation
    getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod secureAuthMethod, boolean tryUgiParameter)
    Get UserGroupInformation and possibly the delegation token out of the request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getDefaultWebUserName

      public static String getDefaultWebUserName(org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • getUGI

      public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf) throws IOException
      Same as getUGI(null, request, conf).
      Throws:
      IOException
    • getUGI

      public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf) throws IOException
      Same as getUGI(context, request, conf, KERBEROS_SSL, true).
      Throws:
      IOException
    • getUGI

      public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod secureAuthMethod, boolean tryUgiParameter) throws IOException
      Get UserGroupInformation and possibly the delegation token out of the request.
      Parameters:
      context - the ServletContext that is serving this request.
      request - the http request
      conf - configuration
      secureAuthMethod - the AuthenticationMethod used in secure mode.
      tryUgiParameter - Should it try the ugi parameter?
      Returns:
      a new user from the request
      Throws:
      org.apache.hadoop.security.AccessControlException - if the request has no token
      IOException
    • getRemoteAddr

      public static String getRemoteAddr(javax.servlet.http.HttpServletRequest request)
    • getRemotePort

      public static int getRemotePort(javax.servlet.http.HttpServletRequest request)
    • checkUsername

      public static void checkUsername(String expected, String name) throws IOException
      Expected user name should be a short name.
      Throws:
      IOException