Package org.apereo.cas.util.http
Class SimpleHttpClient
- java.lang.Object
-
- org.apereo.cas.util.http.SimpleHttpClient
-
- All Implemented Interfaces:
java.io.Serializable,HttpClient,org.springframework.beans.factory.DisposableBean
public class SimpleHttpClient extends java.lang.Object implements HttpClient, java.io.Serializable, org.springframework.beans.factory.DisposableBean
Implementation of CASHttpClientwhich delegates requests to awrappedHttpClientinstance.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apereo.cas.util.http.HttpClient
BEAN_NAME_HTTPCLIENT_NO_REDIRECT, BEAN_NAME_HTTPCLIENT_TRUST_STORE
-
-
Constructor Summary
Constructors Constructor Description SimpleHttpClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()booleanisValidEndPoint(java.lang.String url)Make a synchronous HTTP(S) call to ensure that the url is reachable.booleanisValidEndPoint(java.net.URL url)Make a synchronous HTTP(S) call to ensure that the url is reachable.HttpMessagesendMessageToEndPoint(java.net.URL url)Contact the URL endpoint as a GET and return the resulting http message.booleansendMessageToEndPoint(HttpMessage message)Sends a message to a particular endpoint.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apereo.cas.util.http.HttpClient
getHttpClientFactory, getWrappedHttpClient
-
-
-
-
Method Detail
-
sendMessageToEndPoint
public boolean sendMessageToEndPoint(HttpMessage message)
Description copied from interface:HttpClientSends a message to a particular endpoint. Option of sending it without waiting to ensure a response was returned. This is useful when it doesn't matter about the response as you'll perform no action based on the response.- Specified by:
sendMessageToEndPointin interfaceHttpClient- Parameters:
message- The message that should be sent to the http endpoint- Returns:
- boolean if the message was sent, or async was used. false if the message failed.
-
sendMessageToEndPoint
public HttpMessage sendMessageToEndPoint(java.net.URL url)
Description copied from interface:HttpClientContact the URL endpoint as a GET and return the resulting http message.- Specified by:
sendMessageToEndPointin interfaceHttpClient- Parameters:
url- the url- Returns:
- the http message
-
isValidEndPoint
public boolean isValidEndPoint(java.lang.String url)
Description copied from interface:HttpClientMake a synchronous HTTP(S) call to ensure that the url is reachable.- Specified by:
isValidEndPointin interfaceHttpClient- Parameters:
url- the url to call- Returns:
- whether the url is valid
-
isValidEndPoint
public boolean isValidEndPoint(java.net.URL url)
Description copied from interface:HttpClientMake a synchronous HTTP(S) call to ensure that the url is reachable.- Specified by:
isValidEndPointin interfaceHttpClient- Parameters:
url- the url to call- Returns:
- whether the url is valid
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
-