1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.talika.tarsis.command;
24
25 /**
26 * Interface that defines a user session in Tarsis MVC Framework.<br>
27 * <br>
28 * <code>Session</code> object provides a way to identify a user across more than one
29 * request and to store information about that user.<code>Session</code> is intended
30 * to decouple Tarsis commands layer from Servlet layer.<br>
31 *
32 * @author Jose M. Palomar
33 * @version $Revision: 106 $
34 */
35 public interface Session {
36
37
38
39
40 /**
41 * Returns a string containing the unique identifier assigned to this session.
42 *
43 * @return String string containing the unique identifier assigned to this
44 * session.
45 */
46 String getId();
47
48 /**
49 * Binds an object to this session, using the name specified. If an object of
50 * the same name is already bound to the session, the object is replaced.
51 *
52 * @param name String the name to which the object is bound; cannot be
53 * <code>null</code>.
54 * @param value Object the object to be bound.
55 * @see javax.servlet.http.HttpSession#setAttribute(String, Object)
56 */
57 void setAttribute(String name, Object value);
58
59 /**
60 * Returns the object bound with the specified name in this session, or
61 * <code>null</code> if no object is bound under the name.
62 *
63 * @param name String a string specifying the name of the object.
64 * @return Object the object with the specified name.
65 * @see javax.servlet.http.HttpSession#getAttribute(String)
66 */
67 Object getAttribute(String name);
68
69 /**
70 * Removes the object bound with the specified name from this session. If the
71 * session does not have an object bound with the specified name, this method
72 * does nothing.
73 *
74 * @param name String the name of the object to remove from this session.
75 * @see javax.servlet.http.HttpSession#removeAttribute(String)
76 */
77 void removeAttribute(String name);
78
79 }