public class RemoteHttpCacheDispatcher extends AbstractHttpClient implements IRemoteCacheDispatcher
Constructor and Description |
---|
RemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes) |
Modifier and Type | Method and Description |
---|---|
<K,V,T> RemoteCacheResponse<T> |
dispatchRequest(RemoteCacheRequest<K,V> remoteCacheRequest)
All requests will go through this method.
|
protected void |
postProcessWebserviceCall(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.HttpResponse httpState)
Called after the execute call on the client.
|
protected void |
preProcessWebserviceCall(org.apache.http.client.methods.RequestBuilder requestBuilder)
Called before the execute call on the client.
|
protected <K,V> byte[] |
processRequest(byte[] requestAsByteArray,
RemoteCacheRequest<K,V> remoteCacheRequest,
String url)
Process single request
|
configureClient, doWebserviceCall, getRemoteHttpCacheAttributes
public RemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes)
remoteHttpCacheAttributes
- public <K,V,T> RemoteCacheResponse<T> dispatchRequest(RemoteCacheRequest<K,V> remoteCacheRequest) throws IOException
TODO consider taking in a URL instead of using the one in the configuration.
dispatchRequest
in interface IRemoteCacheDispatcher
remoteCacheRequest
- IOException
protected <K,V> byte[] processRequest(byte[] requestAsByteArray, RemoteCacheRequest<K,V> remoteCacheRequest, String url) throws IOException, org.apache.http.HttpException
requestAsByteArray
- request bodyremoteCacheRequest
- the cache requesturl
- target urlIOException
org.apache.http.HttpException
protected void preProcessWebserviceCall(org.apache.http.client.methods.RequestBuilder requestBuilder) throws IOException
preProcessWebserviceCall
in class AbstractHttpClient
requestBuilder
- http method request builderIOException
protected void postProcessWebserviceCall(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.HttpResponse httpState) throws IOException
postProcessWebserviceCall
in class AbstractHttpClient
request
- http requesthttpState
- result of executionIOException
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.