public class URLConnectionEngine extends Object implements ClientHttpEngine
Modifier and Type | Field and Description |
---|---|
protected HostnameVerifier |
hostnameVerifier |
protected SSLContext |
sslContext |
Constructor and Description |
---|
URLConnectionEngine() |
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) |
protected SSLContext sslContext
protected HostnameVerifier hostnameVerifier
public ClientResponse invoke(ClientInvocation request)
invoke
in interface ClientHttpEngine
protected MultivaluedMap<String,String> getHeaders(HttpURLConnection connection)
connection
- - HttpURLConnectionpublic void close()
close
in interface ClientHttpEngine
protected HttpURLConnection createConnection(ClientInvocation request) throws IOException
request
- ClientInvocationIOException
- if url or io exceptionsprotected void executeRequest(ClientInvocation request, HttpURLConnection connection)
request
- ClientInvocationconnection
- HttpURLConnectionprotected void commitHeaders(ClientInvocation request, HttpURLConnection connection)
request
- ClientInvocationconnection
- HttpURLConnectionpublic SSLContext getSslContext()
getSslContext
in interface ClientHttpEngine
public HostnameVerifier getHostnameVerifier()
getHostnameVerifier
in interface ClientHttpEngine
public void setSslContext(SSLContext sslContext)
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
Copyright © 2015. All Rights Reserved.