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 $
Author:
Alexey Ogarkov
  • Field Details

    • sslContext

      protected SSLContext sslContext
    • hostnameVerifier

      protected HostnameVerifier hostnameVerifier
    • readTimeout

      protected Integer readTimeout
    • connectTimeout

      protected Integer connectTimeout
    • proxyHost

      protected String proxyHost
    • proxyPort

      protected Integer proxyPort
    • proxyScheme

      protected String proxyScheme
    • followRedirects

      protected boolean followRedirects
  • Constructor Details

    • URLConnectionEngine

      public URLConnectionEngine()
  • Method Details

    • invoke

      public jakarta.ws.rs.core.Response invoke(jakarta.ws.rs.client.Invocation inv)
      Specified by:
      invoke in interface ClientHttpEngine
    • getHeaders

      protected jakarta.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:
      SSLContext
    • getHostnameVerifier

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

      public void setSslContext(SSLContext sslContext)
    • setHostnameVerifier

      public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
    • setConnectTimeout

      public void setConnectTimeout(Integer connectTimeout)
    • setReadTimeout

      public void setReadTimeout(Integer readTimeout)
    • setProxyHost

      public void setProxyHost(String proxyHost)
    • setProxyPort

      public void setProxyPort(Integer proxyPort)
    • setProxyScheme

      public void setProxyScheme(String proxyScheme)
    • setFollowRedirects

      public void setFollowRedirects(boolean followRedirects)
      Specified by:
      setFollowRedirects in interface ClientHttpEngine
    • isFollowRedirects

      public boolean isFollowRedirects()
      Specified by:
      isFollowRedirects in interface ClientHttpEngine