Class AbstractHttpClient
java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.http.client.AbstractHttpClient
- Direct Known Subclasses:
RemoteHttpCacheDispatcher
This class simply configures the http multithreaded connection manager.
This is abstract because it can do anything. Child classes can overwrite whatever they want.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractHttpClient(RemoteHttpCacheAttributes remoteHttpCacheAttributes) Sets the default Properties File and Heading, and creates the HttpClient and connection manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureClient(org.apache.http.impl.client.HttpClientBuilder builder) Configures the http client.protected final org.apache.http.HttpResponsedoWebserviceCall(org.apache.http.client.methods.RequestBuilder builder) Execute the web service callprotected RemoteHttpCacheAttributesprotected abstract voidpostProcessWebserviceCall(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.HttpResponse httpState) Called after the execute call on the client.protected abstract voidpreProcessWebserviceCall(org.apache.http.client.methods.RequestBuilder requestBuilder) Called before the execute call on the client.
-
Constructor Details
-
AbstractHttpClient
Sets the default Properties File and Heading, and creates the HttpClient and connection manager.- Parameters:
remoteHttpCacheAttributes-
-
-
Method Details
-
configureClient
Configures the http client.- Parameters:
builder- client builder to configure
-
doWebserviceCall
protected final org.apache.http.HttpResponse doWebserviceCall(org.apache.http.client.methods.RequestBuilder builder) throws IOException Execute the web service call- Parameters:
builder- builder for the post request- Returns:
- the call response
- Throws:
IOException- on i/o error
-
preProcessWebserviceCall
protected abstract void preProcessWebserviceCall(org.apache.http.client.methods.RequestBuilder requestBuilder) throws IOException Called before the execute call on the client.- Parameters:
requestBuilder- http method request builder- Throws:
IOException
-
postProcessWebserviceCall
protected abstract void postProcessWebserviceCall(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.HttpResponse httpState) throws IOException Called after the execute call on the client.- Parameters:
request- http requesthttpState- result of execution- Throws:
IOException
-
getRemoteHttpCacheAttributes
- Returns:
- the remoteHttpCacheAttributes
-