public class URLConnectionEngine extends java.lang.Object implements ClientHttpEngine
Modifier and Type | Field and Description |
---|---|
protected javax.net.ssl.HostnameVerifier |
hostnameVerifier |
protected javax.net.ssl.SSLContext |
sslContext |
Constructor and Description |
---|
URLConnectionEngine() |
Modifier and Type | Method and 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 method
|
protected 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) |
protected javax.net.ssl.SSLContext sslContext
protected javax.net.ssl.HostnameVerifier hostnameVerifier
public ClientResponse invoke(ClientInvocation request)
invoke
in interface ClientHttpEngine
protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getHeaders(java.net.HttpURLConnection connection)
connection
- - HttpURLConnectionpublic void close()
close
in interface ClientHttpEngine
protected java.net.HttpURLConnection createConnection(ClientInvocation request) throws java.io.IOException
request
- ClientInvocationjava.io.IOException
- if url or io exceptionsprotected void executeRequest(ClientInvocation request, java.net.HttpURLConnection connection)
request
- ClientInvocationconnection
- HttpURLConnectionprotected void commitHeaders(ClientInvocation request, java.net.HttpURLConnection connection)
request
- ClientInvocationconnection
- HttpURLConnectionpublic javax.net.ssl.SSLContext getSslContext()
getSslContext
in interface ClientHttpEngine
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
getHostnameVerifier
in interface ClientHttpEngine
public void setSslContext(javax.net.ssl.SSLContext sslContext)
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)