public class URLConnectionEngine extends Object implements ClientHttpEngine
Modifier and Type | Field and Description |
---|---|
protected Integer |
connectTimeout |
protected boolean |
followRedirects |
protected HostnameVerifier |
hostnameVerifier |
protected String |
proxyHost |
protected Integer |
proxyPort |
protected String |
proxyScheme |
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}
|
ClientResponse |
invoke(ClientInvocation request) |
javax.ws.rs.core.Response |
invoke(javax.ws.rs.client.Invocation inv) |
boolean |
isFollowRedirects() |
void |
setConnectTimeout(Integer connectTimeout) |
void |
setFollowRedirects(boolean followRedirects) |
void |
setHostnameVerifier(HostnameVerifier hostnameVerifier) |
void |
setProxyHost(String proxyHost) |
void |
setProxyPort(Integer proxyPort) |
void |
setProxyScheme(String proxyScheme) |
void |
setReadTimeout(Integer readTimeout) |
void |
setSslContext(SSLContext sslContext) |
protected SSLContext sslContext
protected HostnameVerifier hostnameVerifier
protected Integer readTimeout
protected Integer connectTimeout
protected String proxyHost
protected Integer proxyPort
protected String proxyScheme
protected boolean followRedirects
public javax.ws.rs.core.Response invoke(javax.ws.rs.client.Invocation inv)
public ClientResponse invoke(ClientInvocation request)
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)
public void setProxyHost(String proxyHost)
public void setProxyPort(Integer proxyPort)
public void setProxyScheme(String proxyScheme)
public void setFollowRedirects(boolean followRedirects)
setFollowRedirects
in interface ClientHttpEngine
public boolean isFollowRedirects()
isFollowRedirects
in interface ClientHttpEngine
Copyright © 2021 JBoss by Red Hat. All rights reserved.