|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.wsclient.WSClient
public class WSClient
WSClient is the singleton where you perform the following:
1) Initialize the Library and set any custom params
2) Register custom IWSProxyFactories
3) Register your logging / error callback implementations
3) Obtain the runtime interfaces to your target webservices
Typical usage might be where the cache is used, sessions are reused, and the system user is used
Field Summary | |
---|---|
static Logger |
logger
|
static String |
WSCLIENT_MOD
Module name of WSClient for logging purposes |
Method Summary | |
---|---|
void |
_addFailedAuthCallback(IFailedAuthCallback callbackObj)
Add a callback listener to be invoked when an auth failure occurs |
protected IWSCacheManager |
_getCacheManager()
Internal instance method. |
protected WSClientConfig |
_getClientConfig()
Get the current client configuration object |
protected IWSProxyFactory |
_getFactory(Class clazz,
String clientID)
Internal instance method. |
protected IWSClientSessionManager |
_getSessionManager()
Internal instance method. |
void |
_registerFactory(Class clazz,
String clientID,
IWSProxyFactory proxyFactory)
Internal instance method. |
void |
_removeFailedAuthCallback(IFailedAuthCallback callbackObj)
Remove a previously registered auth failure callback listener |
protected void |
_unRegisterFactory(Class clazz,
String clientID)
Internal instance method. |
static void |
addFailedAuthCallback(IFailedAuthCallback callbackObj)
Helper static method to add failed auth callback listeners |
static void |
addLogListener(ILogListener listener)
Convenience method to add a logging listener to the WSClient Logging events within the WSClient are fired to the log listeners as events. |
static void |
flushAllCache()
Flush all WsClient caches for all interfaces |
static IWSCacheManager |
getCacheManager()
Get a reference to the Cache Manager object. |
static WSClientConfig |
getClientConfig()
Helper static method to retrieve the WSClientConfig configuration object |
static IWSProxyFactory |
getFactory(Class clazz)
Returns the appropriate IWSProxyFactory for this
interface class, or the default implementation |
static IWSProxyFactory |
getFactory(Class clazz,
String clientID)
Returns the appropriate IWSProxyFactory for this
interface class and client ID, or the default implementation |
protected static String |
getFactoryMapKey(Class clazz,
String clientID)
|
static List |
getFailedAuthListeners()
Get the list of registered Auth failure callback objects |
static Object |
getProxy(Class clazz,
String wsdlURL,
String endPointURL)
A convenience method that first obtains the default IWSProxyFactory and
and returns an instance of a IWSClientProxy |
static Object |
getProxy(Class clazz,
String wsdlURL,
String[] mapURLs,
String endPointURL)
A convenience method that first obtains the default IWSProxyFactory and
and returns an instance of a IWSClientProxy |
static Object |
getProxy(Class clazz,
String wsdlURL,
String[] mapURLs,
String endPointURL,
boolean useCache,
boolean reuseSession)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy and allows the enable/disable
of result caching and session re-use |
static Object |
getProxy(Class clazz,
String wsdlURL,
String[] mapURLs,
String endPointURL,
boolean useCache,
boolean reuseSession,
AuthCredentials authCredentials)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy , allows the enable/disable
of result caching and session re-use, as well as supplying credentials that override those of the
proxy factory. |
static Object |
getProxy(Class clazz,
String wsdlURL,
String[] mapURLs,
String endPointURL,
boolean useCache,
boolean reuseSession,
int socketTimeout,
AuthCredentials authCredentials)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy , allows the enable/disable
of result caching and session re-use, credentials that override those of the
proxy factory, and override the socket timeout of the web service request. |
static Object |
getProxy(Class clazz,
String wsdlURL,
String endPointURL,
boolean useCache)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy and allows the enable/disable
of result caching |
static Object |
getProxy(Class clazz,
String wsdlURL,
String endPointURL,
boolean useCache,
boolean reuseSession)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy and allows the enable/disable
of result caching and session re-use |
static Object |
getProxy(Class clazz,
String wsdlURL,
String endPointURL,
boolean useCache,
boolean reuseSession,
AuthCredentials authCredentials)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy , allows the enable/disable
of result caching and session re-use, as well as supplying credentials that override those of the
proxy factory. |
static Object |
getProxy(Class clazz,
String wsdlURL,
String endPointURL,
boolean useCache,
boolean reuseSession,
int socketTimeout,
AuthCredentials authCredentials)
A convenience method that first obtains the IWSProxyFactory and
and returns an instance of a IWSClientProxy , allows the enable/disable
of result caching and session re-use, credentials that override those of the
proxy factory, and override the socket timeout of the web service request. |
static IWSClientSessionManager |
getSessionManager()
Get a reference to the Session Manager object. |
static void |
init(WSClientConfig clientConfig)
Initialize the default WSClient instance with the supplied configuration |
protected static WSClient |
instance()
Get the default static instance of WSClient |
static boolean |
isInit()
Has the default instance of WSClient been initialized |
static void |
registerFactory(Class clazz,
IWSProxyFactory proxyFactory)
Registers a new IWSProxyFactory for the specified class |
static void |
registerFactory(Class clazz,
String clientID,
IWSProxyFactory proxyFactory)
Registers a new IWSProxyFactory for the specified class |
static void |
removeFailedAuthCallback(IFailedAuthCallback callbackObj)
Helper static method to remove failed auth callback listeners |
static void |
removeLogListener(ILogListener listener)
Convenience method to remove a logging listener to the WSClient Logging events within the WSClient are fired to the log listeners as events. |
static void |
shutdown()
|
static void |
unRegisterFactory(Class clazz)
Unregisters an IWSProxyFactory |
static void |
unRegisterFactory(Class clazz,
String clientID)
Unregisters an IWSProxyFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Logger logger
public static final String WSCLIENT_MOD
Method Detail |
---|
public static void init(WSClientConfig clientConfig)
clientConfig
- a WSClient configuration object containing options of this WSClient instancepublic static void shutdown()
public static boolean isInit()
public static Object getProxy(Class clazz, String wsdlURL, String endPointURL) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringendPointURL
- the web service endpoint URL as a string
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String)
public static Object getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringmapURLs
- an array of web service .map file URLsendPointURL
- the web service endpoint URL as a string
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String)
public static Object getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
and allows the enable/disable
of result caching
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service results
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String, boolean)
public static Object getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
and allows the enable/disable
of result caching and session re-use
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service resultsreuseSession
- true to enable reuse of sessions with the web service endpoint. False to create a new session on each web service invocation.
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean)
public static Object getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
and allows the enable/disable
of result caching and session re-use
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringmapURLs
- an array of web service .map file URLsendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service resultsreuseSession
- true to enable reuse of sessions with the web service endpoint. False to create a new session on each web service invocation.
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean)
public static Object getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
, allows the enable/disable
of result caching and session re-use, as well as supplying credentials that override those of the
proxy factory.
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service resultsreuseSession
- true to enable reuse of sessions with the web service endpoint. False to create a new session on each web service invocation.authCredentials
- credentials for authentication with the web servic provider. If null, the credentials set in the proxy factory will be used.
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean, AuthCredentials)
public static Object getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
, allows the enable/disable
of result caching and session re-use, as well as supplying credentials that override those of the
proxy factory.
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringmapURLs
- an array of web service .map file URLsendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service resultsreuseSession
- true to enable reuse of sessions with the web service endpoint. False to create a new session on each web service invocation.authCredentials
- credentials for authentication with the web service provider. If null, the credentials set in the proxy factory will be used.
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, AuthCredentials)
public static Object getProxy(Class clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
, allows the enable/disable
of result caching and session re-use, credentials that override those of the
proxy factory, and override the socket timeout of the web service request.
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service resultsreuseSession
- true to enable reuse of sessions with the web service endpoint. False to create a new session on each web service invocation.socketTimeout
- the timeout of the web service request (in seconds)authCredentials
- credentials for authentication with the web service provider. If null, the credentials set in the proxy factory will be used.
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String, boolean, boolean, int, AuthCredentials)
public static Object getProxy(Class clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials) throws WSClientException
IWSProxyFactory
and
and returns an instance of a IWSClientProxy
, allows the enable/disable
of result caching and session re-use, credentials that override those of the
proxy factory, and override the socket timeout of the web service request.
clazz
- the web service interface to proxy with WSClientwsdlURL
- the URL of the web service WSDL file as a stringmapURLs
- an array of web service .map file URLsendPointURL
- the web service endpoint URL as a stringuseCache
- true to enable caching of the web service resultsreuseSession
- true to enable reuse of sessions with the web service endpoint. False to create a new session on each web service invocation.socketTimeout
- the timeout of the web service request (in seconds)authCredentials
- credentials for authentication with the web service provider. If null, the credentials set in the proxy factory will be used.
IWSClientProxy
interface.
WSClientException
IWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, AuthCredentials)
protected static WSClient instance()
public static void registerFactory(Class clazz, IWSProxyFactory proxyFactory)
clazz
- the param used in calls to WSClient.getFactory(Class)
proxyFactory
- the custom implemenation of IWSProxyFactory
public static void registerFactory(Class clazz, String clientID, IWSProxyFactory proxyFactory)
clazz
- the param used in calls to WSClient.getFactory(Class)
clientID
- clientID - used to separate factories by client if desiredproxyFactory
- the custom implemenation of IWSProxyFactory
public void _registerFactory(Class clazz, String clientID, IWSProxyFactory proxyFactory)
clazz
- the param used in calls to WSClient.getFactory(Class)
clientID
- the param used to seperate factory caches by client (optionproxyFactory
- the custom implemenation of IWSProxyFactory
protected void _unRegisterFactory(Class clazz, String clientID)
IWSProxyFactory
clazz
- the param used in calls to WSClient.getFactory(Class)
public static void unRegisterFactory(Class clazz)
IWSProxyFactory
clazz
- public static void unRegisterFactory(Class clazz, String clientID)
IWSProxyFactory
clazz
- the interface class to unregisterclientID
- a client ID identifier to allow separate client cachesprotected IWSProxyFactory _getFactory(Class clazz, String clientID)
IWSProxyFactory
for this
interface class, or the default implementation
clazz
- The web service interface class to proxyclazz
- a string ID to separate proxy caches
public static IWSProxyFactory getFactory(Class clazz)
IWSProxyFactory
for this
interface class, or the default implementation
clazz
- The web service interface class to proxy
public static IWSProxyFactory getFactory(Class clazz, String clientID)
IWSProxyFactory
for this
interface class and client ID, or the default implementation
clazz
- The web service interface class to proxyclientID
- - a string identifier to allow separation of proxy factories by client
protected IWSClientSessionManager _getSessionManager()
IWSClientSessionManager
public static IWSClientSessionManager getSessionManager()
IWSClientSessionManager
protected IWSCacheManager _getCacheManager()
IWSCacheManager
public static IWSCacheManager getCacheManager()
IWSCacheManager
public static void addLogListener(ILogListener listener)
listener
- an instance of ILogListener
public static void removeLogListener(ILogListener listener)
listener
- the instance of ILogListener
to unregisterprotected WSClientConfig _getClientConfig()
public static WSClientConfig getClientConfig()
WSClientConfig
used to configure this instance of WSClientpublic static void addFailedAuthCallback(IFailedAuthCallback callbackObj)
callbackObj
- IFailedAuthCallback
instance to registerfor implementation details
public void _addFailedAuthCallback(IFailedAuthCallback callbackObj)
callbackObj
- IFailedAuthCallback
instance to registerfor implementation details
public static void removeFailedAuthCallback(IFailedAuthCallback callbackObj)
callbackObj
- IFailedAuthCallback
instance to unregisterfor implementation details
public void _removeFailedAuthCallback(IFailedAuthCallback callbackObj)
callbackObj
- IFailedAuthCallback
instance to unregisterpublic static List getFailedAuthListeners()
IFailedAuthCallback
implementations that have registered with this instance of WSClientpublic static void flushAllCache()
protected static String getFactoryMapKey(Class clazz, String clientID)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |