java.lang.Objectorg.objectweb.telosys.common.TelosysObject
org.objectweb.telosys.screen.env.ScreenSession
This class is a context holder for a user session
It is attached to the standard http session, it contains the user informations,
the user screen contexts, the services results, etc...
Constructor Summary | |
ScreenSession(javax.servlet.http.HttpSession httpSession,
LoginUser loginUser,
IAppUser appUser)
Constructor |
Method Summary | |
void |
close()
Close the session (clean all the references held by the session) |
void |
freeScreenContextSlot(int iScreenContextId)
Free a reserved slot Designed to be used if a error occurs between getAvailableScreenContextId() and setScreenContext() |
IAppUser |
getAppUser()
Returns the application user |
java.lang.Object |
getAttribute(java.lang.String name)
Gets an object from the 'screen session attributes' using the given name If name is null : return null |
int |
getAvailableScreenContextId()
Returns the first available ScreenContext ID and reserve it ( or -1 if no slot available ) |
javax.servlet.http.HttpSession |
getHttpSession()
Deprecated. use ScreenRequest|ServiceRequest.getHttpSession() instead |
java.lang.String |
getHttpSessionId()
Deprecated. use ScreenRequest|ServiceRequest.getHttpSessionId() instead |
java.lang.String |
getLanguage()
Returns the current session language ( e.g. : "fr", "en", ... ) or null if none |
LoginUser |
getLoginUser()
Retuns the login user (technical user) |
static int |
getMaxScreenId()
Returns the maximum Screen ID ( 0 to N ) |
ScreenApplication |
getScreenApplication()
Deprecated. use ScreenApplicationManager.getScreenApplication() instead |
ScreenContext |
getScreenContext(int iScreenId)
Returns the screen context bound with the specified id |
ScreenPostback |
getScreenPostback(java.lang.String sScreenKey)
Returns the ScreenPostback object for the given Screen key (if not found, the ScreenPostback is created) |
ScreenPostback |
getScreenPostback(java.lang.String sScreenName,
int iScreenContextId)
Returns the ScreenPostback for the given Screen Name and Screen Context Id |
java.lang.Object |
getServiceResult(java.lang.String sKey)
Returns the Service Result object from the ResultHolder stored in session with the given key |
ServiceResultHolder |
getServiceResultHolder(java.lang.String sKey)
Returns the service result holder stored in screen session with the given key |
javax.servlet.ServletContext |
getServletContext()
Deprecated. use ScreenApplicationManager.getServletContext() instead |
SessionPostback |
getSessionPostback()
Returns the SessionPostback object |
java.lang.Object |
removeAttribute(java.lang.String name)
Removes an object from the 'screen session attributes' If name is null : do nothing and return null |
void |
removeScreenContext(int iScreenId)
Removes the screen context bound with the specified id |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an object as a 'screen session attribute', associated with a unique name If name is null : do nothing If value is null : remove the attribute associated with the given name |
void |
setLanguage(java.lang.String sLang)
Sets the current session language |
void |
setScreenContext(int iScreenId,
ScreenContext screen)
Set a screen context in the screen session |
void |
setServiceResultHolder(java.lang.String sKey,
ServiceResultHolder srh)
Store a service result holder in screen session with the given key |
Methods inherited from class org.objectweb.telosys.common.TelosysObject |
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScreenSession(javax.servlet.http.HttpSession httpSession, LoginUser loginUser, IAppUser appUser)
httpSession
- loginUser
- appUser
- Method Detail |
public javax.servlet.http.HttpSession getHttpSession()
public java.lang.String getHttpSessionId()
public javax.servlet.ServletContext getServletContext()
public ScreenApplication getScreenApplication()
public SessionPostback getSessionPostback()
public ScreenPostback getScreenPostback(java.lang.String sScreenKey) throws TelosysException
sScreenKey
- the "screen key" ( Screen Name + Screen Context Id )
TelosysException
public ScreenPostback getScreenPostback(java.lang.String sScreenName, int iScreenContextId)
sScreenName
- iScreenContextId
-
public static int getMaxScreenId()
public void setScreenContext(int iScreenId, ScreenContext screen)
iScreenId
- screen
- public ScreenContext getScreenContext(int iScreenId)
iScreenId
-
public int getAvailableScreenContextId()
public void freeScreenContextSlot(int iScreenContextId)
iScreenContextId
- public void removeScreenContext(int iScreenId)
iScreenId
- public void setServiceResultHolder(java.lang.String sKey, ServiceResultHolder srh)
sKey
- srh
- the service result holderpublic ServiceResultHolder getServiceResultHolder(java.lang.String sKey)
sKey
-
public java.lang.Object getServiceResult(java.lang.String sKey)
sKey
-
public LoginUser getLoginUser()
public IAppUser getAppUser()
public void setLanguage(java.lang.String sLang)
sLang
- ( e.g. : "fr", "en", ... )public java.lang.String getLanguage()
public java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
name
- : a string specifying the name of the objectvalue
- : the value
public java.lang.Object getAttribute(java.lang.String name)
name
- : a string specifying the name of the object
public java.lang.Object removeAttribute(java.lang.String name)
name
- : a string specifying the name of the object
public void close()