Package com.webmethods.caf.wsclient
Class WSClientConfig
java.lang.Object
com.webmethods.caf.wsclient.WSClientConfig
A container for configuration options for a WSClient instance, these options include:
- Initial cache timout of the factory's caches
- Initial cache size of the factory's caches
- The default socket timeout
- The default basic auth credentials
- The saml artifact factory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthCredentials
Default empty credentials for authenticating against the web service providerstatic final String
Default class name for handling basic authenticationstatic final int
Default cache size (1000) for theIWSCacheManager
static final long
Default timeout (10 mins) for theIWSCacheManager
static final int
Default timeout (1 min) for socket connections -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor, uses default values for all configuration optionsWSClientConfig
(AuthCredentials authCredentials) Create a new WSClientConfig instance with the specified web service authentication credentials.WSClientConfig
(AuthCredentials authCredentials, int initialCacheSize, int cacheTimeout) Create a new WSClientConfig instance with the specified web service authentication credentials, as well as override the defaults for web service result caching.WSClientConfig
(AuthCredentials authCredentials, IArtifactFactory artifactFactory) Create a new WSClientConfig instance with the specified web service authentication credentials, as well as register a factory for generating SAML security artifacts.WSClientConfig
(AuthCredentials authCredentials, IArtifactFactory artifactFactory, int initialCacheSize, long cacheTimeout) Create a new WSClientConfig instance with the specified web service authentication credentials, register a factory for generating SAML security artifacts, as well as override the defaults for web service result caching. -
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(WSClientConfig otherConfig) Compare this instance of WSClient config with another instance, comparing all of the configured options to determine if all are equalGet theIArtifactFactory
implementation registered with WSClient for generating SAML artifacts for outgoing web service requests with the SAML or HYBRID authentication methods.Get the AuthCredentials object used when authenticating with the web service providerGet the class name of the registered basic authenticator registered with this instance of WSClientlong
Get the time-to-live for web service results cache entriesint
Get the initial size of the web service results cacheGet the endpoint URL used for validating received SAML artifacts.int
Get the timeout for web service requests, measured in millisecondsprotected boolean
Helper method for comparing two objects for equalityvoid
setArtifactFactory
(IArtifactFactory artifactFactory) Set theIArtifactFactory
implementation registered with WSClient for generating SAML artifacts for outgoing web service requests with the SAML or HYBRID authentication methods.void
setAuthCredentials
(AuthCredentials authCredentials) Set the AuthCredentials object used when authenticating with the web service providervoid
setBasicAuthValidatorClassName
(String basicAuthValidatorClassName) Set the class name of the registered basic authenticator registeredvoid
setCacheTimeout
(long cacheTimeout) Set the time-to-live for web service results cache entriesvoid
setInitialCacheSize
(int initialCacheSize) Set the initial size of the web service results cachevoid
setSamlSecurityEndpoint
(String samlSecurityEndpoint) Set the endpoint URL used for validating received SAML artifacts.void
setSocketTimeout
(int socketTimeout) Set the timeout for web service requests
-
Field Details
-
DEFAULT_CACHE_SIZE
public static final int DEFAULT_CACHE_SIZEDefault cache size (1000) for theIWSCacheManager
- See Also:
-
DEFAULT_CACHE_TIMEOUT
public static final long DEFAULT_CACHE_TIMEOUTDefault timeout (10 mins) for theIWSCacheManager
- See Also:
-
DEFAULT_SOCKET_TIMEOUT
public static final int DEFAULT_SOCKET_TIMEOUTDefault timeout (1 min) for socket connections- See Also:
-
DEFAULT_AUTH_CREDENTIALS
Default empty credentials for authenticating against the web service provider -
DEFAULT_BASIC_AUTH_VALIDATOR_CLASS_NAME
Default class name for handling basic authentication- See Also:
-
-
Constructor Details
-
WSClientConfig
public WSClientConfig()Default constructor, uses default values for all configuration options -
WSClientConfig
Create a new WSClientConfig instance with the specified web service authentication credentials. Default values are used for all other configuration options.- Parameters:
authCredentials
- theAuthCredentials
to use when authenticating with the web service provider.
-
WSClientConfig
Create a new WSClientConfig instance with the specified web service authentication credentials, as well as override the defaults for web service result caching. Default values are used for all other configuration options.- Parameters:
authCredentials
- theAuthCredentials
to use when authenticating with the web service provider.initialCacheSize
- initial size of the web service results cachecacheTimeout
- time-to-live for web service result cache entries before then become stale and thrown away
-
WSClientConfig
Create a new WSClientConfig instance with the specified web service authentication credentials, as well as register a factory for generating SAML security artifacts. Default values are used for all other configuration options.- Parameters:
authCredentials
- theAuthCredentials
to use when authenticating with the web service provider.artifactFactory
- implementation ofIArtifactFactory
to generate SAML artifacts when authenticating web service requests with the SAML or Hybrid authentication method.
-
WSClientConfig
public WSClientConfig(AuthCredentials authCredentials, IArtifactFactory artifactFactory, int initialCacheSize, long cacheTimeout) Create a new WSClientConfig instance with the specified web service authentication credentials, register a factory for generating SAML security artifacts, as well as override the defaults for web service result caching.- Parameters:
authCredentials
- theAuthCredentials
to use when authenticating with the web service provider.artifactFactory
- implementation ofIArtifactFactory
to generate SAML artifacts when authenticating web service requests with the SAML or Hybrid authentication method.initialCacheSize
- initial size of the web service results cachecacheTimeout
- time-to-live for web service result cache entries before then become stale and thrown away
-
-
Method Details
-
getAuthCredentials
Get the AuthCredentials object used when authenticating with the web service provider- Returns:
- the current AuthCredentials object
-
setAuthCredentials
Set the AuthCredentials object used when authenticating with the web service provider- Parameters:
authCredentials
- the AuthCredentials to authenticate web service requests
-
getInitialCacheSize
public int getInitialCacheSize()Get the initial size of the web service results cache- Returns:
- the cache size
-
setInitialCacheSize
public void setInitialCacheSize(int initialCacheSize) Set the initial size of the web service results cache- Parameters:
initialCacheSize
- the initial size to use for the web service results cache, measured in milliseconds
-
getCacheTimeout
public long getCacheTimeout()Get the time-to-live for web service results cache entries- Returns:
- the time-to-live in milliseconds
-
setCacheTimeout
public void setCacheTimeout(long cacheTimeout) Set the time-to-live for web service results cache entries- Parameters:
cacheTimeout
- the time-to-live for cache entries, measured in milliseconds
-
getSocketTimeout
public int getSocketTimeout()Get the timeout for web service requests, measured in milliseconds- Returns:
- the timeout value in milliseconds
-
setSocketTimeout
public void setSocketTimeout(int socketTimeout) Set the timeout for web service requests- Parameters:
socketTimeout
- the timeout value in milliseconds
-
getSamlSecurityEndpoint
Get the endpoint URL used for validating received SAML artifacts. Only necessary when running as a web service provider.- Returns:
- the SAML security endpoint URL as string
-
setSamlSecurityEndpoint
Set the endpoint URL used for validating received SAML artifacts. Only necessary when running as a web service provider.- Parameters:
samlSecurityEndpoint
- the SAML security endpoint URL as string
-
getArtifactFactory
Get theIArtifactFactory
implementation registered with WSClient for generating SAML artifacts for outgoing web service requests with the SAML or HYBRID authentication methods.- Returns:
- the registered instance of
IArtifactFactory
-
setArtifactFactory
Set theIArtifactFactory
implementation registered with WSClient for generating SAML artifacts for outgoing web service requests with the SAML or HYBRID authentication methods.- Parameters:
artifactFactory
- an implementation ofIArtifactFactory
to use
-
getBasicAuthValidatorClassName
Get the class name of the registered basic authenticator registered with this instance of WSClient- Returns:
- the name of the authenticator class
-
setBasicAuthValidatorClassName
Set the class name of the registered basic authenticator registered- Parameters:
basicAuthValidatorClassName
- the name of the authenticator class
-
equals
Compare this instance of WSClient config with another instance, comparing all of the configured options to determine if all are equal- Parameters:
otherConfig
- the instance of WSClientConfig to compare against- Returns:
- true if all the options are configured the same as this instance
-
isEqual
Helper method for comparing two objects for equality- Returns:
- true if they are equal
-