com.webmethods.caf.wsclient.proxy.impl
Class WSProxyFactory

java.lang.Object
  extended by com.webmethods.caf.wsclient.proxy.impl.WSProxyFactory
All Implemented Interfaces:
IWSProxyFactory

public class WSProxyFactory
extends Object
implements IWSProxyFactory

Default implementation of IWSProxyFactory


Constructor Summary
WSProxyFactory(WSClientConfig clientConfig)
          Default constructor that creates a new WSProxyFactory with the specified configuration object
 
Method Summary
 int getCacheCapacity()
          Hint for the IWSCacheManager
 long getCacheTimeout()
          Hint for the IWSCacheManager Get the time-to-live of cached web service results.
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String endPointURL)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials)
          This will obtain a Proxy that can be used for invoking the target webService
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials)
           
 IWSClientProxy getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials)
          This will obtain a Proxy that can be used for invoking the target webService
 int getSocketTimeout()
          Get the default socket timeout.
 void setCacheCapacity(int capacity)
          Hint for the IWSCacheManager Set the initial capacity of the web service results cache
 void setCacheTimeout(long ms)
          Hint for the IWSCacheManager Sets the time-to-live for items in the web service results cache
 void setSocketTimeout(int socketTimeout)
          Set the default socket timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSProxyFactory

public WSProxyFactory(WSClientConfig clientConfig)
Default constructor that creates a new WSProxyFactory with the specified configuration object

Parameters:
clientConfig - WSClientConfig object containing WSClient configuration options
Method Detail

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String endPointURL)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String[] mapURLs,
                               String endPointURL)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String endPointURL,
                               boolean useCache)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String[] mapURLs,
                               String endPointURL,
                               boolean useCache)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String endPointURL,
                               boolean useCache,
                               boolean reuseSession)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String[] mapURLs,
                               String endPointURL,
                               boolean useCache,
                               boolean reuseSession)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String endPointURL,
                               boolean useCache,
                               boolean reuseSession,
                               AuthCredentials authCredentials)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String[] mapURLs,
                               String endPointURL,
                               boolean useCache,
                               boolean reuseSession,
                               AuthCredentials authCredentials)
                        throws WSClientException
Specified by:
getProxy in interface IWSProxyFactory
Throws:
WSClientException
See Also:
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, com.webmethods.caf.wsclient.AuthCredentials)

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String endPointURL,
                               boolean useCache,
                               boolean reuseSession,
                               int socketTimeout,
                               AuthCredentials authCredentials)
                        throws WSClientException
Description copied from interface: IWSProxyFactory
This will obtain a Proxy that can be used for invoking the target webService

Specified by:
getProxy in interface IWSProxyFactory
Parameters:
clazz - the interface of the target webService
wsdlURL - the location of the WSDL describing the webService
endPointURL - the endpoint URL of the webService
useCache - whether to use results from the cache if present
reuseSession - if a previous session is available for the specified user, whether to reuse it
socketTimeout - timeout for socket connections (in ms)
authCredentials - to connect to with null for Default System User
Returns:
any results from the invocation
Throws:
WSClientException - Note, if you aren't reusing a session, then the cache won't be available IMyWebService myWebService = (IMyWebService)WSClient.getProxy(IMyWebService.class, wsdlURL, endPointURL); Object results = myWebService.runWebService(myParams);

getProxy

public IWSClientProxy getProxy(Class clazz,
                               String wsdlURL,
                               String[] mapURLs,
                               String endPointURL,
                               boolean useCache,
                               boolean reuseSession,
                               int socketTimeout,
                               AuthCredentials authCredentials)
                        throws WSClientException
Description copied from interface: IWSProxyFactory
This will obtain a Proxy that can be used for invoking the target webService

Specified by:
getProxy in interface IWSProxyFactory
Parameters:
clazz - the interface of the target webService
wsdlURL - the location of the wsdl describing the webService
mapURLs - String array of URLs describing the location of any associated map files
endPointURL - the endpoint of the webService
useCache - whether to use results from the cache if present
reuseSession - if a previous session is available for the specified user, whether to reuse it
socketTimeout - timeout for socket connections (in ms)
authCredentials - to connect to with null for Default System User
Returns:
any results from the invocation
Throws:
WSClientException - Note, if you aren't reusing a session, then the cache won't be available Note, if the wsdl or map URLs specify the custom protocol 'classpath:', the file will be extracted from the classpath and stored as a local file in a temp subdirectory. IMyWebService myWebService = (IMyWebService)WSClient.getProxy(IMyWebService.class, wsdlURL, endPointURL); Object results = myWebService.runWebService(myParams);

getSocketTimeout

public int getSocketTimeout()
Description copied from interface: IWSProxyFactory
Get the default socket timeout. This is the number of milliseconds the web service request will wait before it gives up waiting for a response from the web service provider. This value is set on the IWSClientProxy created by IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, AuthCredentials)

Specified by:
getSocketTimeout in interface IWSProxyFactory
Returns:
the socket timeout value in milliseconds

setSocketTimeout

public void setSocketTimeout(int socketTimeout)
Description copied from interface: IWSProxyFactory
Set the default socket timeout. This is the number of milliseconds the web service request will wait before it gives up waiting for a response from the web service provider. This value is set on the IWSClientProxy created by IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, AuthCredentials)

Specified by:
setSocketTimeout in interface IWSProxyFactory

setCacheTimeout

public void setCacheTimeout(long ms)
Description copied from interface: IWSProxyFactory
Hint for the IWSCacheManager Sets the time-to-live for items in the web service results cache

Specified by:
setCacheTimeout in interface IWSProxyFactory

getCacheTimeout

public long getCacheTimeout()
Description copied from interface: IWSProxyFactory
Hint for the IWSCacheManager Get the time-to-live of cached web service results. If caching is enabled, any cache entries older than this timeout value are considered stale.

Specified by:
getCacheTimeout in interface IWSProxyFactory
Returns:
the cache entry time-to-live, measured in milliseconds

getCacheCapacity

public int getCacheCapacity()
Description copied from interface: IWSProxyFactory
Hint for the IWSCacheManager

Specified by:
getCacheCapacity in interface IWSProxyFactory
Returns:
get the current maximum capacity of the web service results cache

setCacheCapacity

public void setCacheCapacity(int capacity)
Description copied from interface: IWSProxyFactory
Hint for the IWSCacheManager Set the initial capacity of the web service results cache

Specified by:
setCacheCapacity in interface IWSProxyFactory