org.jboss.resteasy.client.jaxrs.engines

## 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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected HostnameVerifier` | `hostnameVerifier`
    `protected SSLContext` | `sslContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `URLConnectionEngine()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `protected void` | `commitHeaders(ClientInvocation request, HttpURLConnection connection)` Add headers to HttpURLConnection from ClientInvocation.
    `protected HttpURLConnection` | `createConnection(ClientInvocation request)` Create HttpUrlConnection from ClientInvorcation and set request method
    `protected void` | `executeRequest(ClientInvocation request, HttpURLConnection connection)` Execute request using HttpURLConnection with body from invocation if needed.
    `protected MultivaluedMap<String,String>` | `getHeaders(HttpURLConnection connection)` Create map with response headers.
    `HostnameVerifier` | `getHostnameVerifier()` {inheritDoc}
    `SSLContext` | `getSslContext()` {inheritDoc}
    `ClientResponse` | `invoke(ClientInvocation request)`
    `void` | `setHostnameVerifier(HostnameVerifier hostnameVerifier)`
    `void` | `setSslContext(SSLContext sslContext)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sslContext

          protected SSLContext sslContext

    - #### hostnameVerifier

          protected HostnameVerifier hostnameVerifier

  - ### Constructor Detail

    - #### URLConnectionEngine

          public URLConnectionEngine()

  - ### Method Detail

    - #### invoke

          public ClientResponse invoke(ClientInvocation request)

      Specified by:
        `invoke` in interface `ClientHttpEngine`

    - #### getHeaders

          protected 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)

Copyright © 2014. All Rights Reserved.