com.webmethods.caf.portalclient
Class PortalClient

java.lang.Object
  extended by com.webmethods.caf.portalclient.PortalClient

public class PortalClient
extends Object

The singleton factory that creates PortalClientContext connections to invoke web services against a specific MWS. It also maintains a default PortletClientContext singleton and a set of static methods to facilitate web service calls with that session. Before use, either call initialize() to configure the default single instance of PortlClientContext or retrieve a new PortalClientContext via getClientContext().


Field Summary
static String PORTAL_CLIENT_MOD
          Logging module for this component
 
Constructor Summary
PortalClient()
           
 
Method Summary
static void addFailedAuthCallback(IFailedAuthCallback callbackObj)
          Convenience method to add a IFailedAuthCallback handler to the WSClient used by PortalClient
static void addLogListener(ILogListener listener)
          Convenience method to add a logging listener to the WSClient used by PortalClient Logging events within the WSClient are fired to the log listeners as events.
static URI createAlias(String alias)
          Static helper to create a new URI that represents an MWS alias
static PortalClientContext getClientContext(String portalServerURL, AuthCredentials authCred)
          Get an initialize a PortalClientContext used to invoke MWS runtime services
static PortalClientContext getClientContext(String portalServerURL, AuthCredentials authCred, boolean doInprocCheck)
          Get an initialize a PortalClientContext used to invoke MWS runtime services
static IaccessPortType getIaccessPortType(AuthCredentials authCredentials)
          Get the IaccessPortType interface for invoking access web services using the default PortalClientContext
static Ialias2PortType getIalias2PortType(AuthCredentials authCredentials)
          Get the Ialias2PortType interface for invoking the extended MWS alias web services using the default PortalClientContext
static IaliasPortType getIaliasPortType(AuthCredentials authCredentials)
          Get the IaliasPortType interface for invoking MWS alias web services using the default PortalClientContext
static IbasicPortType getIbasicPortType(AuthCredentials authCredentials)
          Get the IbasicPortType interface for invoking core MWS web services using the default PortalClientContext
static IdirectoryServicePortType getIdirectoryServicePortType(AuthCredentials authCredentials)
          Get the IdirectoryServicePortType interface for invoking directory web services using the default PortalClientContext
static IdirectorySystemPortType getIdirectorySystemPortType(AuthCredentials authCredentials)
          Get the idirectorySystemPortType interface for invoking MWS system web services using the default PortalClientContext
static IfolderPortType getIfolderPortType(AuthCredentials authCredentials)
          Get the IfolderPortType interface for invoking folder web services using the default PortalClientContext
static IprincipalAttributePortType getIprincipalAttributePortType(AuthCredentials authCredentials)
          Get the IprincipalAttributePortType interface for invoking principal attribute web services using the default PortalClientContext
static IprincipalPortType getIprincipalPortType(AuthCredentials authCredentials)
          Get the IprincipalPortType interface for invoking principal web services using the default PortalClientContext
static IsystemPortType getIsystemPortType(AuthCredentials authCredentials)
          Get the IsystemPortType interface for invoking the MWS system web services using the default PortalClientContext
static ItaskPortType getItaskPortType(AuthCredentials authCredentials)
          Get the ItaskPortType interface for invoking task web services using the default PortalClientContext
static IuserPortType getIuserPortType(AuthCredentials authCredentials)
          Get the IuserPortType interface for invoking user web services using the default PortalClientContext
static Map getPortalClientMap()
          Retrieve a map of web service interfaces and their corresponding MWS bizpolicies NOTE this is exposed for testing purposes and is not indended to be used externally
static IWSClientProxy getPortType(AuthCredentials authCredentials, Class clazz)
          Factory function to simplify getting references to the various port types exposed by the portalclient API
static void initialize(String portalServerURL)
          Initialize the default PortalClientContext with the URL of the MWS server to call
static void initialize(String portalServerURL, AuthCredentials authCred)
          Initialize the default PortalClientContext with the frontend URL of the MWS server to invoke and the login credentials to authenticate with
static void initialize(String portalServerURL, AuthCredentials authCred, boolean doInprocCheck)
          Initialize the default PortalClientContext with the frontend URL of the MWS server to invoke, the login credentials use to authenticate, and whether to bypass the optimization check if the PortalClient instance is running within the MWS runtime
static boolean isInitialized()
          Determine if the default PortalClientContext has been initialized
static void removeFailedAuthCallback(IFailedAuthCallback callbackObj)
          Convenience method to remove a IFailedAuthCallback handler to the WSClient used by PortalClient
static void removeLogListener(ILogListener listener)
          Convenience method to remove a logging listener to the WSClient used by PortalClient Logging events within the WSClient are fired to the log listeners as events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORTAL_CLIENT_MOD

public static final String PORTAL_CLIENT_MOD
Logging module for this component

Constructor Detail

PortalClient

public PortalClient()
Method Detail

initialize

public static void initialize(String portalServerURL)
Initialize the default PortalClientContext with the URL of the MWS server to call

Parameters:
portalServerURL - the fully qualified URL of the MWS runtime (e.g. http://localhost:8585)

initialize

public static void initialize(String portalServerURL,
                              AuthCredentials authCred)
Initialize the default PortalClientContext with the frontend URL of the MWS server to invoke and the login credentials to authenticate with

Parameters:
portalServerURL - the fully qualified URL of the MWS runtime (e.g. http://localhost:8585)
authCred - the AuthCredentials to authenticate to MWS with

initialize

public static void initialize(String portalServerURL,
                              AuthCredentials authCred,
                              boolean doInprocCheck)
Initialize the default PortalClientContext with the frontend URL of the MWS server to invoke, the login credentials use to authenticate, and whether to bypass the optimization check if the PortalClient instance is running within the MWS runtime

Parameters:
portalServerURL - the fully qualified URL of the MWS runtime (e.g. http://localhost:8585)
authCred - the AuthCredentials to authenticate to MWS with
doInprocCheck - true to check if running within the target MWS runtime process and run in optimized "in-proc" mode

isInitialized

public static boolean isInitialized()
Determine if the default PortalClientContext has been initialized

Returns:
true if initialized, otherwise false

getClientContext

public static PortalClientContext getClientContext(String portalServerURL,
                                                   AuthCredentials authCred)
Get an initialize a PortalClientContext used to invoke MWS runtime services

Parameters:
portalServerURL - the fully qualified URL of the MWS runtime (e.g. http://localhost:8585)
authCred - the AuthCredentials to authenticate to MWS with
Returns:
an initialized PortalClientContext

getClientContext

public static PortalClientContext getClientContext(String portalServerURL,
                                                   AuthCredentials authCred,
                                                   boolean doInprocCheck)
Get an initialize a PortalClientContext used to invoke MWS runtime services

Parameters:
portalServerURL - the fully qualified URL of the MWS runtime (e.g. http://localhost:8585)
authCred - the AuthCredentials to authenticate to MWS with
doInprocCheck - true to check if running within the target MWS runtime process and run in optimized "in-proc" mode
Returns:
an initialized PortalClientContext

createAlias

public static URI createAlias(String alias)
Static helper to create a new URI that represents an MWS alias

Parameters:
alias - the alias to create a URI for
Returns:
a URI referencing the alias

getIdirectorySystemPortType

public static IdirectorySystemPortType getIdirectorySystemPortType(AuthCredentials authCredentials)
                                                            throws WSClientException
Get the idirectorySystemPortType interface for invoking MWS system web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIdirectoryServicePortType

public static IdirectoryServicePortType getIdirectoryServicePortType(AuthCredentials authCredentials)
                                                              throws WSClientException
Get the IdirectoryServicePortType interface for invoking directory web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIprincipalPortType

public static IprincipalPortType getIprincipalPortType(AuthCredentials authCredentials)
                                                throws WSClientException
Get the IprincipalPortType interface for invoking principal web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIprincipalAttributePortType

public static IprincipalAttributePortType getIprincipalAttributePortType(AuthCredentials authCredentials)
                                                                  throws WSClientException
Get the IprincipalAttributePortType interface for invoking principal attribute web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIuserPortType

public static IuserPortType getIuserPortType(AuthCredentials authCredentials)
                                      throws WSClientException
Get the IuserPortType interface for invoking user web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIaccessPortType

public static IaccessPortType getIaccessPortType(AuthCredentials authCredentials)
                                          throws WSClientException
Get the IaccessPortType interface for invoking access web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIbasicPortType

public static IbasicPortType getIbasicPortType(AuthCredentials authCredentials)
                                        throws WSClientException
Get the IbasicPortType interface for invoking core MWS web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getItaskPortType

public static ItaskPortType getItaskPortType(AuthCredentials authCredentials)
                                      throws WSClientException
Get the ItaskPortType interface for invoking task web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIfolderPortType

public static IfolderPortType getIfolderPortType(AuthCredentials authCredentials)
                                          throws WSClientException
Get the IfolderPortType interface for invoking folder web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIaliasPortType

public static IaliasPortType getIaliasPortType(AuthCredentials authCredentials)
                                        throws WSClientException
Get the IaliasPortType interface for invoking MWS alias web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIalias2PortType

public static Ialias2PortType getIalias2PortType(AuthCredentials authCredentials)
                                          throws WSClientException
Get the Ialias2PortType interface for invoking the extended MWS alias web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getIsystemPortType

public static IsystemPortType getIsystemPortType(AuthCredentials authCredentials)
                                          throws WSClientException
Get the IsystemPortType interface for invoking the MWS system web services using the default PortalClientContext

Parameters:
authCredentials - the credentials to authenticate against MWS with, may be null
Returns:
the web service port type
Throws:
WSClientException

getPortalClientMap

public static Map getPortalClientMap()
Retrieve a map of web service interfaces and their corresponding MWS bizpolicies NOTE this is exposed for testing purposes and is not indended to be used externally


getPortType

public static IWSClientProxy getPortType(AuthCredentials authCredentials,
                                         Class clazz)
Factory function to simplify getting references to the various port types exposed by the portalclient API

Parameters:
authCredentials - the authentication credentials to connect to MWS with
clazz - the web service interface class to proxy
Returns:
A IWSClientProxy that proxies the web service interface class

addLogListener

public static void addLogListener(ILogListener listener)
Convenience method to add a logging listener to the WSClient used by PortalClient Logging events within the WSClient are fired to the log listeners as events.

Parameters:
listener - the ILogListener implementation to add

removeLogListener

public static void removeLogListener(ILogListener listener)
Convenience method to remove a logging listener to the WSClient used by PortalClient Logging events within the WSClient are fired to the log listeners as events.

Parameters:
listener - the ILogListener implementation to remove

addFailedAuthCallback

public static void addFailedAuthCallback(IFailedAuthCallback callbackObj)
Convenience method to add a IFailedAuthCallback handler to the WSClient used by PortalClient

Parameters:
callbackObj - the IFailedAuthCallback implementation to add

removeFailedAuthCallback

public static void removeFailedAuthCallback(IFailedAuthCallback callbackObj)
Convenience method to remove a IFailedAuthCallback handler to the WSClient used by PortalClient

Parameters:
callbackObj - the IFailedAuthCallback implementation to remove