org.eclipse.jetty.servlets

## Class BalancerServlet

- java.lang.Object
- - org.eclipse.jetty.servlets.ProxyServlet
  - - org.eclipse.jetty.servlets.BalancerServlet

- All Implemented Interfaces:
    javax.servlet.Servlet

      public class BalancerServlet
      extends ProxyServlet

  6

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.servlets.ProxyServlet

      `ProxyServlet.Transparent`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.jetty.servlets.ProxyServlet

      `_black, _client, _config, _context, _DontProxyHeaders, _hostHeader, _log, _white`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BalancerServlet()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `filterResponseHeaderValue(String headerName, String headerValue, javax.servlet.http.HttpServletRequest request)` Extension point for remote server response header filtering.
    `String` | `getHostHeader()` Get the hostHeader.
    `void` | `init(javax.servlet.ServletConfig config)`
    `protected HttpURI` | `proxyHttpURI(javax.servlet.http.HttpServletRequest request, String uri)`
    `void` | `setHostHeader(String hostHeader)` Set the hostHeader.
    `boolean` | `validateDestination(String host, String path)` Check the request hostname and path against white- and blacklist.

    - ### Methods inherited from class org.eclipse.jetty.servlets.ProxyServlet

      `createHttpClient, createHttpClientInstance, createLogger, customizeContinuation, customizeExchange, destroy, getServletConfig, getServletInfo, handleConnect, handleOnConnectionFailed, handleOnException, handleOnExpire, proxyHttpURI, service`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BalancerServlet

          public BalancerServlet()

  - ### Method Detail

    - #### init

          public void init(javax.servlet.ServletConfig config)
                    throws javax.servlet.ServletException

      Specified by:
        `init` in interface `javax.servlet.Servlet`
      Overrides:
        `init` in class `ProxyServlet`
      Throws:
        `javax.servlet.ServletException`

    - #### proxyHttpURI

          protected HttpURI proxyHttpURI(javax.servlet.http.HttpServletRequest request,
                             String uri)
                                  throws MalformedURLException

      Overrides:
        `proxyHttpURI` in class `ProxyServlet`
      Throws:
        `MalformedURLException`

    - #### filterResponseHeaderValue

          protected String filterResponseHeaderValue(String headerName,
                                         String headerValue,
                                         javax.servlet.http.HttpServletRequest request)

      Description copied from class: `ProxyServlet`
      Extension point for remote server response header filtering. The default implementation returns the header value as is. If null is returned, this header won't be forwarded back to the client.
      Overrides:
        `filterResponseHeaderValue` in class `ProxyServlet`
      Returns:
        filteredHeaderValue

    - #### getHostHeader

          public String getHostHeader()

      Description copied from class: `ProxyServlet`
      Get the hostHeader.
      Overrides:
        `getHostHeader` in class `ProxyServlet`
      Returns:
        the hostHeader

    - #### setHostHeader

          public void setHostHeader(String hostHeader)

      Description copied from class: `ProxyServlet`
      Set the hostHeader.
      Overrides:
        `setHostHeader` in class `ProxyServlet`
      Parameters:
        `hostHeader` - the hostHeader to set

    - #### validateDestination

          public boolean validateDestination(String host,
                                    String path)

      Description copied from class: `ProxyServlet`
      Check the request hostname and path against white- and blacklist.
      Overrides:
        `validateDestination` in class `ProxyServlet`
      Parameters:
        `host` - hostname to check
        `path` - path to check
      Returns:
        true if request is allowed to be proxied

Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.