Class URLConnectionEngine

java.lang.Object
org.jboss.resteasy.client.jaxrs.engines.URLConnectionEngine
All Implemented Interfaces:
ClientHttpEngine

public class URLConnectionEngine extends Object implements ClientHttpEngine
Version:
$Revision: 1 $
  • Field Details

  • Constructor Details

    • URLConnectionEngine

      public URLConnectionEngine()
  • Method Details

    • invoke

      public ClientResponse invoke(ClientInvocation request)
      Specified by:
      invoke in interface ClientHttpEngine
    • getHeaders

      protected javax.ws.rs.core.MultivaluedMap<String,String> getHeaders(HttpURLConnection connection)
      Create map with response headers.
      Parameters:
      connection - - HttpURLConnection
      Returns:
      map key - list of values
    • close

      public void close()
      Specified by:
      close in interface ClientHttpEngine
    • createConnection

      protected HttpURLConnection createConnection(ClientInvocation request) throws IOException
      Create HttpUrlConnection from ClientInvorcation and set request method
      Parameters:
      request - ClientInvocation
      Returns:
      HttpURLConnection with method & url already set
      Throws:
      IOException - if url or io exceptions
    • executeRequest

      protected void executeRequest(ClientInvocation request, HttpURLConnection connection)
      Execute request using HttpURLConnection with body from invocation if needed.
      Parameters:
      request - ClientInvocation
      connection - HttpURLConnection
    • commitHeaders

      protected void commitHeaders(ClientInvocation request, HttpURLConnection connection)
      Add headers to HttpURLConnection from ClientInvocation. Should be executed before writing body.
      Parameters:
      request - ClientInvocation
      connection - HttpURLConnection
    • getSslContext

      public SSLContext getSslContext()
      {inheritDoc}
      Specified by:
      getSslContext in interface ClientHttpEngine
      Returns:
    • getHostnameVerifier

      public HostnameVerifier getHostnameVerifier()
      {inheritDoc}
      Specified by:
      getHostnameVerifier in interface ClientHttpEngine
      Returns:
    • setSslContext

      public void setSslContext(SSLContext sslContext)
    • setHostnameVerifier

      public void setHostnameVerifier(HostnameVerifier hostnameVerifier)