public class AccelHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ResponseRewriterRegistry |
contentRewriterRegistry |
protected boolean |
remapInternalServerError |
protected RequestPipeline |
requestPipeline |
protected AccelUriManager |
uriManager |
| Constructor and Description |
|---|
AccelHandler(RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry,
AccelUriManager accelUriManager,
Boolean remapInternalServerError) |
| Modifier and Type | Method and Description |
|---|---|
protected HttpRequest |
buildHttpRequest(HttpRequest request,
ProxyUriManager.ProxyUri uriToProxyOrRewrite)
Build an HttpRequest object encapsulating the request details as requested
by the user.
|
protected HttpResponse |
fetch(HttpRequest request) |
ProxyUriManager.ProxyUri |
getProxyUri(HttpRequest httpRequest)
Returns the proxy uri encapsulating the request uri.
|
protected HttpResponse |
handleErrors(HttpResponse results)
Process errors when fetching uri using request pipeline and return the
error response to be returned to the user if any.
|
protected boolean |
isRecoverable(HttpRequest req,
HttpResponse results,
RewritingException exception)
Returns true in case the error encountered while rewriting the content
is recoverable.
|
protected final RequestPipeline requestPipeline
protected final ResponseRewriterRegistry contentRewriterRegistry
protected final AccelUriManager uriManager
protected final boolean remapInternalServerError
@Inject public AccelHandler(RequestPipeline requestPipeline, ResponseRewriterRegistry contentRewriterRegistry, AccelUriManager accelUriManager, Boolean remapInternalServerError)
protected HttpResponse fetch(HttpRequest request) throws IOException, GadgetException
IOExceptionGadgetExceptionpublic ProxyUriManager.ProxyUri getProxyUri(HttpRequest httpRequest) throws GadgetException
httpRequest - The http request.GadgetException - In case of errors.protected boolean isRecoverable(HttpRequest req, HttpResponse results, RewritingException exception)
req - The http request for fetching the resource.results - The result of rewriting.exception - Exception caught.protected HttpRequest buildHttpRequest(HttpRequest request, ProxyUriManager.ProxyUri uriToProxyOrRewrite) throws GadgetException
request - The http request.uriToProxyOrRewrite - The parsed uri to proxy or rewrite through
accel servlet.GadgetException - In case the data could not be fetched.protected HttpResponse handleErrors(HttpResponse results)
results - The http response returned by request pipeline.Copyright © 2007-2012. All Rights Reserved.