org.apache.solr.request

## Class SolrQueryRequestBase

- java.lang.Object
- - org.apache.solr.request.SolrQueryRequestBase

- All Implemented Interfaces:
    Closeable, AutoCloseable, SolrQueryRequest
  Direct Known Subclasses:
    LocalSolrQueryRequest

      public abstract class SolrQueryRequestBase
      extends Object
      implements SolrQueryRequest, Closeable

  Base implementation of `SolrQueryRequest` that provides some convenience methods for accessing parameters, and manages an IndexSearcher reference.

  The `close()` method must be called on any instance of this class once it is no longer in use.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<Object,Object>` | `context`
    `protected SolrCore` | `core`
    `protected Map<String,Object>` | `json`
    `protected SolrParams` | `origParams`
    `protected SolrParams` | `params`
    `protected IndexSchema` | `schema`
    `protected RefCounted<SolrIndexSearcher>` | `searcherHolder`
    `protected long` | `startTime`
    `protected Iterable<ContentStream>` | `streams`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrQueryRequestBase(SolrCore core, SolrParams params)`
    `SolrQueryRequestBase(SolrCore core, SolrParams params, RTimerTree requestTimer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Frees resources associated with this request, this method must be called when the object is no longer in use.
    `Iterable<ContentStream>` | `getContentStreams()` A Collection of ContentStreams passed to the request
    `Map<Object,Object>` | `getContext()` Generic information associated with this request that may be both read and updated.
    `SolrCore` | `getCore()` The solr core (coordinator, etc) associated with this request
    `Map<String,Object>` | `getJSON()` Returns any associated JSON (or null if none) in deserialized generic form.
    `SolrParams` | `getOriginalParams()` Returns the original request parameters.
    `SolrParams` | `getParams()` returns the current request parameters
    `String` | `getParamString()` Returns a string representing all the important parameters.
    `RTimerTree` | `getRequestTimer()` The timer for this request, created when the request started being processed
    `IndexSchema` | `getSchema()` The schema snapshot from core.getLatestSchema() at request creation.
    `SolrIndexSearcher` | `getSearcher()` The index searcher associated with this request
    `long` | `getStartTime()` The start time of this request in milliseconds.
    `Principal` | `getUserPrincipal()`
    `void` | `setContentStreams(Iterable<ContentStream> s)`
    `void` | `setJSON(Map<String,Object> json)`
    `void` | `setParams(SolrParams params)` Change the parameters for this request.
    `String` | `toString()`
    `void` | `updateSchemaToLatest()` Replaces the current schema snapshot with the latest from the core.

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

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

- - ### Field Detail

    - #### core

          protected final SolrCore core

    - #### origParams

          protected final SolrParams origParams

    - #### schema

          protected volatile IndexSchema schema

    - #### params

          protected SolrParams params

    - #### context

          protected Map<Object,Object> context

    - #### streams

          protected Iterable<ContentStream> streams

    - #### json

          protected Map<String,Object> json

    - #### startTime

          protected final long startTime

    - #### searcherHolder

          protected RefCounted<SolrIndexSearcher> searcherHolder

  - ### Constructor Detail

    - #### SolrQueryRequestBase

          public SolrQueryRequestBase(SolrCore core,
                                      SolrParams params,
                                      RTimerTree requestTimer)

    - #### SolrQueryRequestBase

          public SolrQueryRequestBase(SolrCore core,
                                      SolrParams params)

  - ### Method Detail

    - #### getContext

          public Map<Object,Object> getContext()

      Description copied from interface: `SolrQueryRequest`
      Generic information associated with this request that may be both read and updated.
      Specified by:
        `getContext` in interface `SolrQueryRequest`

    - #### getParams

          public SolrParams getParams()

      Description copied from interface: `SolrQueryRequest`
      returns the current request parameters
      Specified by:
        `getParams` in interface `SolrQueryRequest`

    - #### getOriginalParams

          public SolrParams getOriginalParams()

      Description copied from interface: `SolrQueryRequest`
      Returns the original request parameters. As this does not normally include configured defaults it's more suitable for logging.
      Specified by:
        `getOriginalParams` in interface `SolrQueryRequest`

    - #### setParams

          public void setParams(SolrParams params)

      Description copied from interface: `SolrQueryRequest`
      Change the parameters for this request. This does not affect the original parameters returned by getOriginalParams()
      Specified by:
        `setParams` in interface `SolrQueryRequest`

    - #### getStartTime

          public long getStartTime()

      Description copied from interface: `SolrQueryRequest`
      The start time of this request in milliseconds. Use this only if you need the absolute system time at the start of the request, getRequestTimer() provides a more accurate mechanism for timing purposes.
      Specified by:
        `getStartTime` in interface `SolrQueryRequest`

    - #### getRequestTimer

          public RTimerTree getRequestTimer()

      Description copied from interface: `SolrQueryRequest`
      The timer for this request, created when the request started being processed
      Specified by:
        `getRequestTimer` in interface `SolrQueryRequest`

    - #### getSearcher

          public SolrIndexSearcher getSearcher()

      Description copied from interface: `SolrQueryRequest`
      The index searcher associated with this request
      Specified by:
        `getSearcher` in interface `SolrQueryRequest`

    - #### getCore

          public SolrCore getCore()

      Description copied from interface: `SolrQueryRequest`
      The solr core (coordinator, etc) associated with this request
      Specified by:
        `getCore` in interface `SolrQueryRequest`

    - #### getSchema

          public IndexSchema getSchema()

      Description copied from interface: `SolrQueryRequest`
      The schema snapshot from core.getLatestSchema() at request creation.
      Specified by:
        `getSchema` in interface `SolrQueryRequest`

    - #### updateSchemaToLatest

          public void updateSchemaToLatest()

      Description copied from interface: `SolrQueryRequest`
      Replaces the current schema snapshot with the latest from the core.
      Specified by:
        `updateSchemaToLatest` in interface `SolrQueryRequest`

    - #### close

          public void close()

      Frees resources associated with this request, this method must be called when the object is no longer in use.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `SolrQueryRequest`

    - #### getContentStreams

          public Iterable<ContentStream> getContentStreams()

      A Collection of ContentStreams passed to the request
      Specified by:
        `getContentStreams` in interface `SolrQueryRequest`

    - #### setContentStreams

          public void setContentStreams(Iterable<ContentStream> s)

    - #### getParamString

          public String getParamString()

      Description copied from interface: `SolrQueryRequest`
      Returns a string representing all the important parameters. Suitable for logging.
      Specified by:
        `getParamString` in interface `SolrQueryRequest`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getJSON

          public Map<String,Object> getJSON()

      Description copied from interface: `SolrQueryRequest`
      Returns any associated JSON (or null if none) in deserialized generic form. Java classes used to represent the JSON are as follows: Map, List, String, Long, Double, Boolean
      Specified by:
        `getJSON` in interface `SolrQueryRequest`

    - #### setJSON

          public void setJSON(Map<String,Object> json)

      Specified by:
        `setJSON` in interface `SolrQueryRequest`

    - #### getUserPrincipal

          public Principal getUserPrincipal()

      Specified by:
        `getUserPrincipal` in interface `SolrQueryRequest`

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