Package com.webmethods.caf.portalclient
Class PortalClient
java.lang.Object
com.webmethods.caf.portalclient.PortalClient
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
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static PortalClientContext
protected static boolean
protected static boolean
static final String
Logging module for this component -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addFailedAuthCallback
(IFailedAuthCallback callbackObj) Convenience method to add a IFailedAuthCallback handler to the WSClient used by PortalClientstatic 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 aliasstatic PortalClientContext
getClientContext
(String portalServerURL, AuthCredentials authCred) Get an initialize a PortalClientContext used to invoke MWS runtime servicesstatic PortalClientContext
getClientContext
(String portalServerURL, AuthCredentials authCred, boolean doInprocCheck) Get an initialize a PortalClientContext used to invoke MWS runtime servicesprotected static PortalClientContext
static IaccessPortType
getIaccessPortType
(AuthCredentials authCredentials) Get the IaccessPortType interface for invoking access web services using the default PortalClientContextstatic Ialias2PortType
getIalias2PortType
(AuthCredentials authCredentials) Get the Ialias2PortType interface for invoking the extended MWS alias web services using the default PortalClientContextstatic IaliasPortType
getIaliasPortType
(AuthCredentials authCredentials) Get the IaliasPortType interface for invoking MWS alias web services using the default PortalClientContextstatic IbasicPortType
getIbasicPortType
(AuthCredentials authCredentials) Get the IbasicPortType interface for invoking core MWS web services using the default PortalClientContextstatic IdirectoryServicePortType
getIdirectoryServicePortType
(AuthCredentials authCredentials) Get the IdirectoryServicePortType interface for invoking directory web services using the default PortalClientContextstatic IdirectorySystemPortType
getIdirectorySystemPortType
(AuthCredentials authCredentials) Get the idirectorySystemPortType interface for invoking MWS system web services using the default PortalClientContextstatic IfolderPortType
getIfolderPortType
(AuthCredentials authCredentials) Get the IfolderPortType interface for invoking folder web services using the default PortalClientContextstatic IprincipalAttributePortType
getIprincipalAttributePortType
(AuthCredentials authCredentials) Get the IprincipalAttributePortType interface for invoking principal attribute web services using the default PortalClientContextstatic IprincipalPortType
getIprincipalPortType
(AuthCredentials authCredentials) Get the IprincipalPortType interface for invoking principal web services using the default PortalClientContextstatic IsystemPortType
getIsystemPortType
(AuthCredentials authCredentials) Get the IsystemPortType interface for invoking the MWS system web services using the default PortalClientContextstatic ItaskPortType
getItaskPortType
(AuthCredentials authCredentials) Get the ItaskPortType interface for invoking task web services using the default PortalClientContextstatic ItaskPortTypeEx
getItaskPortTypeEx
(AuthCredentials authCredentials) Get the IfolderPortTypeExstatic IuserPortType
getIuserPortType
(AuthCredentials authCredentials) Get the IuserPortType interface for invoking user web services using the default PortalClientContextRetrieve 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 externallystatic IWSClientProxy
getPortType
(AuthCredentials authCredentials, Class<?> clazz) Factory function to simplify getting references to the various port types exposed by the portalclient APIprotected static void
Initialize the map of web service interfaces and their bizpolicy namesstatic void
initialize
(String portalServerURL) Initialize the default PortalClientContext with the URL of the MWS server to callstatic 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 withstatic 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 runtimestatic boolean
Determine if the default PortalClientContext has been initializedprotected static void
static void
removeFailedAuthCallback
(IFailedAuthCallback callbackObj) Convenience method to remove a IFailedAuthCallback handler to the WSClient used by PortalClientstatic 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.
-
Field Details
-
PORTAL_CLIENT_MOD
Logging module for this component -
INPROC_FACTORY_ID
- See Also:
-
m_portalClientMap
-
m_init
protected static boolean m_init -
m_defaultContext
-
m_inprocFactoriesRegistered
protected static boolean m_inprocFactoriesRegistered
-
-
Constructor Details
-
PortalClient
public PortalClient()
-
-
Method Details
-
initialize
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
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 withdoInprocCheck
- 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 withdoInprocCheck
- true to check if running within the target MWS runtime process and run in optimized "in-proc" mode- Returns:
- an initialized PortalClientContext
-
registerInProcFactories
protected static void registerInProcFactories() -
createAlias
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
-
getItaskPortTypeEx
public static ItaskPortTypeEx getItaskPortTypeEx(AuthCredentials authCredentials) throws WSClientException Get the IfolderPortTypeEx- Parameters:
authCredentials
- may be null- 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<Class<?>,com.webmethods.caf.portalclient.impl.PortalClientAPI> 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
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 withclazz
- the web service interface class to proxy- Returns:
- A IWSClientProxy that proxies the web service interface class
-
getDefaultClientContext
-
initClientMap
protected static void initClientMap()Initialize the map of web service interfaces and their bizpolicy names -
addLogListener
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
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
Convenience method to add a IFailedAuthCallback handler to the WSClient used by PortalClient- Parameters:
callbackObj
- the IFailedAuthCallback implementation to add
-
removeFailedAuthCallback
Convenience method to remove a IFailedAuthCallback handler to the WSClient used by PortalClient- Parameters:
callbackObj
- the IFailedAuthCallback implementation to remove
-