org.apache.jetspeed.services.webpage
Class SessionMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.apache.jetspeed.services.webpage.SessionMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener, java.util.Map, java.io.Serializable

public class SessionMap
extends java.util.HashMap
implements javax.servlet.http.HttpSessionBindingListener

Stores a map of sessions with other sites for the current portal session. The map is keyed by the portal session's SessionID (from the servlet api). Binds to the servlet's session so that it can be cleaned up on session end. This session keeps a map of all live sessions per site local session.

Version:
$Id: SessionMap.java,v 1.3 2004/02/23 03:46:26 jford Exp $
Author:
David Sean Taylor
See Also:
Serialized Form

Constructor Summary
SessionMap(java.lang.String sessionID, java.lang.String sessionUser)
          construct a Session Map
 
Method Summary
 int getCacheCount()
          Gets the cache count for this session.
 int getHitCount()
          Gets the hitcount for this session.
 int getSessionCount()
          Gets the managed session count for this portal session.
 java.lang.String getSessionID()
          Gets the Session ID associated with this session.
 java.lang.String getSessionState()
          Gets the Session State, for the servlet session.
 java.lang.String getUser()
          Gets the user associated with this session.
 void incCacheCount()
          Increments the hitcount for this session.
 void incHitCount()
          Increments the hitcount for this session.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
          This method is a session binding event callback.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
          This method is a session unbinding event callback.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

SessionMap

public SessionMap(java.lang.String sessionID,
                  java.lang.String sessionUser)
construct a Session Map

Parameters:
sessionUser - the user associated with the new session.
Method Detail

getUser

public java.lang.String getUser()
Gets the user associated with this session.

Returns:
the user associated with this sessions.

getSessionID

public java.lang.String getSessionID()
Gets the Session ID associated with this session.

Returns:
the session ID associated with this sessions.

getSessionState

public java.lang.String getSessionState()
Gets the Session State, for the servlet session.

Returns:
the a string describing the session state.

getSessionCount

public int getSessionCount()
Gets the managed session count for this portal session.

Returns:
the managed session count for this session.

getHitCount

public int getHitCount()
Gets the hitcount for this session.

Returns:
the hitcount for this session.

incHitCount

public void incHitCount()
Increments the hitcount for this session.


getCacheCount

public int getCacheCount()
Gets the cache count for this session.

Returns:
the cache count for this session.

incCacheCount

public void incCacheCount()
Increments the hitcount for this session.


valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
This method is a session binding event callback. It is called when the session is bound

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
This method is a session unbinding event callback. It is called when the session is unbound. We need to clean up all the site sessions associated with this Session. The session is marked as 'not active' and is no longer useable. It session object is then removed from the agent's cache

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.