public class DefaultRequestPipeline extends Object implements RequestPipeline
| Constructor and Description |
|---|
DefaultRequestPipeline(HttpFetcher httpFetcher,
HttpCache httpCache,
com.google.inject.Provider<OAuthRequest> oauthRequestProvider,
com.google.inject.Provider<OAuth2Request> oauth2RequestProvider,
ResponseRewriterRegistry responseRewriterRegistry,
InvalidationService invalidationService,
HttpResponseMetadataHelper metadataHelper) |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
cacheFetchedResponse(HttpRequest request,
HttpResponse fetchedResponse)
Cache the HttpResponse object before being returned to caller.
|
protected HttpResponse |
checkCachedResponse(HttpRequest request)
Check the HttpRequest object has already allow caching and if do try to get it from cache.
|
HttpResponse |
execute(HttpRequest request)
Execute the given request.
|
protected HttpResponse |
fetchResponse(HttpRequest request)
Fetch the response from the network using the right fetcher
Override this if you need to extend the current behavior of supported auth type.
|
protected HttpResponse |
fixFetchedResponse(HttpRequest request,
HttpResponse fetchedResponse,
HttpResponse invalidatedResponse,
HttpResponse staleResponse)
Attempt to "fix" the response by checking its validity and adding additional metadata
Override this if you need to add more processing to the HttpResponse before being cached and
returned.
|
static HttpResponse |
maybeFixDriftTime(HttpResponse response)
Verify response time, and if response time is off from current time by more then
speficied time change response time to be current time.
|
protected void |
normalizeProtocol(HttpRequest request)
Normalizing the HttpRequest object to verify the validity of the request.
|
@Inject public DefaultRequestPipeline(HttpFetcher httpFetcher, HttpCache httpCache, com.google.inject.Provider<OAuthRequest> oauthRequestProvider, com.google.inject.Provider<OAuth2Request> oauth2RequestProvider, ResponseRewriterRegistry responseRewriterRegistry, InvalidationService invalidationService, HttpResponseMetadataHelper metadataHelper)
public HttpResponse execute(HttpRequest request) throws GadgetException
RequestPipelineexecute in interface RequestPipelineGadgetExceptionprotected void normalizeProtocol(HttpRequest request) throws GadgetException
request - GadgetExceptionprotected HttpResponse checkCachedResponse(HttpRequest request)
request - protected HttpResponse fetchResponse(HttpRequest request) throws GadgetException
request - GadgetExceptionprotected HttpResponse fixFetchedResponse(HttpRequest request, HttpResponse fetchedResponse, HttpResponse invalidatedResponse, HttpResponse staleResponse) throws GadgetException
request - fetchedResponse - invalidatedResponse - staleResponse - GadgetExceptionprotected HttpResponse cacheFetchedResponse(HttpRequest request, HttpResponse fetchedResponse)
request - fetchedResponse - public static HttpResponse maybeFixDriftTime(HttpResponse response)
response - the response to fixCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.