@NotThreadSafe public class WSClientConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT_MS |
static int |
DEFAULT_REQUEST_TIMEOUT_MS |
| Constructor and Description |
|---|
WSClientConfig(URL aEndpointAddress)
Creates a service caller for the service meta data interface
|
| Modifier and Type | Method and Description |
|---|---|
WSClientConfig |
addHandler(Handler<? extends MessageContext> aHandler)
Add a special handler to modify the transmission on the fly.
|
WSClientConfig |
addHTTPHeader(String sName,
Collection<String> aValues)
Add an HTTP header to be send.
|
WSClientConfig |
addHTTPHeader(String sName,
String sValue)
Add an HTTP header to be send.
|
void |
applyWSSettingsToBindingProvider(BindingProvider aBP) |
boolean |
containsHTTPHeader(String sName) |
protected void |
customizeRequestContext(Map<String,Object> aRequestContext)
Add custom properties to the request context.
|
ICommonsList<Handler<? extends MessageContext>> |
getAllHandlers() |
ICommonsMap<String,ICommonsList<String>> |
getAllHTTPHeaders() |
ICommonsList<String> |
getAllHTTPHeaderValues(String sName) |
int |
getConnectionTimeoutMS() |
URL |
getEndpointAddress() |
int |
getHandlerCount() |
HostnameVerifier |
getHostnameVerifier() |
String |
getPassword() |
int |
getRequestTimeoutMS() |
String |
getSOAPAction() |
SSLSocketFactory |
getSSLSocketFactory() |
String |
getUserName() |
boolean |
hasPassword() |
boolean |
hasSOAPAction() |
boolean |
hasUserName() |
boolean |
isCookiesSupportEnabled() |
protected boolean |
isWorkAroundMASM0003() |
EChange |
removeHTTPHeader(String sName)
Remove all HTTP header values with the passed name.
|
EChange |
removeHTTPHeader(String sName,
String sValue)
Remove the HTTP header with the passed name and value.
|
WSClientConfig |
setCompressedRequest(boolean bCompress)
Forces this client to send compressed HTTP content.
|
WSClientConfig |
setCompressedResponse(boolean bCompress)
Add a hint that this client understands compressed HTTP content.
|
WSClientConfig |
setConnectionTimeoutMS(int nConnectionTimeoutMS)
Set the connection timeout in milliseconds.
|
WSClientConfig |
setCookiesSupportEnabled(boolean bEnabled) |
WSClientConfig |
setHostnameVerifier(HostnameVerifier aHostnameVerifier)
Change the
HostnameVerifier to be used by this client. |
WSClientConfig |
setHostnameVerifierTrustAll()
Set the
HostnameVerifier to a "trust all" verifier. |
WSClientConfig |
setHTTPHeader(String sName,
Collection<String> aValues)
Add an HTTP header to be send.
|
WSClientConfig |
setHTTPHeader(String sName,
String sValue)
Add an HTTP header to be send.
|
WSClientConfig |
setPassword(String sPassword)
Set the HTTP Basic Auth password to be used.
|
WSClientConfig |
setRequestTimeoutMS(int nRequestTimeoutMS)
Set the request timeout in milliseconds.
|
WSClientConfig |
setSOAPAction(String sSOAPAction)
Set the SOAP Action to be used.
|
WSClientConfig |
setSSLSocketFactory(SSLSocketFactory aSSLSocketFactory)
Change the
SSLSocketFactory to be used by this client. |
WSClientConfig |
setSSLSocketFactoryTrustAll()
Set the
SSLSocketFactory to be used by this client to one that
trusts all servers. |
WSClientConfig |
setUserName(String sUserName)
Set the HTTP Basic Auth user name to be used.
|
protected WSClientConfig |
setWorkAroundMASM0003(boolean bWorkAroundMASM0003) |
public static final int DEFAULT_CONNECTION_TIMEOUT_MS
public static final int DEFAULT_REQUEST_TIMEOUT_MS
@Nullable public URL getEndpointAddress()
null if the endpoint from the WSDL should be used.@Nullable public SSLSocketFactory getSSLSocketFactory()
SSLSocketFactory to be used by this client. Is
null by default.@Nonnull public WSClientConfig setSSLSocketFactoryTrustAll() throws KeyManagementException
SSLSocketFactory to be used by this client to one that
trusts all servers.KeyManagementException - if initializing the SSL context failed@Nonnull public WSClientConfig setSSLSocketFactory(@Nullable SSLSocketFactory aSSLSocketFactory)
SSLSocketFactory to be used by this client.aSSLSocketFactory - The factory to use. Maybe null to indicate, that the
default SSLSocketFactory is to be used.@Nullable public HostnameVerifier getHostnameVerifier()
HostnameVerifier to be used by this client. Is
null by default.@Nonnull public WSClientConfig setHostnameVerifierTrustAll()
HostnameVerifier to a "trust all" verifier.@Nonnull public WSClientConfig setHostnameVerifier(@Nullable HostnameVerifier aHostnameVerifier)
HostnameVerifier to be used by this client.aHostnameVerifier - The factory to use. Maybe null to indicate, that the
default HostnameVerifier is to be used.public int getConnectionTimeoutMS()
DEFAULT_CONNECTION_TIMEOUT_MS.@Nonnull public WSClientConfig setConnectionTimeoutMS(int nConnectionTimeoutMS)
nConnectionTimeoutMS - Milliseconds. Only values ≥ 0 are considered.public int getRequestTimeoutMS()
DEFAULT_REQUEST_TIMEOUT_MS.@Nonnull public WSClientConfig setRequestTimeoutMS(int nRequestTimeoutMS)
nRequestTimeoutMS - Milliseconds. Only values ≥ 0 are considered.@Nullable public String getUserName()
null.
Default is null.public boolean hasUserName()
true if a HTTP Basic Auth user name is defined,
false otherwise.@Nonnull public WSClientConfig setUserName(@Nullable String sUserName)
sUserName - The user name to use. May be null.@Nullable public String getPassword()
null. Default
is null.public boolean hasPassword()
true if a HTTP Basic Auth password is defined,
false otherwise.@Nonnull public WSClientConfig setPassword(@Nullable String sPassword)
sPassword - The password to use. May be null.@Nullable public String getSOAPAction()
null. Default is
null.public boolean hasSOAPAction()
true if a SOAP Action is defined, false
otherwise.@Nonnull public WSClientConfig setSOAPAction(@Nullable String sSOAPAction)
sSOAPAction - The SOAP Action to use. May be null.@Nonnull public WSClientConfig addHTTPHeader(@Nonnull @Nonempty String sName, @Nonnull String sValue)
sName - Header name. May neither be null nor empty.sValue - Header value. May not be null.addHTTPHeader(String, Collection),
setHTTPHeader(String, String),
setHTTPHeader(String, Collection)@Nonnull public WSClientConfig addHTTPHeader(@Nonnull @Nonempty String sName, @Nonnull Collection<String> aValues)
sName - Header name. May neither be null nor empty.aValues - Header values to be added. May not be null but may not
contain null values. If this collection is empty
nothing happens.addHTTPHeader(String, String),
setHTTPHeader(String, String),
setHTTPHeader(String, Collection)@Nonnull public WSClientConfig setHTTPHeader(@Nonnull @Nonempty String sName, @Nonnull String sValue)
sName - Header name. May neither be null nor empty.sValue - Header value. May not be null.addHTTPHeader(String, String),
addHTTPHeader(String, Collection),
setHTTPHeader(String, Collection)@Nonnull public WSClientConfig setHTTPHeader(@Nonnull @Nonempty String sName, @Nonnull Collection<String> aValues)
sName - Header name. May neither be null nor empty.aValues - Header values to be added. May not be null but may not
contain null values. If this collection is empty the
header will be removed.addHTTPHeader(String, String),
addHTTPHeader(String, Collection),
setHTTPHeader(String, String)@Nonnull public EChange removeHTTPHeader(@Nonnull String sName)
sName - Header name. May be null.EChange.CHANGED if remove was successful.@Nonnull public EChange removeHTTPHeader(@Nullable String sName, @Nullable String sValue)
sName - Header name. May be null.sValue - Header value. May be null.EChange.CHANGED if remove was successful.public boolean containsHTTPHeader(@Nullable String sName)
sName - HTTP header nametrue if the HTTP is contained and contains at least
one value.@Nonnull @ReturnsMutableCopy public ICommonsList<String> getAllHTTPHeaderValues(@Nullable String sName)
sName - HTTP header name. May be null.null but maybe empty.@Nonnull @ReturnsMutableCopy public ICommonsMap<String,ICommonsList<String>> getAllHTTPHeaders()
@Nonnull public WSClientConfig setCompressedRequest(boolean bCompress)
bCompress - true to enable, false to disable.@Nonnull public WSClientConfig setCompressedResponse(boolean bCompress)
bCompress - true to enable, false to disable.public boolean isCookiesSupportEnabled()
@Nonnull public WSClientConfig setCookiesSupportEnabled(boolean bEnabled)
@Nonnull public WSClientConfig addHandler(@Nonnull Handler<? extends MessageContext> aHandler)
aHandler - The handler to be added. May not be null@Nonnegative public int getHandlerCount()
@Nonnull @ReturnsMutableCopy public ICommonsList<Handler<? extends MessageContext>> getAllHandlers()
@OverrideOnDemand protected void customizeRequestContext(@Nonnull Map<String,Object> aRequestContext)
aRequestContext - The request context to be filled. Never null.protected final boolean isWorkAroundMASM0003()
protected final WSClientConfig setWorkAroundMASM0003(boolean bWorkAroundMASM0003)
@OverrideOnDemand @OverridingMethodsMustInvokeSuper public void applyWSSettingsToBindingProvider(@Nonnull BindingProvider aBP)
Copyright © 2014–2016 Philip Helger. All rights reserved.