|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.iplanet.portalserver.session.Session
The Session class represents a session. It contains
session related information such as session ID, session type
(user/application), client ID (user ID or application ID), session
idle time, time left on the session, and session state. It
also allows applications to add listener for session events.
The following is the state diagram for a session:
|
|
|
V
---------- invalid
| |
| |creation (authentication OK)
| |
|max login time| max idle time
|destroy V --------------->
| valid inactive --
| | <-------------- |
| | reactivate |
| | |
| | logout | destroy
| | destroy | max session time
| | max session time |
| V |
---------> destroy <---------------------
SessionID,
SessionListener| Field Summary | |
static int |
APPLICATION_SESSION
|
static int |
DESTROYED
|
static int |
INACTIVE
|
static int |
INVALID
|
static java.lang.String |
SESSION_SERVICE
|
static int |
USER_SESSION
|
static int |
VALID
|
| Method Summary | |
void |
addSessionListener(SessionListener listener)
Adds a session listener for session change events. |
void |
addSessionListenerOnAllSessions(SessionListener listener)
Adds a session listner for all sessions residing on the same session server as this session object resides. |
void |
addSessionListenerOnAllSessions(java.lang.String server,
SessionListener listener)
Adds a session listner for all sessions on the specified session server. |
void |
destroySession(Session session)
Destroy a session. |
java.lang.String |
encodeURL(javax.servlet.http.HttpServletResponse res,
java.lang.String url)
Returns the encoded URL , rewriten to include the session id. |
java.lang.String |
encodeURL(java.lang.String url)
Returns the encoded URL , rewritten to include the session id. |
Profile |
getAppProfile(java.lang.String name)
Gets the application profile. |
java.lang.String |
getClientDomain()
Returns the client domain in the session. |
java.lang.String |
getClientID()
Returns the client ID in the session. |
int |
getEventType()
Returns the type of the event which caused the state change of this session. |
SessionID |
getID()
Returns the session ID. |
long |
getIdleTime()
Returns the session idle time in seconds. |
long |
getMaxCachingTime()
Returns the maximum session caching time in minutes. |
long |
getMaxIdleTime()
Returns the maximum session idle time in minutes. |
long |
getMaxSessionTime()
Returns the maximum session time in minutes. |
java.lang.String |
getProperty(java.lang.String name)
Gets the property stored in this session. |
static Session |
getSession(SessionID sid)
Gets a session based on a SessionID object. |
int |
getState(boolean reset)
Returns the state of the session. |
long |
getTimeLeft()
Returns the time left for this session in seconds. |
int |
getType()
Returns the session type. |
Profile |
getUserProfile()
Gets the user (client) profile in this session. |
java.util.Vector |
getValidSessions()
Gets all valid sessions residing on the same session server as this session object resides from the Session Service. |
java.util.Vector |
getValidSessions(java.lang.String server)
Gets all valid sessions from the specified session server. |
void |
logout()
Logout a session. |
void |
refresh(boolean reset)
Gets the latest session from session server and updates the local cache of this session. |
void |
setDebug(Debug debug,
java.lang.String profileName)
Enables or disables degbugging/logging based on the value of debug attributes inside the application profile, which is accessible from the Session, sess. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property for this session. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int INVALID
public static final int VALID
public static final int INACTIVE
public static final int DESTROYED
public static final int USER_SESSION
public static final int APPLICATION_SESSION
public static final java.lang.String SESSION_SERVICE
| Method Detail |
public SessionID getID()
None. - public int getType()
None. - public java.lang.String getClientID()
None. - public java.lang.String getClientDomain()
None. - public long getMaxSessionTime()
None. - public long getMaxIdleTime()
None. - public long getMaxCachingTime()
None. -
public long getIdleTime()
throws SessionException
None. -
public long getTimeLeft()
throws SessionException
None. -
public int getState(boolean reset)
throws SessionException
reset - This parameter indicates that whether the Session Service needs to
reset the latest access time on this session.public int getEventType()
None. -
public java.lang.String getProperty(java.lang.String name)
throws SessionException
name - The property name.
public void setProperty(java.lang.String name,
java.lang.String value)
throws SessionException
name - The property name.value - The property value.
public void destroySession(Session session)
throws SessionException
session - The session to be destroyed.
public void logout()
throws SessionException
None. -
public Profile getUserProfile()
throws ProfileException
None. -
public Profile getAppProfile(java.lang.String name)
throws ProfileException
name - The Name of the application.
public void addSessionListener(SessionListener listener)
throws SessionException
listener - A reference to a SessionListener object.
public static Session getSession(SessionID sid)
throws SessionException
sid - The SessionID object.
public java.util.Vector getValidSessions()
throws SessionException
None. -
public java.util.Vector getValidSessions(java.lang.String server)
throws SessionException
server - The session server name. If the server name contains
protocol and port, the protocol and port will be used. Otherwise,
the server protocol and port is default to the same protocol and port
of the calling session.
public void addSessionListenerOnAllSessions(SessionListener listener)
throws SessionException
listener - A reference to the SessionListener object.
public void addSessionListenerOnAllSessions(java.lang.String server,
SessionListener listener)
throws SessionException
server - The session server name.listener - A reference to the SessionListener object.
public void refresh(boolean reset)
throws SessionException
reset - The flag to indicate whether to reset the latest session
access time in the session server.
public void setDebug(Debug debug,
java.lang.String profileName)
throws ProfileException
Enables or disables degbugging/logging based on the value of debug
attributes inside the application profile, which is accessible from the
Session, sess.
public java.lang.String encodeURL(javax.servlet.http.HttpServletResponse res,
java.lang.String url)
HttpServletResponse - url - , the URL to be encodedpublic java.lang.String encodeURL(java.lang.String url)
url - , the URL to be encoded
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||