KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

41 public interface StandardSession extends Session JavaDoc
42 {
43
44   /**
45    * Set the "last used" timestamp to the current time, resetting the
46    * idle period.
47    */

48   public void touch ();
49
50
51
52   /**
53    * Obtain the creation time for this object. The time is in
54    * milliseconds since Midnight, Jan 1, 1970 (epoch).
55    *
56    * @return The creation time since epoch for this object.
57    */

58   public long getTimeCreated ();
59
60
61
62   /**
63    * Obtain the time of last use for this object. The time is in
64    * milliseconds since Midnight, Jan 1, 1970 (epoch).
65    *
66    * @return The time of last use since epoch for this object.
67    */

68   public long getTimeLastUsed ();
69
70
71
72   /**
73    * Obtain the time of expiry for this object. The time is in
74    * milliseconds since Midnight, Jan 1, 1970 (epoch).
75    * Returns zero (or negative) if there is no expiration date.
76    * Note: this is a maximum lifespan for the session, regardless of activity.
77    *
78    * @return The time of expiry since epoch for this object.
79    */

80   public long getTimeExpires ();
81
82
83
84   /**
85    * Set the time of expiry for this object. The time is in
86    * milliseconds since Midnight, Jan 1, 1970 (epoch).
87    * Set this value to zero (or less) to indicate that the session does not
88    * have a maximum age.
89    *
90    * @param timeLastUsed The time of expiry since epoch.
91    */

92   public void setTimeExpires (long timeExpires);
93
94
95
96   /**
97    * Obtain the maximum idle time for this object. Zero (or negative)
98    * indicates that sessions may be idle indefinetly.
99    *
100    * @return The maximum number of milliseconds this session
101    * may be idle.
102    */

103   public long getMaxIdleTime ();
104
105
106
107   /**
108    * Set the maximum idle time for this object. Set this to zero
109    * (or negative) to disable idle checking.
110    *
111    * @param maxIdleTime The maximum number of milliseconds this
112    * session may be idle, or zero (or negative) to allow sessions to be idle
113    * indefinetly.
114    */

115   public void setMaxIdleTime (long maxIdleTime);
116
117
118
119   /**
120    * Obtain the maximum idle time when a <CODE>User</CODE> object
121    * is not associated with the session. Zero (or negative) indicates that
122    * sessions may be idle indefinetly.
123    *
124    * @return The maximum number of milliseconds this session
125    * may be idle.
126    */

127   public long getMaxNoUserIdleTime ();
128
129
130
131   /**
132    * set the maximum idle time when a <CODE>User</CODE> object
133    * is not associated with the session. Set this to zero (or negative) to
134    * disable idle checking.
135    *
136    * @param maxIdleTime The maximum number of milliseconds this
137    * session may be idle.
138    */

139   public void setMaxNoUserIdleTime (long maxIdleTime);
140
141
142
143   /**
144    * Expose the HttpSession interface
145    */

146   public HttpSession JavaDoc getHttpSession ();
147 }
148
149
150
151
Popular Tags