Package org.apache.solr.rest
Class BaseSolrResource
java.lang.Object
org.apache.solr.rest.BaseSolrResource
- Direct Known Subclasses:
RestManager.ManagedEndpoint
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoiddoInit(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.protected intprotected voidhandleException(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.protected voidhandlePostExecution(org.slf4j.Logger log) Deal with an exception on the SolrResponse, fill in response header info, and log the accumulated messages on the SolrResponse.protected static StringDecode URL-encoded strings as UTF-8, and avoid converting "+" to space
-
Field Details
-
SHOW_DEFAULTS
- See Also:
-
UPDATE_TIMEOUT_SECS
- See Also:
-
-
Constructor Details
-
BaseSolrResource
protected BaseSolrResource()
-
-
Method Details
-
getSolrCore
-
getSchema
-
getSolrRequest
-
getSolrResponse
-
getContentType
-
getUpdateTimeoutSecs
protected int getUpdateTimeoutSecs() -
doInit
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
Decode URL-encoded strings as UTF-8, and avoid converting "+" to space- Throws:
UnsupportedEncodingException
-