org.apache.solr.servlet

## Class SolrDispatchFilter

- java.lang.Object
- - org.apache.solr.servlet.SolrDispatchFilter

- All Implemented Interfaces:
    javax.servlet.Filter

      public class SolrDispatchFilter
      extends Object

  This filter looks at the incoming URL maps them to handlers defined in solrconfig.xml
  Since:
    solr 1.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `abortErrorMessage`
    `protected CoreContainer` | `cores`
    `protected org.apache.http.client.HttpClient` | `httpClient`
    `static String` | `PROPERTIES_ATTRIBUTE`
    `static String` | `SOLR_LOG_LEVEL`
    `static String` | `SOLR_LOG_MUTECONSOLE`
    `static String` | `SOLRHOME_ATTRIBUTE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrDispatchFilter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected CoreContainer` | `createCoreContainer(Path solrHome, Properties extraProperties)` Override this to change CoreContainer initialization
    `void` | `destroy()`
    `void` | `doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)`
    `void` | `doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain, boolean retry)`
    `CoreContainer` | `getCores()`
    `protected HttpSolrCall` | `getHttpSolrCall(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)` Allow a subclass to modify the HttpSolrCall.
    `void` | `init(javax.servlet.FilterConfig config)`
    `static NodeConfig` | `loadNodeConfig(Path solrHome, Properties nodeProperties)` Get the NodeConfig whether stored on disk, in ZooKeeper, etc.

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

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

- - ### Field Detail

    - #### cores

          protected volatile CoreContainer cores

    - #### abortErrorMessage

          protected String abortErrorMessage

    - #### httpClient

          protected org.apache.http.client.HttpClient httpClient

    - #### PROPERTIES_ATTRIBUTE

          public static final String PROPERTIES_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### SOLRHOME_ATTRIBUTE

          public static final String SOLRHOME_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### SOLR_LOG_MUTECONSOLE

          public static final String SOLR_LOG_MUTECONSOLE

      See Also:
        Constant Field Values

    - #### SOLR_LOG_LEVEL

          public static final String SOLR_LOG_LEVEL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SolrDispatchFilter

          public SolrDispatchFilter()

  - ### Method Detail

    - #### init

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

      Throws:
        `javax.servlet.ServletException`

    - #### createCoreContainer

          protected CoreContainer createCoreContainer(Path solrHome,
                                                      Properties extraProperties)

      Override this to change CoreContainer initialization
      Returns:
        a CoreContainer to hold this server's cores

    - #### loadNodeConfig

          public static NodeConfig loadNodeConfig(Path solrHome,
                                                  Properties nodeProperties)

      Get the NodeConfig whether stored on disk, in ZooKeeper, etc. This may also be used by custom filters to load relevant configuration.
      Returns:
        the NodeConfig

    - #### getCores

          public CoreContainer getCores()

    - #### destroy

          public void destroy()

    - #### doFilter

          public void doFilter(javax.servlet.ServletRequest request,
                               javax.servlet.ServletResponse response,
                               javax.servlet.FilterChain chain)
                        throws IOException,
                               javax.servlet.ServletException

      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### doFilter

          public void doFilter(javax.servlet.ServletRequest request,
                               javax.servlet.ServletResponse response,
                               javax.servlet.FilterChain chain,
                               boolean retry)
                        throws IOException,
                               javax.servlet.ServletException

      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### getHttpSolrCall

          protected HttpSolrCall getHttpSolrCall(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response,
                                                 boolean retry)

      Allow a subclass to modify the HttpSolrCall. In particular, subclasses may want to add attributes to the request and send errors differently

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.