public class ClientConfiguration extends Object
Client
for HTTP based communication can be configured. It is designed to be used for properties
which are the very same for each (or most) of the requests of your use case - e.g. an authorization token in
the header.
So the intended usage is that such a configuration is created once and will then be used for each client you
need to do your communications.Constructor and Description |
---|
ClientConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptSelfSignedCertificates()
Returns is support for self signed certificates is needed
|
ClientConfiguration |
addBaseHeaders(Parameter... headers)
Add the set of headers which will be added to each client call.
|
ClientConfiguration |
addBaseParameters(Parameter... parameters)
Add the set of parameters which will be added to each client call.
|
protected String |
fieldAsString(Field field) |
protected List<Parameter> |
getBaseHeaders()
Returns a list of the headers which will be added to each client call.
|
protected List<Parameter> |
getBaseParameters()
Returns a list of the parameters which will be added to each client call.
|
protected String |
getBaseUrl()
Returns the url prefix to be added in front of every url used for a client call.
|
protected int |
getConnectTimeout()
Returns the value for the connect timeout, i.e. the time the client waits for establishing a connection.
|
protected String |
getProxyUrl()
Returns the url to the proxy to be used
|
protected int |
getSocketTimeout()
Returns the value for the socket timeout, i.e. the time the client waits for a response.
|
protected boolean |
handleRedirects()
Returns if support of handling redirects is needed
|
ClientConfiguration |
setAcceptSelfSignedCertificates(boolean acceptSelfSignedCertificates)
Set this property to true if you want to accept self signed certificates.
|
ClientConfiguration |
setBaseUrl(String baseUrl)
Sets the url prefix to be added in front of every url used for a client call.
|
ClientConfiguration |
setConnectTimeout(int connectTimeout)
Sets the connect timeout of a client request, i.e. the time the client waits for establishing a connection.
|
ClientConfiguration |
setHandleRedirects(boolean handleRedirects)
Set this property to true if you need to support redirects in the response of a client call.
|
ClientConfiguration |
setProxyUrl(String proxyUrl)
Set the url to the proxy.
|
ClientConfiguration |
setSocketTimeout(int socketTimeout)
Sets the socket timeout of a client request, i.e. the time the client waits for a response.
|
String |
toString() |
protected boolean acceptSelfSignedCertificates()
public ClientConfiguration setAcceptSelfSignedCertificates(boolean acceptSelfSignedCertificates)
acceptSelfSignedCertificates
- the acceptSelfSignedCertificates to setprotected List<Parameter> getBaseHeaders()
public ClientConfiguration addBaseHeaders(Parameter... headers)
headers
- the headers used for each client callprotected List<Parameter> getBaseParameters()
public ClientConfiguration addBaseParameters(Parameter... parameters)
parameters
- the parameters used for each client callprotected boolean handleRedirects()
public ClientConfiguration setHandleRedirects(boolean handleRedirects)
handleRedirects
- the handleRedirects to setprotected String getBaseUrl()
public ClientConfiguration setBaseUrl(String baseUrl)
baseUrl
- the baseUrl to setprotected int getSocketTimeout()
public ClientConfiguration setSocketTimeout(int socketTimeout)
socketTimeout
- the socket timeout to setprotected int getConnectTimeout()
public ClientConfiguration setConnectTimeout(int connectTimeout)
connectTimeout
- the connect timeout to setprotected String getProxyUrl()
public ClientConfiguration setProxyUrl(String proxyUrl)
proxyUrl
- the url to the proxy@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.