Class URLConnectionEngine
- java.lang.Object
-
- org.jboss.resteasy.client.jaxrs.engines.URLConnectionEngine
-
- All Implemented Interfaces:
ClientHttpEngine
public class URLConnectionEngine extends java.lang.Object implements ClientHttpEngine
- Version:
- $Revision: 1 $
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.net.ssl.HostnameVerifier
hostnameVerifier
protected javax.net.ssl.SSLContext
sslContext
-
Constructor Summary
Constructors Constructor Description URLConnectionEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
commitHeaders(ClientInvocation request, java.net.HttpURLConnection connection)
Add headers to HttpURLConnection from ClientInvocation.protected java.net.HttpURLConnection
createConnection(ClientInvocation request)
Create HttpUrlConnection from ClientInvorcation and set request methodprotected void
executeRequest(ClientInvocation request, java.net.HttpURLConnection connection)
Execute request using HttpURLConnection with body from invocation if needed.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
getHeaders(java.net.HttpURLConnection connection)
Create map with response headers.javax.net.ssl.HostnameVerifier
getHostnameVerifier()
{inheritDoc}javax.net.ssl.SSLContext
getSslContext()
{inheritDoc}ClientResponse
invoke(ClientInvocation request)
void
setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
void
setSslContext(javax.net.ssl.SSLContext sslContext)
-
-
-
Method Detail
-
invoke
public ClientResponse invoke(ClientInvocation request)
- Specified by:
invoke
in interfaceClientHttpEngine
-
getHeaders
protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getHeaders(java.net.HttpURLConnection connection)
Create map with response headers.- Parameters:
connection
- - HttpURLConnection- Returns:
- map key - list of values
-
close
public void close()
- Specified by:
close
in interfaceClientHttpEngine
-
createConnection
protected java.net.HttpURLConnection createConnection(ClientInvocation request) throws java.io.IOException
Create HttpUrlConnection from ClientInvorcation and set request method- Parameters:
request
- ClientInvocation- Returns:
- HttpURLConnection with method & url already set
- Throws:
java.io.IOException
- if url or io exceptions
-
executeRequest
protected void executeRequest(ClientInvocation request, java.net.HttpURLConnection connection)
Execute request using HttpURLConnection with body from invocation if needed.- Parameters:
request
- ClientInvocationconnection
- HttpURLConnection
-
commitHeaders
protected void commitHeaders(ClientInvocation request, java.net.HttpURLConnection connection)
Add headers to HttpURLConnection from ClientInvocation. Should be executed before writing body.- Parameters:
request
- ClientInvocationconnection
- HttpURLConnection
-
getSslContext
public javax.net.ssl.SSLContext getSslContext()
{inheritDoc}- Specified by:
getSslContext
in interfaceClientHttpEngine
- Returns:
-
getHostnameVerifier
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
{inheritDoc}- Specified by:
getHostnameVerifier
in interfaceClientHttpEngine
- Returns:
-
setSslContext
public void setSslContext(javax.net.ssl.SSLContext sslContext)
-
setHostnameVerifier
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
-
-