Class ProxyUtils

java.lang.Object
org.apache.hadoop.yarn.server.webproxy.ProxyUtils

public class ProxyUtils extends Object
Class containing general purpose proxy utilities
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
  • Field Summary

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    notFound(javax.servlet.http.HttpServletResponse resp, String message)
    Output 404 with appropriate message.
    static void
    rejectNonHttpRequests(javax.servlet.ServletRequest req)
    Reject any request that isn't from an HTTP servlet
    static void
    sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String target)
    Handle redirects with a status code that can in future support verbs other than GET, thus supporting full REST functionality.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • ProxyUtils

      public ProxyUtils()
  • Method Details

    • sendRedirect

      public static void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String target) throws IOException
      Handle redirects with a status code that can in future support verbs other than GET, thus supporting full REST functionality.

      The target URL is included in the redirect text returned

      At the end of this method, the output stream is closed.

      Parameters:
      request - request (hence: the verb and any other information relevant to a redirect)
      response - the response
      target - the target URL -unencoded
      Throws:
      IOException
    • notFound

      public static void notFound(javax.servlet.http.HttpServletResponse resp, String message) throws IOException
      Output 404 with appropriate message.
      Parameters:
      resp - the http response.
      message - the message to include on the page.
      Throws:
      IOException - on any error.
    • rejectNonHttpRequests

      public static void rejectNonHttpRequests(javax.servlet.ServletRequest req) throws javax.servlet.ServletException
      Reject any request that isn't from an HTTP servlet
      Parameters:
      req - request
      Throws:
      javax.servlet.ServletException - if the request is of the wrong type