01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/event/tags/sakai_2-4-1/event-api/api/src/java/org/sakaiproject/event/api/SessionState.java $
03: * $Id: SessionState.java 7036 2006-03-27 00:31:07Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.event.api;
21:
22: import java.util.List;
23: import java.util.Map;
24:
25: /**
26: * <p>
27: * SessionState is a collection of named attributes associated with the current session. SessionState implements Map, but the Map methods should only be used to get attributes, not to set or remove attributes.
28: * </p>
29: */
30: public interface SessionState extends Map {
31: /**
32: * Access the named attribute.
33: *
34: * @param name
35: * The attribute name.
36: * @return The named attribute value.
37: */
38: Object getAttribute(String name);
39:
40: /**
41: * Set the named attribute value to the provided object.
42: *
43: * @param name
44: * The attribute name.
45: * @param value
46: * The value of the attribute (any object type).
47: * @return The previous value of the named attribute (or null if no previous value).
48: */
49: Object setAttribute(String name, Object value);
50:
51: /**
52: * Remove the named attribute, if it exists.
53: *
54: * @param name
55: * The attribute name.
56: * @return The previous value of the removed named attribute (or null if no previous value).
57: */
58: Object removeAttribute(String name);
59:
60: /**
61: * Remove all attributes.
62: */
63: void clear();
64:
65: /**
66: * Access a List of all names of attributes stored in the SessionState.
67: *
68: * @return A List of all names of attribute stored in the SessionState.
69: */
70: List getAttributeNames();
71: }
|