KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > appserver > server > sessionEnhydra > StandardSessionUserTable


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  *
22  * $Id: StandardSessionUserTable.java,v 1.1 2005/07/13 11:09:06 slobodan Exp $
23  */

24
25 package com.lutris.appserver.server.sessionEnhydra;
26
27 import java.util.Enumeration JavaDoc;
28
29 import com.lutris.appserver.server.session.SessionException;
30 import com.lutris.appserver.server.user.User;
31
32 /**
33  * Table used by StandardSessionManager to cross reference <CODE>User</CODE>
34  * objects and sessions.<p>
35  *
36  * N.B. It is assumed that this interface is only used by
37  * StandardSessionManager and that it is responsible for
38  * providing high level locks instead of synchronizing
39  *
40  * @version $Revision: 1.1 $
41  * @author Mark Diekhans
42  * @author Kyle Clark
43  * @see BasicSessionUserTable
44  * @see PagedSessionUserTable
45  * @see com.lutris.appserver.server.sessionEnhydra.persistent.PersistentSessionUserTable
46  */

47 public interface StandardSessionUserTable {
48
49     /**
50      * Add a session key to the user to session xref table.
51      *
52      * @param session
53      * The session key.
54      * @param user
55      * the user to associated with the session key.
56      * @exception SessionException if an error occurs.
57      */

58     void add(String JavaDoc sessionKey, User user) throws SessionException;
59
60     /**
61      * Remove a session from the user to session mapping table.
62      * If the session is not it the table, it is ignored.
63      *
64      * @param sessionKey The session object, with the user already
65      * filled in.
66      * @exception SessionException if an error occurs.
67      */

68     void remove(String JavaDoc sessionKey, User user) throws SessionException;
69
70     /**
71      * Removes all references to a session from the user session table.
72      *
73      * @param sessionKey The session key.
74      */

75     void remove(String JavaDoc sessionKey) throws SessionException;
76
77     /**
78      * Get the number of sessions for a user.
79      *
80      * @param user The user object to check for.
81      * @return The count of the number of sessions associated with this
82      * user.
83      * @exception SessionException if an error occurs.
84      */

85     int numSessions(User user) throws SessionException;
86
87     /**
88      * Returns the session keys associated with a particular user.
89      *
90      * @param user The user object to check for.
91      * @return An enumeration of the session keys associated
92      * with the user.
93      * @exception SessionException if an error occurs.
94      */

95     Enumeration JavaDoc getSessionKeys(User user) throws SessionException;
96
97     /**
98      * Shutdown this session user table as required. The session
99      * user table should not be used after this method has been called
100      */

101     public void shutdown();
102
103 }
104
Popular Tags