public class SimpleHttpClient extends java.lang.Object implements HttpClient, java.io.Serializable, org.springframework.beans.factory.DisposableBean
HttpClient
which delegates requests to a httpClient
instance.Modifier and Type | Method and Description |
---|---|
void |
destroy()
Shutdown the executor service and close the http client.
|
org.apache.http.client.HttpClient |
getWrappedHttpClient()
Gets wrapped http client.
|
boolean |
isValidEndPoint(java.lang.String url)
Make a synchronous HTTP(S) call to ensure that the url is reachable.
|
boolean |
isValidEndPoint(java.net.URL url)
Make a synchronous HTTP(S) call to ensure that the url is reachable.
|
boolean |
sendMessageToEndPoint(HttpMessage message)
Sends a message to a particular endpoint.
|
HttpMessage |
sendMessageToEndPoint(java.net.URL url)
Contact the URL endpoint as a GET and return the resulting http message.
|
public boolean sendMessageToEndPoint(HttpMessage message)
HttpClient
sendMessageToEndPoint
in interface HttpClient
message
- The message that should be sent to the http endpointpublic HttpMessage sendMessageToEndPoint(java.net.URL url)
HttpClient
sendMessageToEndPoint
in interface HttpClient
url
- the urlpublic boolean isValidEndPoint(java.lang.String url)
HttpClient
isValidEndPoint
in interface HttpClient
url
- the url to callpublic boolean isValidEndPoint(java.net.URL url)
HttpClient
isValidEndPoint
in interface HttpClient
url
- the url to callpublic void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
- if the executor cannot properly shut downpublic org.apache.http.client.HttpClient getWrappedHttpClient()
HttpClient
getWrappedHttpClient
in interface HttpClient