Package org.apache.solr.servlet
Class HttpSolrCall
- java.lang.Object
-
- org.apache.solr.servlet.HttpSolrCall
-
- Direct Known Subclasses:
V2HttpCall
public class HttpSolrCall extends Object
This class represents a call made to Solr
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrDispatchFilter.Actionactionprotected List<String>collectionsListprotected SolrConfigconfigprotected SolrCorecoreprotected CoreContainercoresprotected StringcoreUrlprotected SolrRequestHandlerhandlerprotected Map<String,Integer>invalidStatesprotected StringorigCorenameprotected Stringpathprotected SolrParamsqueryParamsstatic Randomrandomprotected javax.servlet.http.HttpServletRequestreqprotected AuthorizationContext.RequestTyperequestTypeprotected javax.servlet.http.HttpServletResponseresponseprotected booleanretryprotected SolrDispatchFiltersolrDispatchFilterprotected SolrQueryRequestsolrReq
-
Constructor Summary
Constructors Constructor Description HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object_getHandler()protected voidaddCollectionParamIfNeeded(List<String> collections)Sets the "collection" parameter on the request to the list of alias-resolved collections for this request.protected voidautoCreateSystemColl(String corename)SolrDispatchFilter.Actioncall()This method processes the request.protected voidexecute(SolrQueryResponse rsp)protected voidextractHandlerFromURLPath(SolrRequestParsers parser)Extract handler from the URL path if not set.protected voidextractRemotePath(String collectionName, String origCorename)protected AliasesgetAliases()List<String>getCollectionsList()The collection(s) referenced in this request.List<CommandOperation>getCommands(boolean validateInput)SolrCoregetCore()protected SolrCoregetCoreByCollection(String collectionName, boolean isPreferLeader)StringgetPath()SolrParamsgetQueryParams()protected StringgetRemoteCoreUrl(String collectionName, String origCorename)javax.servlet.http.HttpServletRequestgetReq()AuthorizationContext.RequestTypegetRequestType()protected QueryResponseWritergetResponseWriter()ReturnsQueryResponseWriterto be used.protected ValidatingJsonMapgetSpec()protected Map<String,JsonSchemaValidator>getValidators()protected voidhandleAdmin(SolrQueryResponse solrResp)protected voidinit()protected List<String>resolveCollectionListOrAlias(String collectionStr)Resolves the parameter as a potential comma delimited list of collections, and resolves aliases too.protected voidsendError(int code, String message)protected voidsendError(Throwable ex)
-
-
-
Field Detail
-
random
public static final Random random
-
solrDispatchFilter
protected final SolrDispatchFilter solrDispatchFilter
-
cores
protected final CoreContainer cores
-
req
protected final javax.servlet.http.HttpServletRequest req
-
response
protected final javax.servlet.http.HttpServletResponse response
-
retry
protected final boolean retry
-
core
protected SolrCore core
-
solrReq
protected SolrQueryRequest solrReq
-
handler
protected SolrRequestHandler handler
-
queryParams
protected final SolrParams queryParams
-
path
protected String path
-
action
protected SolrDispatchFilter.Action action
-
coreUrl
protected String coreUrl
-
config
protected SolrConfig config
-
origCorename
protected String origCorename
-
requestType
protected AuthorizationContext.RequestType requestType
-
-
Constructor Detail
-
HttpSolrCall
public HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
-
Method Detail
-
getRequestType
public AuthorizationContext.RequestType getRequestType()
-
getPath
public String getPath()
-
getReq
public javax.servlet.http.HttpServletRequest getReq()
-
getCore
public SolrCore getCore()
-
getQueryParams
public SolrParams getQueryParams()
-
getAliases
protected Aliases getAliases()
-
getCollectionsList
public List<String> getCollectionsList()
The collection(s) referenced in this request. Populated ininit(). Not null.
-
autoCreateSystemColl
protected void autoCreateSystemColl(String corename) throws Exception
- Throws:
Exception
-
resolveCollectionListOrAlias
protected List<String> resolveCollectionListOrAlias(String collectionStr)
Resolves the parameter as a potential comma delimited list of collections, and resolves aliases too. One level of aliases pointing to another alias is supported. De-duplicates and retains the order.getCollectionsList()
-
extractHandlerFromURLPath
protected void extractHandlerFromURLPath(SolrRequestParsers parser) throws Exception
Extract handler from the URL path if not set.- Throws:
Exception
-
extractRemotePath
protected void extractRemotePath(String collectionName, String origCorename) throws UnsupportedEncodingException, org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
UnsupportedEncodingExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
call
public SolrDispatchFilter.Action call() throws IOException
This method processes the request.- Throws:
IOException
-
sendError
protected void sendError(Throwable ex) throws IOException
- Throws:
IOException
-
sendError
protected void sendError(int code, String message) throws IOException- Throws:
IOException
-
execute
protected void execute(SolrQueryResponse rsp)
-
getResponseWriter
protected QueryResponseWriter getResponseWriter()
ReturnsQueryResponseWriterto be used. WhenCommonParams.WTnot specified in the request or specified value doesn't have correspondingQueryResponseWriterthen, returns the default query response writer Note: This method must not return null
-
handleAdmin
protected void handleAdmin(SolrQueryResponse solrResp)
-
addCollectionParamIfNeeded
protected void addCollectionParamIfNeeded(List<String> collections)
Sets the "collection" parameter on the request to the list of alias-resolved collections for this request. It can be avoided sometimes. Note:HttpShardHandlerprocesses this param.- See Also:
getCollectionsList()
-
getCoreByCollection
protected SolrCore getCoreByCollection(String collectionName, boolean isPreferLeader)
-
_getHandler
protected Object _getHandler()
-
getCommands
public List<CommandOperation> getCommands(boolean validateInput)
-
getSpec
protected ValidatingJsonMap getSpec()
-
getValidators
protected Map<String,JsonSchemaValidator> getValidators()
-
-