com.ibm.domino.xsp.module.nsf
Class SessionCloner

java.lang.Object
  extended by com.ibm.domino.xsp.module.nsf.SessionCloner

public abstract class SessionCloner
extends java.lang.Object

Notes Session Factory.

This class is used to record the current user credentials, whenever it is the web user or the designer one, and then recreate a session for this user in another thread/context. This can be used, for example, for executing long running tasks in a different thread, while using the credentials of the user.
Note that the session must be recycled through its factory. A typical usage is:

 Session s = factory.getSession();
 try {
   .... do something with the session .... 
 } finally {
   factory.recycle()
 }
 


Constructor Summary
protected SessionCloner()
           
 
Method Summary
protected abstract  lotus.domino.Session createSession()
           
static SessionCloner getDesignerSessionCloner(boolean fullAdminAccess)
          Create a session cloner for the designer user.
 lotus.domino.Session getSession()
           
static SessionCloner getSessionCloner()
          Create a session cloner for the current user.
 void recycle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionCloner

protected SessionCloner()
Method Detail

getSessionCloner

public static SessionCloner getSessionCloner()
Create a session cloner for the current user. The session cloner will return a session object that is similar to the global session object.

Returns:
the session cloner

getDesignerSessionCloner

public static SessionCloner getDesignerSessionCloner(boolean fullAdminAccess)
Create a session cloner for the designer user. The session cloner will return a session object that is similar to the global sessionAsDesigner or sessionAsSignerWithFullAccess objects.

Parameters:
fullAdminAccess - if full admin access is requested
Returns:
the session cloner

getSession

public lotus.domino.Session getSession()
                                throws lotus.domino.NotesException
Throws:
lotus.domino.NotesException

recycle

public void recycle()
             throws lotus.domino.NotesException
Throws:
lotus.domino.NotesException

createSession

protected abstract lotus.domino.Session createSession()
                                               throws lotus.domino.NotesException
Throws:
lotus.domino.NotesException