Class WSClientConfig

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

public class WSClientConfig extends Object
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 Details

    • DEFAULT_CACHE_SIZE

      public static final int DEFAULT_CACHE_SIZE
      Default cache size (1000) for the IWSCacheManager
      See Also:
    • DEFAULT_CACHE_TIMEOUT

      public static final long DEFAULT_CACHE_TIMEOUT
      Default timeout (10 mins) for the IWSCacheManager
      See Also:
    • DEFAULT_SOCKET_TIMEOUT

      public static final int DEFAULT_SOCKET_TIMEOUT
      Default timeout (1 min) for socket connections
      See Also:
    • 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:
  • Constructor Details

    • 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 Details

    • 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