Package org.apache.solr.request
Class SolrRequestInfo
- java.lang.Object
-
- org.apache.solr.request.SolrRequestInfo
-
public class SolrRequestInfo extends Object
Information about the Solr request/response held in aThreadLocal
.
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrDispatchFilter.Action
action
protected List<Closeable>
closeHooks
protected javax.servlet.http.HttpServletRequest
httpRequest
protected static int
MAX_STACK_SIZE
protected Date
now
protected ResponseBuilder
rb
protected SolrQueryRequest
req
protected SolrQueryResponse
rsp
protected static ThreadLocal<Deque<SolrRequestInfo>>
threadLocal
protected TimeZone
tz
-
Constructor Summary
Constructors Constructor Description SolrRequestInfo(javax.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp)
SolrRequestInfo(javax.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp)
SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCloseHook(Closeable hook)
static void
clearRequestInfo()
Removes the most recent SolrRequestInfo from the stackSolrDispatchFilter.Action
getAction()
TimeZone
getClientTimeZone()
The TimeZone specified by the request, or UTC if none was specified.static ExecutorUtil.InheritableThreadLocalProvider
getInheritableThreadLocalProvider()
Date
getNOW()
SolrQueryRequest
getReq()
static SolrRequestInfo
getRequestInfo()
ResponseBuilder
getResponseBuilder()
May return null if the request handler is not based on SearchHandlerSolrQueryResponse
getRsp()
Principal
getUserPrincipal()
static void
reset()
This reset method is more of a protection mechanism as we expect it to be empty by now because all "set" calls need to be balanced with a "clear".void
setAction(SolrDispatchFilter.Action action)
static void
setRequestInfo(SolrRequestInfo info)
Adds the SolrRequestInfo onto a stack held in aThreadLocal
.void
setResponseBuilder(ResponseBuilder rb)
-
-
-
Field Detail
-
MAX_STACK_SIZE
protected static final int MAX_STACK_SIZE
- See Also:
- Constant Field Values
-
threadLocal
protected static final ThreadLocal<Deque<SolrRequestInfo>> threadLocal
-
req
protected SolrQueryRequest req
-
rsp
protected SolrQueryResponse rsp
-
now
protected Date now
-
httpRequest
protected javax.servlet.http.HttpServletRequest httpRequest
-
tz
protected TimeZone tz
-
rb
protected ResponseBuilder rb
-
action
protected SolrDispatchFilter.Action action
-
-
Constructor Detail
-
SolrRequestInfo
public SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp)
-
SolrRequestInfo
public SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
-
SolrRequestInfo
public SolrRequestInfo(javax.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp)
-
SolrRequestInfo
public SolrRequestInfo(javax.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
-
-
Method Detail
-
getRequestInfo
public static SolrRequestInfo getRequestInfo()
-
setRequestInfo
public static void setRequestInfo(SolrRequestInfo info)
Adds the SolrRequestInfo onto a stack held in aThreadLocal
. Remember to callclearRequestInfo()
!
-
clearRequestInfo
public static void clearRequestInfo()
Removes the most recent SolrRequestInfo from the stack
-
reset
public static void reset()
This reset method is more of a protection mechanism as we expect it to be empty by now because all "set" calls need to be balanced with a "clear".
-
getUserPrincipal
public Principal getUserPrincipal()
-
getNOW
public Date getNOW()
-
getClientTimeZone
public TimeZone getClientTimeZone()
The TimeZone specified by the request, or UTC if none was specified.
-
getReq
public SolrQueryRequest getReq()
-
getRsp
public SolrQueryResponse getRsp()
-
getResponseBuilder
public ResponseBuilder getResponseBuilder()
May return null if the request handler is not based on SearchHandler
-
setResponseBuilder
public void setResponseBuilder(ResponseBuilder rb)
-
addCloseHook
public void addCloseHook(Closeable hook)
-
getAction
public SolrDispatchFilter.Action getAction()
-
setAction
public void setAction(SolrDispatchFilter.Action action)
-
getInheritableThreadLocalProvider
public static ExecutorUtil.InheritableThreadLocalProvider getInheritableThreadLocalProvider()
-
-