org.objectweb.telosys.screen.env
Class ScreenSessionManager

java.lang.Object
  extended byorg.objectweb.telosys.screen.env.ScreenSessionManager

public final class ScreenSessionManager
extends java.lang.Object

Set of methods for ScreenSession management.


Method Summary
static boolean closeScreenSession(javax.servlet.http.HttpServletRequest request)
          Close the Screen Session associated with a request
( close the screen session and remove it from HttpSession )
static ScreenSession findScreenSession(javax.servlet.http.HttpServletRequest request)
          Try to find the Screen Session associated with the current HTTP Session
Return null if ...
static ScreenSession findScreenSession(javax.servlet.http.HttpSession httpSession)
          Try to find the Screen Session associated with the current HTTP Session
Return null if ...
static ScreenSession findScreenSession(javax.servlet.jsp.PageContext pageContext)
          Try to find the Screen Session associated with the current HTTP Session
Return null if ...
static LoginUser findScreenSessionUser(javax.servlet.http.HttpServletRequest request)
          Return the LoginUser instance associated with the current ScreenSession.
static ScreenSession getCurrentScreenSession(javax.servlet.http.HttpServletRequest request)
          Returns the current ScreenSession associated with the given HttpRequest
or null if the HttpSession doesn't exist or if it doesn't contain a ScreenSession attribute
static ScreenSession getScreenSession(javax.servlet.http.HttpServletRequest request)
          Returns the current ScreenSession using the given HttpServletRequest.
static ScreenSession getScreenSessionOrThrowException(javax.servlet.http.HttpServletRequest httpRequest)
          Try to get the current ScreenSession using the given HttpServletRequest.
static boolean openScreenSession(javax.servlet.http.HttpServletRequest request, LoginUser loginUser, IAppUser appUser)
          Open (create) a new Screen Session for a given user
( create a new HttpSession if it doesn't exist )
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findScreenSession

public static ScreenSession findScreenSession(javax.servlet.http.HttpServletRequest request)
Try to find the Screen Session associated with the current HTTP Session
Return null if ...
. the request parameter is null
. there's no http session
. there's no ScreenSession in the http session

Parameters:
request -
Returns:
ScreenSession instance or null

findScreenSession

public static ScreenSession findScreenSession(javax.servlet.http.HttpSession httpSession)
Try to find the Screen Session associated with the current HTTP Session
Return null if ...
. the http session parameter is null
. there's no ScreenSession in the http session

Parameters:
httpSession -
Returns:
ScreenSession instance or null

findScreenSession

public static ScreenSession findScreenSession(javax.servlet.jsp.PageContext pageContext)
Try to find the Screen Session associated with the current HTTP Session
Return null if ...
. the PageContext parameter is null
. there's no http session
. there's no ScreenSession in the http session

Parameters:
pageContext -
Returns:
ScreenSession instance or null

findScreenSessionUser

public static LoginUser findScreenSessionUser(javax.servlet.http.HttpServletRequest request)
Return the LoginUser instance associated with the current ScreenSession.
Return null if the ScreenSession doesn't exist or if there's no LoginUser in the ScreenSession

Parameters:
request -
Returns:
LoginUser instance or null

getCurrentScreenSession

public static ScreenSession getCurrentScreenSession(javax.servlet.http.HttpServletRequest request)
Returns the current ScreenSession associated with the given HttpRequest
or null if the HttpSession doesn't exist or if it doesn't contain a ScreenSession attribute

Parameters:
request -
Returns:
the ScreenSession instance ( or null )

getScreenSession

public static ScreenSession getScreenSession(javax.servlet.http.HttpServletRequest request)
Returns the current ScreenSession using the given HttpServletRequest.
If there's no current ScreenSession :
. if user authentication is not requiered : then a "dummy session" is returned (in order to work without authentication)
. if user authentication is requiered : then "null" is returned

Parameters:
request -
Returns:
ScreenSession instance or null

getScreenSessionOrThrowException

public static ScreenSession getScreenSessionOrThrowException(javax.servlet.http.HttpServletRequest httpRequest)
                                                      throws TelosysException
Try to get the current ScreenSession using the given HttpServletRequest.
If there's no current ScreenSession :
. if user authentication is not requiered : then a "dummy session" is returned (in order to work without authentication)
. if user authentication is requiered : then throws an exception

Parameters:
httpRequest -
Returns:
ScreenSession instance ( never null : exception if not found/created )
Throws:
TelosysException
Since:
v 1.1.0

openScreenSession

public static boolean openScreenSession(javax.servlet.http.HttpServletRequest request,
                                        LoginUser loginUser,
                                        IAppUser appUser)
Open (create) a new Screen Session for a given user
( create a new HttpSession if it doesn't exist )

Parameters:
request -
loginUser -
appUser -
Returns:

closeScreenSession

public static boolean closeScreenSession(javax.servlet.http.HttpServletRequest request)
Close the Screen Session associated with a request
( close the screen session and remove it from HttpSession )

Parameters:
request -
Returns: