public class RemoteHttpCacheDispatcher extends AbstractHttpClient implements IRemoteCacheDispatcher
| Constructor and Description |
|---|
RemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
addParameters(RemoteCacheRequest remoteCacheRequest,
java.lang.String baseUrl) |
RemoteCacheResponse |
dispatchRequest(RemoteCacheRequest remoteCacheRequest)
All requests will go through this method.
|
protected void |
doWebserviceCall(org.apache.commons.httpclient.HttpMethod post)
Extracted method that can be overwritten to do additional things to the post before the call
is made.
|
void |
postProcessWebserviceCall(org.apache.commons.httpclient.HttpMethod post,
org.apache.commons.httpclient.HttpState httpState)
Called after the executeMethod on the client.
|
org.apache.commons.httpclient.HttpState |
preProcessWebserviceCall(org.apache.commons.httpclient.HttpMethod post)
Called before the executeMethod on the client.
|
protected byte[] |
processRequest(byte[] requestAsByteArray,
java.lang.String url) |
configureClient, getConnectionManager, getHttpClient, getRemoteHttpCacheAttributes, setConnectionManager, setHttpClient, setRemoteHttpCacheAttributespublic RemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes)
remoteHttpCacheAttributes - public RemoteCacheResponse dispatchRequest(RemoteCacheRequest remoteCacheRequest) throws java.io.IOException
TODO consider taking in a URL instead of using the one in the configuration.
dispatchRequest in interface IRemoteCacheDispatcherremoteCacheRequest - java.io.IOExceptionprotected byte[] processRequest(byte[] requestAsByteArray,
java.lang.String url)
throws java.io.IOException,
org.apache.commons.httpclient.HttpException
requestAsByteArray - url - java.io.IOExceptionorg.apache.commons.httpclient.HttpExceptionprotected java.lang.String addParameters(RemoteCacheRequest remoteCacheRequest, java.lang.String baseUrl)
remoteCacheRequest - baseUrl - protected final void doWebserviceCall(org.apache.commons.httpclient.HttpMethod post)
throws java.io.IOException
post - the post that is about to get executed.java.io.IOException - on i/o errorpublic org.apache.commons.httpclient.HttpState preProcessWebserviceCall(org.apache.commons.httpclient.HttpMethod post)
throws java.io.IOException
post - http methodjava.io.IOExceptionpublic void postProcessWebserviceCall(org.apache.commons.httpclient.HttpMethod post,
org.apache.commons.httpclient.HttpState httpState)
throws java.io.IOException
post - http methodhttpState - statejava.io.IOExceptionCopyright © 2002-2013 Apache Software Foundation. All Rights Reserved.