EAF 7.6 API

com.lutris.appserver.server.session
Interface Session

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
StandardSession

public interface Session
extends java.io.Serializable

Defines the interface for the Session object expected by the SessionManager..

Version:
$Revision: 1.2 $
Author:
Shawn McMurdo

Method Summary
 void clearUser()
          Remove the user association with this session.
 javax.servlet.http.HttpSession getHttpSession()
           
 com.lutris.appserver.server.session.SessionData getSessionData()
          Obtain the application specific data for this session.
 java.lang.String getSessionKey()
          Obtain the unique key associated with this session.
 SessionManager getSessionManager()
          Obtain the session manager associated with this session.
 User getUser()
          Obtain the user associated with this session.
 boolean isNew()
          Returns true if the session is new.
 void setHttpSession(javax.servlet.http.HttpSession httpSession)
           
 void setUser(User user)
          Set the user associated with this session.
 

Method Detail

getUser

User getUser()
Obtain the user associated with this session.

Returns:
The user object or null if the session is not associated with a User objects.

setUser

void setUser(User user)
             throws SessionException
Set the user associated with this session. This will register the user with the SessionManager.

If it is neccessary to prevent a user from logging on multiple times, this can be accomplished by synchronizing on the Sessionmanager object and enquiring about the number of users associated with a session. It is then possible to delete other sessions before adding a new session.

Parameters:
user - The user object to associate with the session.
Throws:
SessionException - If the user cannot be set.
See Also:
SessionManager.getSessionKeys(User)

clearUser

void clearUser()
               throws SessionException
Remove the user association with this session. This will unregister the user with the SessionManager.

Throws:
SessionException - If the user cannot be cleared.

getSessionKey

java.lang.String getSessionKey()
Obtain the unique key associated with this session.

Returns:
A String containing the key for this session.

getSessionManager

SessionManager getSessionManager()
Obtain the session manager associated with this session.

Returns:
The session manager object.

getSessionData

com.lutris.appserver.server.session.SessionData getSessionData()
Obtain the application specific data for this session.

Returns:
A SessionData object containing application specific data for this session.

isNew

boolean isNew()
Returns true if the session is new. A session is new if it has been created but a client cookie was never used to reference it. In other words, the cookie associated with the session was never submitted by a client.

Returns:
true if the session is new.

getHttpSession

javax.servlet.http.HttpSession getHttpSession()

setHttpSession

void setHttpSession(javax.servlet.http.HttpSession httpSession)

EAF 7.6 API