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.HostnameVerifierhostnameVerifierprotected javax.net.ssl.SSLContextsslContext
-
Constructor Summary
Constructors Constructor Description URLConnectionEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidcommitHeaders(ClientInvocation request, java.net.HttpURLConnection connection)Add headers to HttpURLConnection from ClientInvocation.protected java.net.HttpURLConnectioncreateConnection(ClientInvocation request)Create HttpUrlConnection from ClientInvorcation and set request methodprotected voidexecuteRequest(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.HostnameVerifiergetHostnameVerifier(){inheritDoc}javax.net.ssl.SSLContextgetSslContext(){inheritDoc}ClientResponseinvoke(ClientInvocation request)voidsetHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)voidsetSslContext(javax.net.ssl.SSLContext sslContext)
-
-
-
Method Detail
-
invoke
public ClientResponse invoke(ClientInvocation request)
- Specified by:
invokein 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:
closein 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:
getSslContextin interfaceClientHttpEngine- Returns:
-
getHostnameVerifier
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
{inheritDoc}- Specified by:
getHostnameVerifierin interfaceClientHttpEngine- Returns:
-
setSslContext
public void setSslContext(javax.net.ssl.SSLContext sslContext)
-
setHostnameVerifier
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
-
-