public class URLConnectionEngine extends Object implements ClientHttpEngine
Modifier and Type | Field and Description |
---|---|
protected Integer |
connectTimeout |
protected HostnameVerifier |
hostnameVerifier |
protected Integer |
readTimeout |
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 javax.ws.rs.core.MultivaluedMap<String,String> |
getHeaders(HttpURLConnection connection)
Create map with response headers.
|
HostnameVerifier |
getHostnameVerifier()
{inheritDoc}
|
SSLContext |
getSslContext()
{inheritDoc}
|
javax.ws.rs.core.Response |
invoke(javax.ws.rs.client.Invocation inv) |
void |
setConnectTimeout(Integer connectTimeout) |
void |
setHostnameVerifier(HostnameVerifier hostnameVerifier) |
void |
setReadTimeout(Integer readTimeout) |
void |
setSslContext(SSLContext sslContext) |
protected SSLContext sslContext
protected HostnameVerifier hostnameVerifier
protected Integer readTimeout
protected Integer connectTimeout
public javax.ws.rs.core.Response invoke(javax.ws.rs.client.Invocation inv)
invoke
in interface ClientHttpEngine
protected javax.ws.rs.core.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
SSLContext
public HostnameVerifier getHostnameVerifier()
getHostnameVerifier
in interface ClientHttpEngine
HostnameVerifier
public void setSslContext(SSLContext sslContext)
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
public void setConnectTimeout(Integer connectTimeout)
public void setReadTimeout(Integer readTimeout)
Copyright © 2019 JBoss by Red Hat. All rights reserved.