Class BaseSolrResource

java.lang.Object
org.apache.solr.rest.BaseSolrResource
Direct Known Subclasses:
RestManager.ManagedEndpoint

public abstract class BaseSolrResource extends Object
Base class for delegating REST-oriented requests to ManagedResources. ManagedResources are heavy-weight and should not be created for every request, so this class serves as a gateway between a REST call and the resource.
  • Field Details

  • Constructor Details

    • BaseSolrResource

      protected BaseSolrResource()
  • Method Details

    • getSolrCore

      public SolrCore getSolrCore()
    • getSchema

      public IndexSchema getSchema()
    • getSolrRequest

      public SolrQueryRequest getSolrRequest()
    • getSolrResponse

      public SolrQueryResponse getSolrResponse()
    • getContentType

      public String getContentType()
    • getUpdateTimeoutSecs

      protected int getUpdateTimeoutSecs()
    • doInit

      public void doInit(SolrQueryRequest solrRequest, SolrQueryResponse solrResponse)
      Pulls the SolrQueryRequest constructed in SolrDispatchFilter from the SolrRequestInfo thread local, then gets the SolrCore and IndexSchema and sets up the response. writer.
    • handlePostExecution

      protected void handlePostExecution(org.slf4j.Logger log)
      Deal with an exception on the SolrResponse, fill in response header info, and log the accumulated messages on the SolrResponse.
    • addDeprecatedWarning

      protected void addDeprecatedWarning()
    • handleException

      protected void handleException(org.slf4j.Logger log)
      If there is an exception on the SolrResponse:
      • error info is added to the SolrResponse;
      • the response status code is set to the error code from the exception; and
      • the exception message is added to the list of things to be logged.
    • urlDecode

      protected static String urlDecode(String str) throws UnsupportedEncodingException
      Decode URL-encoded strings as UTF-8, and avoid converting "+" to space
      Throws:
      UnsupportedEncodingException