Package org.apereo.cas.util.http
Interface HttpClient
-
- All Known Implementing Classes:
SimpleHttpClient
public interface HttpClientDefine the behaviour of a HTTP client.- Since:
- 4.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEAN_NAME_HTTPCLIENT_NO_REDIRECTBean name for the client implementation that does not follow redirects.static java.lang.StringBEAN_NAME_HTTPCLIENT_TRUST_STOREBean name for the client implementation that supports CAS trust store.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpClientFactorygetHttpClientFactory()Gets http client factory.org.apache.http.client.HttpClientgetWrappedHttpClient()Gets wrapped http client.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.
-
-
-
Field Detail
-
BEAN_NAME_HTTPCLIENT_TRUST_STORE
static final java.lang.String BEAN_NAME_HTTPCLIENT_TRUST_STORE
Bean name for the client implementation that supports CAS trust store.- See Also:
- Constant Field Values
-
BEAN_NAME_HTTPCLIENT_NO_REDIRECT
static final java.lang.String BEAN_NAME_HTTPCLIENT_NO_REDIRECT
Bean name for the client implementation that does not follow redirects.- See Also:
- Constant Field Values
-
-
Method Detail
-
sendMessageToEndPoint
boolean sendMessageToEndPoint(HttpMessage message)
Sends 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.- 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.
- Since:
- 4.1.0
-
sendMessageToEndPoint
HttpMessage sendMessageToEndPoint(java.net.URL url)
Contact the URL endpoint as a GET and return the resulting http message.- Parameters:
url- the url- Returns:
- the http message
-
isValidEndPoint
boolean isValidEndPoint(java.lang.String url)
Make a synchronous HTTP(S) call to ensure that the url is reachable.- Parameters:
url- the url to call- Returns:
- whether the url is valid
-
isValidEndPoint
boolean isValidEndPoint(java.net.URL url)
Make a synchronous HTTP(S) call to ensure that the url is reachable.- Parameters:
url- the url to call- Returns:
- whether the url is valid
-
getWrappedHttpClient
org.apache.http.client.HttpClient getWrappedHttpClient()
Gets wrapped http client.- Returns:
- the wrapped http client
-
getHttpClientFactory
HttpClientFactory getHttpClientFactory()
Gets http client factory.- Returns:
- the http client factory
-
-