public class SolrRequestInfo extends Object
ThreadLocal
.Modifier and Type | Field and 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 |
protected boolean |
useServerToken |
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
void |
addCloseHook(Closeable hook) |
static void |
clearRequestInfo()
Removes the most recent SolrRequestInfo from the stack
|
SolrDispatchFilter.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 SearchHandler
|
SolrQueryResponse |
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 a
ThreadLocal . |
void |
setResponseBuilder(ResponseBuilder rb) |
void |
setUseServerToken(boolean use) |
boolean |
useServerToken()
Used when making remote requests to other Solr nodes from the thread associated with this request,
true means the server token header should be used instead of the Principal associated with the request.
|
protected static final int MAX_STACK_SIZE
protected static final ThreadLocal<Deque<SolrRequestInfo>> threadLocal
protected SolrQueryRequest req
protected SolrQueryResponse rsp
protected Date now
protected javax.servlet.http.HttpServletRequest httpRequest
protected TimeZone tz
protected ResponseBuilder rb
protected SolrDispatchFilter.Action action
protected boolean useServerToken
public SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp)
public SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
public SolrRequestInfo(javax.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp)
public SolrRequestInfo(javax.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
public static SolrRequestInfo getRequestInfo()
public static void setRequestInfo(SolrRequestInfo info)
ThreadLocal
.
Remember to call clearRequestInfo()
!public static void clearRequestInfo()
public static void reset()
public Principal getUserPrincipal()
public Date getNOW()
public TimeZone getClientTimeZone()
public SolrQueryRequest getReq()
public SolrQueryResponse getRsp()
public ResponseBuilder getResponseBuilder()
public void setResponseBuilder(ResponseBuilder rb)
public void addCloseHook(Closeable hook)
public SolrDispatchFilter.Action getAction()
public void setAction(SolrDispatchFilter.Action action)
public boolean useServerToken()
public void setUseServerToken(boolean use)
public static ExecutorUtil.InheritableThreadLocalProvider getInheritableThreadLocalProvider()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.