root/software/session2/trunk/epydoc-html/session2.SessionManager.SessionManager-class.html

Revision 12, 18.6 kB (checked in by t, 12 years ago)

Moved VolatileSessionStore? over to MemorySessionStore? (MO)

Line 
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3           "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6   <title>session2.SessionManager.SessionManager</title>
7   <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
8 </head>
9 <body bgcolor="white" text="black" link="blue" vlink="#204080"
10       alink="#204080">
11
12 <!-- =========== START OF NAVBAR =========== -->
13 <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
14   <tr valign="center">
15     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="session2-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
16     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
17     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
18     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
19     <th class="navbar" align="right" width="100%">
20       <table border="0" cellpadding="0" cellspacing="0">
21       <tr><th class="navbar" align="center">
22         <p class="nomargin">
23           session2
24       </p></th></tr></table>
25     </th>
26   </tr>
27 </table>
28 <table width="100%" cellpadding="0" cellspacing="0">
29   <tr valign="top">
30     <td width="100%">
31       <font size="-1"><b class="breadcrumbs">
32         <a href="session2-module.html">Package&nbsp;session2</a> ::
33         <a href="session2.SessionManager-module.html">Module&nbsp;SessionManager</a> ::
34         Class&nbsp;SessionManager
35       </b></font></br>
36     </td>
37     <td><table cellpadding="0" cellspacing="0">
38       <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="session2.SessionManager.SessionManager-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
39     </table></td>
40 </tr></table>
41
42 <!-- =========== START OF CLASS DESCRIPTION =========== -->
43 <h2 class="class">Class SessionManager</h2>
44
45 <hr/>
46
47 <pre class="literalblock">
48 A persistent session manager for Quixote.
49 </pre>
50 <hr/>
51
52
53 <!-- =========== START OF METHOD SUMMARY =========== -->
54 <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
55 <tr bgcolor="#70b0f0" class="summary">
56   <th colspan="2">Method Summary</th></tr>
57 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
58   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
59           <span class=summary-sig-arg>store_obj</span>,
60           <span class=summary-sig-arg>session_class</span>)</span></code>
61 <br />
62 __init__ takes a session store instance and (optionally) the
63 session class to use for storing session information.</td></tr>
64 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
65   <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class=summary-sig-arg>self</span>)</span></code>
66 </td></tr>
67 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
68   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#clear_session" class="summary-sig-name"><code>clear_session</code></a>(<span class=summary-sig-arg>self</span>,
69           <span class=summary-sig-arg>request</span>)</span></code>
70 <br />
71 Clear any residual session information for this request.</td></tr>
72 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
73   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#expire_session" class="summary-sig-name"><code>expire_session</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
74 <br />
75 Expire the current session, ie.</td></tr>
76 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
77   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#finish_failed_request" class="summary-sig-name"><code>finish_failed_request</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
78 <br />
79 Called near the end of a failed request (i.e.</td></tr>
80 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
81   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#finish_successful_request" class="summary-sig-name"><code>finish_successful_request</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
82 <br />
83 Called near the end of each successful request.</td></tr>
84 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
85   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#get_session" class="summary-sig-name"><code>get_session</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
86 <br />
87 () -&gt; Session
88
89 Fetch or create a session object for the current session, and
90 return it.</td></tr>
91 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
92   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#has_session" class="summary-sig-name"><code>has_session</code></a>(<span class=summary-sig-arg>self</span>,
93           <span class=summary-sig-arg>session_id</span>)</span></code>
94 <br />
95 (session_id : string) -&gt; boolean
96
97 Return true if a session identified by 'session_id' exists in
98 the session manager.</td></tr>
99 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
100   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#has_session_cookie" class="summary-sig-name"><code>has_session_cookie</code></a>(<span class=summary-sig-arg>self</span>,
101           <span class=summary-sig-arg>must_exist</span>)</span></code>
102 <br />
103 (must_exist : boolean = false) -&gt; bool
104
105 Return true if the request already has a cookie identifying a
106 session object.</td></tr>
107 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
108   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#maintain_session" class="summary-sig-name"><code>maintain_session</code></a>(<span class=summary-sig-arg>self</span>,
109           <span class=summary-sig-arg>session</span>)</span></code>
110 <br />
111 (session : Session) -&gt; bool
112
113 Maintain session information.</td></tr>
114 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
115   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#new_session" class="summary-sig-name"><code>new_session</code></a>(<span class=summary-sig-arg>self</span>,
116           <span class=summary-sig-arg>id</span>)</span></code>
117 <br />
118 (id : string) -&gt; Session
119
120 Return a new session object, ie.</td></tr>
121 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
122   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#revoke_session_cookie" class="summary-sig-name"><code>revoke_session_cookie</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
123 <br />
124 Remove the session cookie from the remote user's session by
125 resetting the value and maximum age in the response object.</td></tr>
126 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
127   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#set_session_cookie" class="summary-sig-name"><code>set_session_cookie</code></a>(<span class=summary-sig-arg>self</span>,
128           <span class=summary-sig-arg>session_id</span>)</span></code>
129 <br />
130 (session_id : string)
131
132 Ensure that a session cookie with value 'session_id' will be
133 returned to the client via the response object.</td></tr>
134 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
135   <td><code><span class="summary-sig"><a href="session2.SessionManager.SessionManager-class.html#start_request" class="summary-sig-name"><code>start_request</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
136 <br />
137 Called near the beginning of each request: after the HTTPRequest
138 object has been built, but before we traverse the URL or call the
139 callable object found by URL traversal.</td></tr>
140 </table><br />
141
142
143 <!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->
144 <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
145 <tr bgcolor="#70b0f0" class="summary">
146   <th colspan="2">Class Variable Summary</th></tr>
147 <tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
148 <td><b><a href="session2.SessionManager.SessionManager-class.html#ACCESS_TIME_RESOLUTION"><code>ACCESS_TIME_RESOLUTION</code></a></b> = <span title="1">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
149 </table><br />
150
151
152 <!-- =========== START OF METHOD DETAILS =========== -->
153 <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
154 <tr bgcolor="#70b0f0" class="details">
155   <th colspan="2">Method Details</th></tr>
156 </table>
157
158 <a name="__init__"></a>
159 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
160   <h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
161           <span class=sig-arg>store_obj</span>,
162           <span class=sig-arg>session_class</span>=<span class=sig-default>&lt;class&nbsp;session2.Session.Session&nbsp;at&nbsp;0x4030414c&gt;</span>)</span>
163     <br /><i>(Constructor)</i>
164   </h3>
165 <pre class="literalblock">
166 __init__ takes a session store instance and (optionally) the
167 session class to use for storing session information.  (This
168 defaults to `Session.Session`).
169 </pre>
170   <dl><dt></dt><dd>
171   </dd></dl>
172 </td></tr></table>
173
174 <a name="clear_session"></a>
175 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
176   <h3><span class="sig"><span class="sig-name">clear_session</span>(<span class=sig-arg>self</span>,
177           <span class=sig-arg>request</span>)</span>
178   </h3>
179 <pre class="literalblock">
180 Clear any residual session information for this request.
181 </pre>
182   <dl><dt></dt><dd>
183   </dd></dl>
184 </td></tr></table>
185
186 <a name="expire_session"></a>
187 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
188   <h3><span class="sig"><span class="sig-name">expire_session</span>(<span class=sig-arg>self</span>)</span>
189   </h3>
190 <pre class="literalblock">
191 Expire the current session, ie. revoke the session cookie from
192 the client, remove the session object from the current request,
193 and list it for permanent removal.
194 </pre>
195   <dl><dt></dt><dd>
196   </dd></dl>
197 </td></tr></table>
198
199 <a name="finish_failed_request"></a>
200 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
201   <h3><span class="sig"><span class="sig-name">finish_failed_request</span>(<span class=sig-arg>self</span>)</span>
202   </h3>
203 <pre class="literalblock">
204 Called near the end of a failed request (i.e. a exception that was
205 not a PublisherError was raised.
206 </pre>
207   <dl><dt></dt><dd>
208   </dd></dl>
209 </td></tr></table>
210
211 <a name="finish_successful_request"></a>
212 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
213   <h3><span class="sig"><span class="sig-name">finish_successful_request</span>(<span class=sig-arg>self</span>)</span>
214   </h3>
215 <pre class="literalblock">
216 Called near the end of each successful request.  Not called if
217 there were any errors processing the request.
218 </pre>
219   <dl><dt></dt><dd>
220   </dd></dl>
221 </td></tr></table>
222
223 <a name="get_session"></a>
224 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
225   <h3><span class="sig"><span class="sig-name">get_session</span>(<span class=sig-arg>self</span>)</span>
226   </h3>
227 <pre class="literalblock">
228 () -&gt; Session
229
230 Fetch or create a session object for the current session, and
231 return it.  If a session cookie is found in the HTTP request
232 object, use it to look up and return an existing session object.
233 If no session cookie is found, create a new session.
234
235 Note that this method does *not* cause the new session to be
236 stored in the session manager, nor does it drop a session cookie
237 on the user.  Those are both the responsibility of
238 finish_successful_request().
239 </pre>
240   <dl><dt></dt><dd>
241   </dd></dl>
242 </td></tr></table>
243
244 <a name="has_session"></a>
245 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
246   <h3><span class="sig"><span class="sig-name">has_session</span>(<span class=sig-arg>self</span>,
247           <span class=sig-arg>session_id</span>)</span>
248   </h3>
249 <pre class="literalblock">
250 (session_id : string) -&gt; boolean
251
252 Return true if a session identified by 'session_id' exists in
253 the session manager.
254 </pre>
255   <dl><dt></dt><dd>
256   </dd></dl>
257 </td></tr></table>
258
259 <a name="has_session_cookie"></a>
260 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
261   <h3><span class="sig"><span class="sig-name">has_session_cookie</span>(<span class=sig-arg>self</span>,
262           <span class=sig-arg>must_exist</span>=<span class=sig-default>False</span>)</span>
263   </h3>
264 <pre class="literalblock">
265 (must_exist : boolean = false) -&gt; bool
266
267 Return true if the request already has a cookie identifying a
268 session object.  If 'must_exist' is true, the cookie must
269 correspond to a currently existing session; otherwise (the
270 default), we just check for the existence of the session cookie
271 and don't inspect its content at all.
272 </pre>
273   <dl><dt></dt><dd>
274   </dd></dl>
275 </td></tr></table>
276
277 <a name="maintain_session"></a>
278 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
279   <h3><span class="sig"><span class="sig-name">maintain_session</span>(<span class=sig-arg>self</span>,
280           <span class=sig-arg>session</span>)</span>
281   </h3>
282 <pre class="literalblock">
283 (session : Session) -&gt; bool
284
285 Maintain session information.  This method is called after servicing
286 an HTTP request, just before the response is returned.  If a session
287 contains information a cookie is dropped on the client and True is
288 returned.  If not, the session is forcibly expired and False is
289 returned.
290 </pre>
291   <dl><dt></dt><dd>
292   </dd></dl>
293 </td></tr></table>
294
295 <a name="new_session"></a>
296 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
297   <h3><span class="sig"><span class="sig-name">new_session</span>(<span class=sig-arg>self</span>,
298           <span class=sig-arg>id</span>)</span>
299   </h3>
300 <pre class="literalblock">
301 (id : string) -&gt; Session
302
303 Return a new session object, ie. an instance of the session_class
304 class passed to the constructor (defaults to Session).
305 </pre>
306   <dl><dt></dt><dd>
307   </dd></dl>
308 </td></tr></table>
309
310 <a name="revoke_session_cookie"></a>
311 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
312   <h3><span class="sig"><span class="sig-name">revoke_session_cookie</span>(<span class=sig-arg>self</span>)</span>
313   </h3>
314 <pre class="literalblock">
315 Remove the session cookie from the remote user's session by
316 resetting the value and maximum age in the response object.  Also
317 remove the cookie from the request so that further processing of
318 this request does not see the cookie's revoked value.
319 </pre>
320   <dl><dt></dt><dd>
321   </dd></dl>
322 </td></tr></table>
323
324 <a name="set_session_cookie"></a>
325 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
326   <h3><span class="sig"><span class="sig-name">set_session_cookie</span>(<span class=sig-arg>self</span>,
327           <span class=sig-arg>session_id</span>)</span>
328   </h3>
329 <pre class="literalblock">
330 (session_id : string)
331
332 Ensure that a session cookie with value 'session_id' will be
333 returned to the client via the response object.
334 </pre>
335   <dl><dt></dt><dd>
336   </dd></dl>
337 </td></tr></table>
338
339 <a name="start_request"></a>
340 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
341   <h3><span class="sig"><span class="sig-name">start_request</span>(<span class=sig-arg>self</span>)</span>
342   </h3>
343 <pre class="literalblock">
344 Called near the beginning of each request: after the HTTPRequest
345 object has been built, but before we traverse the URL or call the
346 callable object found by URL traversal.
347 </pre>
348   <dl><dt></dt><dd>
349   </dd></dl>
350 </td></tr></table>
351 <br />
352
353
354 <!-- =========== START OF CLASS VARIABLE DETAILS =========== -->
355 <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
356 <tr bgcolor="#70b0f0" class="details">
357   <th colspan="2">Class Variable Details</th></tr>
358 </table>
359 <table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
360 <a name="ACCESS_TIME_RESOLUTION"></a>
361 <h3>ACCESS_TIME_RESOLUTION</h3>
362 <dl>
363   <dt></dt>
364   <dd>
365     <dl>
366       <dt><b>Type:</b></dt>
367       <dd>
368           <code>int</code>
369
370       </dd>
371 <span title="1">      <dt><b>Value:</b></dt>
372       <dd><table><tr><td>
373 <pre class="variable">
374 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</pre>
375         </td></tr></table></dd>
376 </span>    </dl>
377   </dd>
378 </dl></td></tr></table>
379 <br />
380
381
382 <!-- =========== START OF NAVBAR =========== -->
383 <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
384   <tr valign="center">
385     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="session2-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
386     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
387     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
388     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
389     <th class="navbar" align="right" width="100%">
390       <table border="0" cellpadding="0" cellspacing="0">
391       <tr><th class="navbar" align="center">
392         <p class="nomargin">
393           session2
394       </p></th></tr></table>
395     </th>
396   </tr>
397 </table>
398
399 <table border="0" cellpadding="0" cellspacing="0" width="100%">
400   <tr>
401     <td align="left"><font size="-2">Generated by Epydoc 2.1 on Sun Oct 15 21:33:50 2006</font></td>
402     <td align="right"><a href="http://epydoc.sourceforge.net"
403                       ><font size="-2">http://epydoc.sf.net</font></a></td>
404   </tr>
405 </table>
406 </body>
407 </html>
Note: See TracBrowser for help on using the browser.