Tabnine Logo
JspHelper.getDelegationTokenUrlParam
Code IndexAdd Tabnine to your IDE (free)

How to use
getDelegationTokenUrlParam
method
in
org.apache.hadoop.hdfs.server.common.JspHelper

Best Java code snippets using org.apache.hadoop.hdfs.server.common.JspHelper.getDelegationTokenUrlParam (Showing top 7 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs-test

@Test
public void testDelegationTokenUrlParam() {
 conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
 UserGroupInformation.setConfiguration(conf);
 String tokenString = "xyzabc";
 String delegationTokenParam = JspHelper
   .getDelegationTokenUrlParam(tokenString);
 //Security is enabled
 Assert.assertEquals(JspHelper.SET_DELEGATION + "xyzabc",
   delegationTokenParam);
 conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "simple");
 UserGroupInformation.setConfiguration(conf);
 delegationTokenParam = JspHelper
   .getDelegationTokenUrlParam(tokenString);
 //Empty string must be returned because security is disabled.
 Assert.assertEquals("", delegationTokenParam);
}
origin: ch.cern.hadoop/hadoop-hdfs

protected String addDelegationTokenParam(String query) throws IOException {
 String tokenString = null;
 if (UserGroupInformation.isSecurityEnabled()) {
  synchronized (this) {
   tokenAspect.ensureTokenInitialized();
   if (delegationToken != null) {
    tokenString = delegationToken.encodeToUrlString();
    return (query + JspHelper.getDelegationTokenUrlParam(tokenString));
   }
  }
 }
 return query;
}
origin: io.prestosql.hadoop/hadoop-apache

protected String addDelegationTokenParam(String query) throws IOException {
 String tokenString = null;
 if (UserGroupInformation.isSecurityEnabled()) {
  synchronized (this) {
   tokenAspect.ensureTokenInitialized();
   if (delegationToken != null) {
    tokenString = delegationToken.encodeToUrlString();
    return (query + JspHelper.getDelegationTokenUrlParam(tokenString));
   }
  }
 }
 return query;
}
origin: io.prestosql.hadoop/hadoop-apache

/** Create a redirection URL */
private URL createRedirectURL(UserGroupInformation ugi, DatanodeID host,
  HttpServletRequest request, NameNode nn) 
  throws IOException {
 final String hostname = host instanceof DatanodeInfo 
   ? host.getHostName() : host.getIpAddr();
 final String scheme = request.getScheme();
 int port = host.getInfoPort();
 if ("https".equals(scheme)) {
  final Integer portObject = (Integer) getServletContext().getAttribute(
    DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY);
  if (portObject != null) {
   port = portObject;
  }
 }
 final String encodedPath = ServletUtil.getRawPath(request, "/fileChecksum");
 String dtParam = "";
 if (UserGroupInformation.isSecurityEnabled()) {
  String tokenString = ugi.getTokens().iterator().next().encodeToUrlString();
  dtParam = JspHelper.getDelegationTokenUrlParam(tokenString);
 }
 String addr = nn.getNameNodeAddressHostPortString();
 String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr);
 return new URL(scheme, hostname, port, 
   "/getFileChecksum" + encodedPath + '?' +
   "ugi=" + ServletUtil.encodeQueryValue(ugi.getShortUserName()) + 
   dtParam + addrParam);
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Create a redirection URL */
private URL createRedirectURL(UserGroupInformation ugi, DatanodeID host,
  HttpServletRequest request, NameNode nn) 
  throws IOException {
 final String hostname = host instanceof DatanodeInfo 
   ? host.getHostName() : host.getIpAddr();
 final String scheme = request.getScheme();
 int port = host.getInfoPort();
 if ("https".equals(scheme)) {
  final Integer portObject = (Integer) getServletContext().getAttribute(
    DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY);
  if (portObject != null) {
   port = portObject;
  }
 }
 final String encodedPath = ServletUtil.getRawPath(request, "/fileChecksum");
 String dtParam = "";
 if (UserGroupInformation.isSecurityEnabled()) {
  String tokenString = ugi.getTokens().iterator().next().encodeToUrlString();
  dtParam = JspHelper.getDelegationTokenUrlParam(tokenString);
 }
 String addr = nn.getNameNodeAddressHostPortString();
 String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr);
 return new URL(scheme, hostname, port, 
   "/getFileChecksum" + encodedPath + '?' +
   "ugi=" + ServletUtil.encodeQueryValue(ugi.getShortUserName()) + 
   dtParam + addrParam);
}
origin: ch.cern.hadoop/hadoop-hdfs

dtParam = JspHelper.getDelegationTokenUrlParam(dt);
origin: io.prestosql.hadoop/hadoop-apache

dtParam = JspHelper.getDelegationTokenUrlParam(dt);
org.apache.hadoop.hdfs.server.commonJspHelpergetDelegationTokenUrlParam

Javadoc

Returns the url parameter for the given token string.

Popular methods of JspHelper

  • getUGI
    Same as getUGI(null, request, conf).
  • getRemoteAddr
  • checkUsername
    Expected user name should be a short name.
  • getDefaultWebUserName
  • getNNServiceAddress
  • getTokenUGI
  • getUrlParam
    Returns the url parameter for the given string, prefixed with '?' if firstParam is true, prefixed wi
  • getUsernameFromQuery
  • bestNode
  • validatePath
    Validate filename.

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now