com.webmethods.caf.portalclient
Class PortalClientContext

java.lang.Object
  extended by com.webmethods.caf.portalclient.PortalClientContext
All Implemented Interfaces:
Serializable

public class PortalClientContext
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  AuthCredentials m_authCredentials
          The authentication credentials to connect to MWS with
protected  boolean m_enableInprocCheck
          Is the in-process check enabled for this context
protected  boolean m_inProc
          Is this context running within the same MWS process that the endpoint is referencing
protected  boolean m_isAuthenticated
          Is this context connected and authenticated with the target MWS
protected  String m_portalEndpoint
          The MWS endpoint this context will connect to
protected  String m_remoteVMID
          The VMID of the remote MWS process instance
 
Constructor Summary
PortalClientContext()
          Default constructor
PortalClientContext(String portalServerURL)
          Create a new instance for a MWS frontend URL
PortalClientContext(String portalServerURL, AuthCredentials authCred)
          Create a new instance for a MWS frontend URL
PortalClientContext(String portalServerURL, AuthCredentials authCred, boolean enableInprocCheck)
          Create a new client context instance for a MWS frontend URL
 
Method Summary
protected  void checkRemoteVMID()
          Determine if the serviceEndpoint Portal is the same Portal we're running in.
 AuthCredentials getAuthCredentials()
          Get the AuthCredentials object used to authenticate the MWS session
protected  String getEndpoint(String serviceEndpoint)
          Construct a MWS service endpoint.
 IaccessPortType getIaccessPortType(AuthCredentials authCredentials)
          Get the IaccessPortType interface for invoking access control services using this client context
 IaliasPortType getIaliasPortType(AuthCredentials authCredentials)
          Get the IaliasPortType interface for invoking MWS alias services using this client context
 IbasicPortType getIbasicPortType(AuthCredentials authCredentials)
          Get the getIbasicPortType interface for invoking basic services using this client context
 IdirectoryServicePortType getIdirectoryServicePortType(AuthCredentials authCredentials)
          Get the IdirectoryServicePortType interface for invoking directory web services using this client context
 IdirectorySystemPortType getIdirectorySystemPortType(AuthCredentials authCredentials)
          Get the IdirectorySystemPortType interface for invoking directory web services using this client context.
 IprincipalAttributePortType getIprincipalAttributePortType(AuthCredentials authCredentials)
          Get the IprincipalAttributePortType interface for invoking directory principal attributes services using this client context
 IprincipalPortType getIprincipalPortType(AuthCredentials authCredentials)
          Get the IprincipalPortType interface for invoking directory principal services using this client context
 IsystemPortType getIsystemPortType(AuthCredentials authCredentials)
          Get the IsystemPortType interface for invoking MWS system services using this client context
 ItaskPortType getItaskPortType(AuthCredentials authCredentials)
          Get the ItaskPortType interface for invoking MWS task services using this client context
 IuserPortType getIuserPortType(AuthCredentials authCredentials)
          Get the getIuserPortType interface for invoking user services using this client context
 String getPortalServerURL()
          Get the MWS server endpoint URL for this client context
 IWSClientProxy getPortType(AuthCredentials authCredentials, Class clazz, boolean useCache)
          Factory function to simplify getting references to the various port types exposed by the portalclient API
protected  String getRemoteVMID()
          Get the VMID of the MWS process we are connecting to
 boolean isAuthenticated()
          Is this client context successfully connected and authenticated with MWS
 boolean isInProc()
          Is this PortalClientContext running in the same process as the endpoint it is connected to?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_portalEndpoint

protected String m_portalEndpoint
The MWS endpoint this context will connect to


m_authCredentials

protected AuthCredentials m_authCredentials
The authentication credentials to connect to MWS with


m_inProc

protected boolean m_inProc
Is this context running within the same MWS process that the endpoint is referencing


m_isAuthenticated

protected boolean m_isAuthenticated
Is this context connected and authenticated with the target MWS


m_remoteVMID

protected String m_remoteVMID
The VMID of the remote MWS process instance


m_enableInprocCheck

protected boolean m_enableInprocCheck
Is the in-process check enabled for this context

Constructor Detail

PortalClientContext

public PortalClientContext()
Default constructor


PortalClientContext

public PortalClientContext(String portalServerURL)
Create a new instance for a MWS frontend URL

Parameters:
portalServerURL - the MWS frontend URL (e.g. http://localhost:8585)

PortalClientContext

public PortalClientContext(String portalServerURL,
                           AuthCredentials authCred)
Create a new instance for a MWS frontend URL

Parameters:
portalServerURL - the MWS frontend URL (e.g. http://localhost:8585)
authCred - the MWS authentication credentials

PortalClientContext

public PortalClientContext(String portalServerURL,
                           AuthCredentials authCred,
                           boolean enableInprocCheck)
Create a new client context instance for a MWS frontend URL

Parameters:
portalServerURL - the MWS frontend URL (e.g. http://localhost:8585)
authCred - the MWS authentication credentials
enableInprocCheck - true to enable check that PortalClient is not running with the target MWS runtime
Method Detail

getPortalServerURL

public String getPortalServerURL()
Get the MWS server endpoint URL for this client context

Returns:
the MWS server endpoint URL as a string

getAuthCredentials

public AuthCredentials getAuthCredentials()
Get the AuthCredentials object used to authenticate the MWS session

Returns:
the AuthCredentials used to authenticate the MWS session

isInProc

public boolean isInProc()
Is this PortalClientContext running in the same process as the endpoint it is connected to?

Returns:
true if running in the same MWS runtime as the endpoint, otherwise false

isAuthenticated

public boolean isAuthenticated()
Is this client context successfully connected and authenticated with MWS

Returns:

getPortType

public IWSClientProxy getPortType(AuthCredentials authCredentials,
                                  Class clazz,
                                  boolean useCache)
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
useCache - enable caching of web service results
Returns:
A IWSClientProxy that proxies the web service interface class

getEndpoint

protected String getEndpoint(String serviceEndpoint)
Construct a MWS service endpoint. This prepends the provided service endpoint with the MWS frontend URL this context is connected with.

Parameters:
serviceEndpoint - the relative web service endpoint path
Returns:
return the fully qualified web service endpoint

getIdirectorySystemPortType

public IdirectorySystemPortType getIdirectorySystemPortType(AuthCredentials authCredentials)
                                                     throws WSClientException
Get the IdirectorySystemPortType interface for invoking directory web services using this client context.

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

getIdirectoryServicePortType

public IdirectoryServicePortType getIdirectoryServicePortType(AuthCredentials authCredentials)
                                                       throws WSClientException
Get the IdirectoryServicePortType interface for invoking directory web services using this client context

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

getIprincipalPortType

public IprincipalPortType getIprincipalPortType(AuthCredentials authCredentials)
                                         throws WSClientException
Get the IprincipalPortType interface for invoking directory principal services using this client context

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

getIprincipalAttributePortType

public IprincipalAttributePortType getIprincipalAttributePortType(AuthCredentials authCredentials)
                                                           throws WSClientException
Get the IprincipalAttributePortType interface for invoking directory principal attributes services using this client context

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

getIuserPortType

public IuserPortType getIuserPortType(AuthCredentials authCredentials)
                               throws WSClientException
Get the getIuserPortType interface for invoking user services using this client context

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

getIaccessPortType

public IaccessPortType getIaccessPortType(AuthCredentials authCredentials)
                                   throws WSClientException
Get the IaccessPortType interface for invoking access control services using this client context

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

getIbasicPortType

public IbasicPortType getIbasicPortType(AuthCredentials authCredentials)
                                 throws WSClientException
Get the getIbasicPortType interface for invoking basic services using this client context

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

getItaskPortType

public ItaskPortType getItaskPortType(AuthCredentials authCredentials)
                               throws WSClientException
Get the ItaskPortType interface for invoking MWS task services using this client context

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

getIaliasPortType

public IaliasPortType getIaliasPortType(AuthCredentials authCredentials)
                                 throws WSClientException
Get the IaliasPortType interface for invoking MWS alias services using this client context

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

getIsystemPortType

public IsystemPortType getIsystemPortType(AuthCredentials authCredentials)
                                   throws WSClientException
Get the IsystemPortType interface for invoking MWS system services using this client context

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

getRemoteVMID

protected String getRemoteVMID()
Get the VMID of the MWS process we are connecting to

Returns:
the VMID of the remote process as a string

checkRemoteVMID

protected void checkRemoteVMID()
Determine if the serviceEndpoint Portal is the same Portal we're running in. This method sets the internal m_inProc field value