org.apache.jcs.auxiliary.remote.http.client
Class RemoteHttpCacheDispatcher

java.lang.Object
  extended by org.apache.jcs.auxiliary.remote.http.client.AbstractHttpClient
      extended by org.apache.jcs.auxiliary.remote.http.client.RemoteHttpCacheDispatcher
All Implemented Interfaces:
IRemoteCacheDispatcher

public class RemoteHttpCacheDispatcher
extends AbstractHttpClient
implements IRemoteCacheDispatcher

Calls the service.


Constructor Summary
RemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes)
           
 
Method Summary
protected  String addParameters(RemoteCacheRequest remoteCacheRequest, String baseUrl)
           
 RemoteCacheResponse dispatchRequest(RemoteCacheRequest remoteCacheRequest)
          All requests will go through this method.
 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, String url)
           
 
Methods inherited from class org.apache.jcs.auxiliary.remote.http.client.AbstractHttpClient
configureClient, doWebserviceCall, getConnectionManager, getRemoteHttpCacheAttributes, setConnectionManager, setRemoteHttpCacheAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteHttpCacheDispatcher

public RemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes)
Parameters:
remoteHttpCacheAttributes -
Method Detail

dispatchRequest

public RemoteCacheResponse dispatchRequest(RemoteCacheRequest remoteCacheRequest)
                                    throws IOException
All requests will go through this method.

TODO consider taking in a URL instead of using the one in the configuration.

Specified by:
dispatchRequest in interface IRemoteCacheDispatcher
Parameters:
remoteCacheRequest -
Returns:
RemoteCacheResponse
Throws:
IOException

processRequest

protected byte[] processRequest(byte[] requestAsByteArray,
                                String url)
                         throws IOException,
                                org.apache.commons.httpclient.HttpException
Parameters:
requestAsByteArray -
url -
Returns:
byte[] - the response
Throws:
IOException
org.apache.commons.httpclient.HttpException

addParameters

protected String addParameters(RemoteCacheRequest remoteCacheRequest,
                               String baseUrl)
Parameters:
remoteCacheRequest -
baseUrl -
Returns:
String

preProcessWebserviceCall

public org.apache.commons.httpclient.HttpState preProcessWebserviceCall(org.apache.commons.httpclient.HttpMethod post)
                                                                 throws IOException
Called before the executeMethod on the client.

Specified by:
preProcessWebserviceCall in class AbstractHttpClient
Parameters:
post - http method
Returns:
HttpState
Throws:
IOException

postProcessWebserviceCall

public void postProcessWebserviceCall(org.apache.commons.httpclient.HttpMethod post,
                                      org.apache.commons.httpclient.HttpState httpState)
                               throws IOException
Called after the executeMethod on the client.

Specified by:
postProcessWebserviceCall in class AbstractHttpClient
Parameters:
post - http method
httpState - state
Throws:
IOException


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.