Class 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 CAS HttpClient which delegates requests to a wrappedHttpClient instance.
    Since:
    3.1
    See Also:
    Serialized Form
    • Constructor Detail

      • SimpleHttpClient

        public SimpleHttpClient()
    • Method Detail

      • sendMessageToEndPoint

        public boolean sendMessageToEndPoint​(HttpMessage message)
        Description copied from interface: HttpClient
        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.
        Specified by:
        sendMessageToEndPoint in interface HttpClient
        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: HttpClient
        Contact the URL endpoint as a GET and return the resulting http message.
        Specified by:
        sendMessageToEndPoint in interface HttpClient
        Parameters:
        url - the url
        Returns:
        the http message
      • isValidEndPoint

        public boolean isValidEndPoint​(java.lang.String url)
        Description copied from interface: HttpClient
        Make a synchronous HTTP(S) call to ensure that the url is reachable.
        Specified by:
        isValidEndPoint in interface HttpClient
        Parameters:
        url - the url to call
        Returns:
        whether the url is valid
      • isValidEndPoint

        public boolean isValidEndPoint​(java.net.URL url)
        Description copied from interface: HttpClient
        Make a synchronous HTTP(S) call to ensure that the url is reachable.
        Specified by:
        isValidEndPoint in interface HttpClient
        Parameters:
        url - the url to call
        Returns:
        whether the url is valid
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean