|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.http.client.filter.FilterContext<T>
public class FilterContext<T>
A FilterContext can be used to decorate Request and AsyncHandler from a list of RequestFilter.
RequestFilter gets executed before the HTTP request is made to the remote server. Once the response bytes are
received, a FilterContext is then passed to the list of ResponseFilter. ResponseFilter
gets invoked before the response gets processed, e.g. before authorization, redirection and invokation of AsyncHandler
gets processed.
getResponseStatus() returns an instance of HttpResponseStatus
that can be used to decide if the response processing should continue or not. You can stop the current response processing
and replay the request but creating a FilterContext. The AsyncHttpProvider
will interrupt the processing and "replay" the associated Request instance.
| Constructor Summary | |
|---|---|
FilterContext(AsyncHandler<T> asyncHandler,
Request request)
Create a new FilterContext |
|
FilterContext(AsyncHandler<T> asyncHandler,
Request request,
boolean replayRequest)
Create a new FilterContext |
|
FilterContext(AsyncHandler<T> asyncHandler,
Request request,
HttpResponseStatus responseStatus)
Create a new FilterContext |
|
| Method Summary | |
|---|---|
AsyncHandler<T> |
getAsyncHandler()
Return the original or decorated AsyncHandler |
Request |
getRequest()
Return the original or decorated Request |
HttpResponseStatus |
getResponseStatus()
Return the unprocessed response's HttpResponseStatus |
boolean |
replayRequest()
Return true if the current response's processing needs to be interrupted and a new Request be executed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilterContext(AsyncHandler<T> asyncHandler,
Request request)
FilterContext
asyncHandler - an AsyncHandlerrequest - a Request
public FilterContext(AsyncHandler<T> asyncHandler,
Request request,
HttpResponseStatus responseStatus)
FilterContext
asyncHandler - an AsyncHandlerrequest - a RequestresponseStatus - a HttpResponseStatus
public FilterContext(AsyncHandler<T> asyncHandler,
Request request,
boolean replayRequest)
FilterContext
asyncHandler - an AsyncHandlerrequest - a RequestreplayRequest - true if the current response processing needs to be interrupted, and a new Request be processed.| Method Detail |
|---|
public AsyncHandler<T> getAsyncHandler()
AsyncHandler
AsyncHandlerpublic Request getRequest()
Request
Requestpublic HttpResponseStatus getResponseStatus()
HttpResponseStatus
HttpResponseStatuspublic boolean replayRequest()
Request be executed.
Request be executed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||