javawebparts.filter
Class SessionLimiterFilterHelper

java.lang.Object
  |
  +--javawebparts.filter.SessionLimiterFilterHelper

public final class SessionLimiterFilterHelper
extends java.lang.Object

This class contains static methods used by the classes implementing the session limiting facility.

Author:
Tamas Szabo

Field Summary
private static org.apache.commons.logging.Log log
          Log instance.
static java.lang.String SET_KEY
          Attribute name of the Set containing the allowed session IDs in the application context.
 
Constructor Summary
private SessionLimiterFilterHelper()
          This is a utility class, so we want a private noarg constructor so instances cannot be created.
 
Method Summary
static boolean isSessionRegistered(javax.servlet.ServletContext ctx, java.lang.String sessionId)
          Checks whether a session is registered (ie allowed).
static boolean registerSession(javax.servlet.ServletContext ctx, java.lang.String sessionId, int maxSessions)
          Register a session if the maximum number of sessions isn't reached yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET_KEY

public static final java.lang.String SET_KEY
Attribute name of the Set containing the allowed session IDs in the application context.

See Also:
Constant Field Values

log

private static org.apache.commons.logging.Log log
Log instance.

Constructor Detail

SessionLimiterFilterHelper

private SessionLimiterFilterHelper()
This is a utility class, so we want a private noarg constructor so instances cannot be created.

Method Detail

registerSession

public static boolean registerSession(javax.servlet.ServletContext ctx,
                                      java.lang.String sessionId,
                                      int maxSessions)
Register a session if the maximum number of sessions isn't reached yet.

Parameters:
ctx - The servlet context.
sessionId - The session ID.
maxSessions - The number of allowed sessions.
Returns:
true if the session was successfully registered, false otherwise.

isSessionRegistered

public static boolean isSessionRegistered(javax.servlet.ServletContext ctx,
                                          java.lang.String sessionId)
Checks whether a session is registered (ie allowed).

Parameters:
ctx - The servlet context.
sessionId - The session ID.
Returns:
true if this session is registered, false otherwise.


Copyright © 2005 Frank W. Zammetti