001: /*
002: * Enhydra Java Application Server Project
003: *
004: * The contents of this file are subject to the Enhydra Public License
005: * Version 1.1 (the "License"); you may not use this file except in
006: * compliance with the License. You may obtain a copy of the License on
007: * the Enhydra web site ( http://www.enhydra.org/ ).
008: *
009: * Software distributed under the License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011: * the License for the specific terms governing rights and limitations
012: * under the License.
013: *
014: * The Initial Developer of the Enhydra Application Server is Lutris
015: * Technologies, Inc. The Enhydra Application Server and portions created
016: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017: * All Rights Reserved.
018: *
019: * Contributor(s):
020: *
021: * $Id: StandardSessionUserTable.java,v 1.2 2006-06-15 13:40:47 sinisa Exp $
022: */
023:
024: package com.lutris.appserver.server.sessionEnhydra;
025:
026: import java.util.Enumeration;
027:
028: import com.lutris.appserver.server.session.SessionException;
029: import com.lutris.appserver.server.user.User;
030:
031: /**
032: * Table used by StandardSessionManager to cross reference <CODE>User</CODE>
033: * objects and sessions.<p>
034: *
035: * N.B. It is assumed that this interface is only used by
036: * StandardSessionManager and that it is responsible for
037: * providing high level locks instead of synchronizing
038: *
039: * @version $Revision: 1.2 $
040: * @author Mark Diekhans
041: * @author Kyle Clark
042: * @see BasicSessionUserTable
043: * @see PagedSessionUserTable
044: * @see com.lutris.appserver.server.sessionEnhydra.persistent.PersistentSessionUserTable
045: */
046: public interface StandardSessionUserTable {
047:
048: /**
049: * Add a session key to the user to session xref table.
050: *
051: * @param session
052: * The session key.
053: * @param user
054: * the user to associated with the session key.
055: * @exception SessionException if an error occurs.
056: */
057: void add(String sessionKey, User user) throws SessionException;
058:
059: /**
060: * Remove a session from the user to session mapping table.
061: * If the session is not it the table, it is ignored.
062: *
063: * @param sessionKey The session object, with the user already
064: * filled in.
065: * @exception SessionException if an error occurs.
066: */
067: void remove(String sessionKey, User user) throws SessionException;
068:
069: /**
070: * Removes all references to a session from the user session table.
071: *
072: * @param sessionKey The session key.
073: */
074: void remove(String sessionKey) throws SessionException;
075:
076: /**
077: * Get the number of sessions for a user.
078: *
079: * @param user The user object to check for.
080: * @return The count of the number of sessions associated with this
081: * user.
082: * @exception SessionException if an error occurs.
083: */
084: int numSessions(User user) throws SessionException;
085:
086: /**
087: * Returns the session keys associated with a particular user.
088: *
089: * @param user The user object to check for.
090: * @return An enumeration of the session keys associated
091: * with the user.
092: * @exception SessionException if an error occurs.
093: */
094: Enumeration getSessionKeys(User user) throws SessionException;
095:
096: /**
097: * Shutdown this session user table as required. The session
098: * user table should not be used after this method has been called
099: */
100: public void shutdown();
101:
102: }
|