com.plumtree.remote.prc
Class RemoteSessionFactory

java.lang.Object
  extended bycom.plumtree.remote.prc.RemoteSessionFactory

public abstract class RemoteSessionFactory
extends java.lang.Object

Factory class for obtaining an IRemoteSession.

IRemoteSession is the only session object required by the PRC remote APIs. No separate Collaboration session or Content session is needed to access the Collaboration or Content Server remote APIs. To access Collaboration or Content Server APIs, obtain an IRemoteSession using the methods in this class, then obtain either an ICollaborationFactory or IContentFactory from the IRemoteSession Individual Collaboration managers or Content managers can be obtained using the corresponding methods in ICollaborationFactory or IContentFactory.

Portlets automatically receive the WS Portal (ptapi) SOAP endpoint URL from the portal and can use IPortletContext.getRemotePortalSession to create an IRemoteSession.

See Also:
IRemoteSession

Constructor Summary
RemoteSessionFactory()
           
 
Method Summary
static IRemoteSession getExplicitLoginContext(java.net.URL endpoint, java.lang.String username, java.lang.String password)
          Returns an IRemoteSession with the same security context in the portal as the specified user.
static IRemoteSession getExplicitLoginContext(java.net.URL endpoint, java.lang.String username, java.lang.String password, int sessionDurationInMinutes)
          Returns an IRemoteSession with the same security context in the portal as the specified user.
static IRemoteSession getRemotePortalSession(IPortletContext portletCtx)
          Returns an IRemoteSession using the PortletContext
static IRemoteSession getRemotePortalSession(IProxyContext proxyCtx)
          Returns an IRemoteSession using the ProxyContext
static IRemoteSession getTokenContext(java.net.URL endpoint, java.lang.String loginToken)
          Returns an IRemoteSession using the specified login token.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteSessionFactory

public RemoteSessionFactory()
Method Detail

getExplicitLoginContext

public static IRemoteSession getExplicitLoginContext(java.net.URL endpoint,
                                                     java.lang.String username,
                                                     java.lang.String password)
                                              throws java.net.MalformedURLException,
                                                     PortalException,
                                                     java.rmi.RemoteException
Returns an IRemoteSession with the same security context in the portal as the specified user. The session is valid for 10 minutes.

Parameters:
endpoint - the SOAP endpoint of the WS portal (ptapi). For example, a Java WS portal installation might use http://hostname:port/ptapi/services/QueryInterfaceAPI while a .NET WS portal might use http://hostname:port/ptapi/QueryInterfaceAPI.asmx. These endpoints will vary according to the deployment.
username - the username whose security context to use
password - the user's password
Returns:
an IRemoteSession object representing the current session with the portal
Throws:
java.net.MalformedURLException - if the endpoint URL is not valid
PortalException - if the operation resulted in an error on the portal
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call

getExplicitLoginContext

public static IRemoteSession getExplicitLoginContext(java.net.URL endpoint,
                                                     java.lang.String username,
                                                     java.lang.String password,
                                                     int sessionDurationInMinutes)
                                              throws java.net.MalformedURLException,
                                                     PortalException,
                                                     java.rmi.RemoteException
Returns an IRemoteSession with the same security context in the portal as the specified user.

Parameters:
endpoint - the SOAP endpoint
username - the username whose security context to use
password - the user's password
sessionDurationInMinutes - the number of minutes the session is valid; this value must be positive and can be no greater than one day (60 * 24)
Returns:
an IRemoteSession object representing the current session with the portal
Throws:
java.net.MalformedURLException - if the endpoint URL is not valid
java.lang.IllegalArgumentException - if sessionDurationInMinutes is less than one or greater than 60 * 24
PortalException - if the operation resulted in an error on the portal
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call

getTokenContext

public static IRemoteSession getTokenContext(java.net.URL endpoint,
                                             java.lang.String loginToken)
                                      throws java.net.MalformedURLException
Returns an IRemoteSession using the specified login token. A login token can be obtained from a portal request to a portlet using the PortletRequest.getLoginToken() method.

Parameters:
endpoint - the SOAP endpoint of the WS portal (ptapi). For example, a Java WS portal installation might use http://hostname:port/ptapi/services/QueryInterfaceAPI while a .NET WS portal might use http://hostname:port/ptapi/QueryInterfaceAPI.asmx. These endpoints will vary according to the deployment.
loginToken - the login token that can be obtained from a portal request to a portlet using PortletRequest.getLoginToken.
Returns:
an IRemoteSession object representing the current session with the portal
Throws:
java.net.MalformedURLException - if the endpoint URL is not valid

getRemotePortalSession

public static IRemoteSession getRemotePortalSession(IPortletContext portletCtx)
                                             throws java.net.MalformedURLException,
                                                    NotInRequestException
Returns an IRemoteSession using the PortletContext

Returns:
an IRemoteSession object representing the current session with the portal
Throws:
java.net.MalformedURLException - if the endpoint URL is not valid
NotInRequestException

getRemotePortalSession

public static IRemoteSession getRemotePortalSession(IProxyContext proxyCtx)
                                             throws java.net.MalformedURLException,
                                                    NotInRequestException
Returns an IRemoteSession using the ProxyContext

Returns:
an IRemoteSession object representing the current session with the portal
Throws:
java.net.MalformedURLException - if the endpoint URL is not valid
NotInRequestException


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.