com.webmethods.caf.wsclient
Class WSClientConfig

java.lang.Object
  extended by com.webmethods.caf.wsclient.WSClientConfig

public class WSClientConfig
extends Object

A container for configuration options for a WSClient instance, these options include:


Field Summary
static AuthCredentials DEFAULT_AUTH_CREDENTIALS
          Default empty credentials for authenticating against the web service provider
static String DEFAULT_BASIC_AUTH_VALIDATOR_CLASS_NAME
          Default class name for handling basic authentication
static int DEFAULT_CACHE_SIZE
          Default cache size (1000) for the IWSCacheManager
static long DEFAULT_CACHE_TIMEOUT
          Default timeout (10 mins) for the IWSCacheManager
static int DEFAULT_SOCKET_TIMEOUT
          Default timeout (1 min) for socket connections
 
Constructor Summary
WSClientConfig()
          Default constructor, uses default values for all configuration options
WSClientConfig(AuthCredentials authCredentials)
          Create a new WSClientConfig instance with the specified web service authentication credentials.
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.
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.
 
Method Summary
 boolean equals(WSClientConfig otherConfig)
          Compare this instance of WSClient config with another instance, comparing all of the configured options to determine if all are equal
 IArtifactFactory getArtifactFactory()
          Get the IArtifactFactory implementation registered with WSClient for generating SAML artifacts for outgoing web service requests with the SAML or HYBRID authentication methods.
 AuthCredentials getAuthCredentials()
          Get the AuthCredentials object used when authenticating with the web service provider
 String getBasicAuthValidatorClassName()
          Get the class name of the registered basic authenticator registered with this instance of WSClient
 long getCacheTimeout()
          Get the time-to-live for web service results cache entries
 int getInitialCacheSize()
          Get the initial size of the web service results cache
 String getSamlSecurityEndpoint()
          Get the endpoint URL used for validating received SAML artifacts.
 int getSocketTimeout()
          Get the timeout for web service requests, measured in milliseconds
protected  boolean isEqual(Object obj1, Object obj2)
          Helper method for comparing two objects for equality
 void setArtifactFactory(IArtifactFactory artifactFactory)
          Set the IArtifactFactory 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 provider
 void setBasicAuthValidatorClassName(String basicAuthValidatorClassName)
          Set the class name of the registered basic authenticator registered
 void setCacheTimeout(long cacheTimeout)
          Set the time-to-live for web service results cache entries
 void setInitialCacheSize(int initialCacheSize)
          Set the initial size of the web service results cache
 void setSamlSecurityEndpoint(String samlSecurityEndpoint)
          Set the endpoint URL used for validating received SAML artifacts.
 void setSocketTimeout(int socketTimeout)
          Set the timeout for web service requests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CACHE_SIZE

public static final int DEFAULT_CACHE_SIZE
Default cache size (1000) for the IWSCacheManager

See Also:
Constant Field Values

DEFAULT_CACHE_TIMEOUT

public static final long DEFAULT_CACHE_TIMEOUT
Default timeout (10 mins) for the IWSCacheManager

See Also:
Constant Field Values

DEFAULT_SOCKET_TIMEOUT

public static final int DEFAULT_SOCKET_TIMEOUT
Default timeout (1 min) for socket connections

See Also:
Constant Field Values

DEFAULT_AUTH_CREDENTIALS

public static final AuthCredentials DEFAULT_AUTH_CREDENTIALS
Default empty credentials for authenticating against the web service provider


DEFAULT_BASIC_AUTH_VALIDATOR_CLASS_NAME

public static final String DEFAULT_BASIC_AUTH_VALIDATOR_CLASS_NAME
Default class name for handling basic authentication

See Also:
Constant Field Values
Constructor Detail

WSClientConfig

public WSClientConfig()
Default constructor, uses default values for all configuration options


WSClientConfig

public WSClientConfig(AuthCredentials authCredentials)
Create a new WSClientConfig instance with the specified web service authentication credentials. Default values are used for all other configuration options.

Parameters:
authCredentials - the AuthCredentials to use when authenticating with the web service provider.

WSClientConfig

public 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. Default values are used for all other configuration options.

Parameters:
authCredentials - the AuthCredentials to use when authenticating with the web service provider.
initialCacheSize - initial size of the web service results cache
cacheTimeout - time-to-live for web service result cache entries before then become stale and thrown away

WSClientConfig

public 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. Default values are used for all other configuration options.

Parameters:
authCredentials - the AuthCredentials to use when authenticating with the web service provider.
artifactFactory - implementation of IArtifactFactory 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 - the AuthCredentials to use when authenticating with the web service provider.
artifactFactory - implementation of IArtifactFactory to generate SAML artifacts when authenticating web service requests with the SAML or Hybrid authentication method.
initialCacheSize - initial size of the web service results cache
cacheTimeout - time-to-live for web service result cache entries before then become stale and thrown away
Method Detail

getAuthCredentials

public AuthCredentials getAuthCredentials()
Get the AuthCredentials object used when authenticating with the web service provider

Returns:
the current AuthCredentials object

setAuthCredentials

public void setAuthCredentials(AuthCredentials authCredentials)
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

public String 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

public void setSamlSecurityEndpoint(String samlSecurityEndpoint)
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

public IArtifactFactory getArtifactFactory()
Get the IArtifactFactory 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

public void setArtifactFactory(IArtifactFactory artifactFactory)
Set the IArtifactFactory implementation registered with WSClient for generating SAML artifacts for outgoing web service requests with the SAML or HYBRID authentication methods.

Parameters:
artifactFactory - an implementation of IArtifactFactory to use

getBasicAuthValidatorClassName

public String getBasicAuthValidatorClassName()
Get the class name of the registered basic authenticator registered with this instance of WSClient

Returns:
the name of the authenticator class

setBasicAuthValidatorClassName

public void setBasicAuthValidatorClassName(String basicAuthValidatorClassName)
Set the class name of the registered basic authenticator registered

Parameters:
basicAuthValidatorClassName - the name of the authenticator class

equals

public boolean equals(WSClientConfig otherConfig)
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

protected boolean isEqual(Object obj1,
                          Object obj2)
Helper method for comparing two objects for equality

Returns:
true if they are equal