01: /******************************************************************************
02: * JBoss, a division of Red Hat *
03: * Copyright 2006, Red Hat Middleware, LLC, and individual *
04: * contributors as indicated by the @authors tag. See the *
05: * copyright.txt in the distribution for a full listing of *
06: * individual contributors. *
07: * *
08: * This is free software; you can redistribute it and/or modify it *
09: * under the terms of the GNU Lesser General Public License as *
10: * published by the Free Software Foundation; either version 2.1 of *
11: * the License, or (at your option) any later version. *
12: * *
13: * This software is distributed in the hope that it will be useful, *
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16: * Lesser General Public License for more details. *
17: * *
18: * You should have received a copy of the GNU Lesser General Public *
19: * License along with this software; if not, write to the Free *
20: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
21: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
22: ******************************************************************************/package org.jboss.portal.api.session;
23:
24: /**
25: * The portal session, the portal session attributes are accessible however it is not possible to influence the
26: * lifecycle of the session as it is managed by the portal.
27: *
28: * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
29: * @version $Revision: 8785 $
30: */
31: public interface PortalSession {
32: /**
33: * Return the session id.
34: *
35: * @return the session id
36: */
37: String getId();
38:
39: /**
40: * Returns a session attribute.
41: *
42: * @param name the attribute name
43: * @return the attribute value or null if it is not found
44: * @throws IllegalArgumentException if the attribute name is null
45: */
46: Object getAttribute(String name) throws IllegalArgumentException;
47:
48: /**
49: * Update an attribute value. If the attribute value is null, then it is considered as a removal.
50: *
51: * @param name the attribute name
52: * @param attribute the attribute value
53: * @throws IllegalArgumentException if the attribute name is null
54: */
55: void setAttribute(String name, Object attribute)
56: throws IllegalArgumentException;
57:
58: /**
59: * Removes an attribute value.
60: *
61: * @param name the attribute name
62: * @throws IllegalArgumentException if the attribute name is null
63: */
64: void removeAttribute(String name) throws IllegalArgumentException;
65: }
|