KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > appserver > server > session > Session


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: Session.java,v 1.1 2005/07/13 11:09:06 slobodan Exp $
23  *
24  * formatted with JxBeauty (c) johann.langhofer@nextra.at
25  */

26
27
28 package com.lutris.appserver.server.session;
29
30 import javax.servlet.http.HttpSession JavaDoc;
31
32 import com.lutris.appserver.server.user.User;
33
34 /**
35  * Defines the interface for the Session object expected by the SessionManager..
36  *
37  * @version $Revision: 1.1 $
38  * @author Shawn McMurdo
39  */

40 public interface Session extends java.io.Serializable JavaDoc
41 {
42
43     /**
44      * Obtain the user associated with this session.
45      *
46      * @return The user object or <CODE>null</CODE> if the
47      * session is not associated with a <CODE>User</CODE> objects.
48      */

49     public User getUser();
50  
51     /**
52      * Set the user associated with this session. This will register the
53      * user with the <CODE>SessionManager</CODE>. <P>
54      *
55      * If it is neccessary to prevent a user from logging on multiple times,
56      * this can be accomplished by synchronizing on the
57      * <CODE>Sessionmanager</CODE> object and enquiring about the number of
58      * users associated with a session. It is then possible to delete other
59      * sessions before adding a new session.
60      *
61      * @param user
62      * The user object to associate with the session.
63      * @exception SessionException
64      * If the user cannot be set.
65      * @see
66      * SessionManager#getSessionKeys(User)
67      */

68     public void setUser(User user) throws SessionException;
69
70     /**
71      * Remove the user association with this session. This will unregister the
72      * user with the <CODE>SessionManager</CODE>.
73      * @exception SessionException
74      * If the user cannot be cleared.
75      */

76     public void clearUser() throws SessionException;
77
78     /**
79      * Obtain the unique key associated with this session.
80      *
81      * @return A String containing the key for this session.
82      */

83     public String JavaDoc getSessionKey();
84
85     /**
86      * Obtain the session manager associated with this session.
87      *
88      * @return The session manager object.
89      */

90     public SessionManager getSessionManager();
91
92     /**
93      * Obtain the application specific data for this session.
94      *
95      * @return A SessionData object containing application specific
96      * data for this session.
97      */

98     public SessionData getSessionData();
99
100     /**
101      * Returns true if the session is new. A session is new if it has
102      * been created but a client cookie was never used to reference it.
103      * In other words, the cookie associated with the session was
104      * never submitted by a client.
105      *
106      * @return true if the session is new.
107      */

108     public boolean isNew();
109
110
111     /**
112      *
113      *
114      */

115
116      public HttpSession JavaDoc getHttpSession();
117
118 }
119
120
121
122
Popular Tags