KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > admin > security > server > SecuritySession


1 /*
2  * Created on Oct 9, 2003
3  * $Id: SecuritySession.java,v 1.2 2005/04/09 17:19:57 colinmacleod Exp $
4  * Copyright (c) 2001 - 2005 ivata limited.
5  * All rights reserved.
6  * -----------------------------------------------------------------------------
7  * ivata groupware may be redistributed under the GNU General Public
8  * License as published by the Free Software Foundation;
9  * version 2 of the License.
10  *
11  * These programs are free software; you can redistribute them and/or
12  * modify them under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; version 2 of the License.
14  *
15  * These programs are distributed in the hope that they will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  * See the GNU General Public License in the file LICENSE.txt for more
20  * details.
21  *
22  * If you would like a copy of the GNU General Public License write to
23  *
24  * Free Software Foundation, Inc.
25  * 59 Temple Place - Suite 330
26  * Boston, MA 02111-1307, USA.
27  *
28  *
29  * To arrange commercial support and licensing, contact ivata at
30  * http://www.ivata.com/contact.jsp
31  * -----------------------------------------------------------------------------
32  * $Log: SecuritySession.java,v $
33  * Revision 1.2 2005/04/09 17:19:57 colinmacleod
34  * Changed copyright text to GPL v2 explicitly.
35  *
36  * Revision 1.1.1.1 2005/03/10 17:51:40 colinmacleod
37  * Restructured ivata op around Hibernate/PicoContainer.
38  * Renamed ivata groupware.
39  *
40  * Revision 1.1 2004/09/30 15:15:58 colinmacleod
41  * Split off addressbook elements into security subproject.
42  *
43  * Revision 1.3 2004/07/13 19:41:12 colinmacleod
44  * Moved project to POJOs from EJBs.
45  * Applied PicoContainer to services layer (replacing session EJBs).
46  * Applied Hibernate to persistence layer (replacing entity EJBs).
47  *
48  * Revision 1.2 2004/03/21 21:16:05 colinmacleod
49  * Shortened name to ivata op.
50  *
51  * Revision 1.1.1.1 2004/01/27 20:57:45 colinmacleod
52  * Moved ivata openportal to SourceForge..
53  *
54  * Revision 1.1.1.1 2003/10/13 20:50:07 colin
55  * Restructured portal into subprojects
56  * -----------------------------------------------------------------------------
57  */

58 package com.ivata.groupware.admin.security.server;
59
60 import java.io.Serializable JavaDoc;
61
62 import org.picocontainer.PicoContainer;
63
64 import com.ivata.groupware.admin.security.user.UserDO;
65
66 /**
67  * <p>Represents a user's session, and is used to authenticate her actions
68  * throughout the system. You must define a class which implements
69  * this interface and which will be returned by <code>SessionServer.login</code>.</p>
70  *
71  * @author Colin MacLeod
72  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
73  */

74 public interface SecuritySession extends Serializable JavaDoc {
75     /**
76      * <p>
77      * Get the access level for this next task to be performed.
78      * </p>
79      *
80      * @return access level
81      */

82     int getAccess();
83     /**
84      * <p>
85      * The security session can also be used as a container for items which
86      * should persist as long as the user is logged in.
87      * </p>
88      *
89      * @param name name of the attribute to retrieve.
90      * @return value for this attribute.
91      */

92     Serializable JavaDoc getAttribute(final String JavaDoc name);
93
94     /**
95      * <p>
96      * Get the pico container used to access objects for this session.
97      * </p>
98      *
99      * @return valid pico container.
100      */

101     PicoContainer getContainer();
102     /**
103      * <p>Get the password associated with this session.</p>
104      * <p>
105      * (I'd rather not store
106      * the password in the sesssion, but <strong>Cyrus IMAP</strong> needs
107      * it.)
108      * </p>
109      *
110      * @return password.
111      */

112     String JavaDoc getPassword();
113     /**
114      * <p>
115      * Get the user who logged in to this security session.
116      * </p>
117      *
118      * @return user who logged in to this security session.
119      */

120     UserDO getUser();
121     /**
122      * <p>
123      * Find out whether or not this is the guest user.
124      * </p>
125      * @return <code>true</code> if this is a guest, otherwise
126      * <code>false</code>.
127      */

128     boolean isGuest();
129     /**
130      * <p>
131      * Set the access level for subsequent tasks to be performed.
132      * </p>
133      *
134      * @param accesss access level
135      */

136     void setAccess(final int access);
137     /**
138      * <p>
139      * The security session can also be used as a container for items which
140      * should persist as long as the user is logged in.
141      * </p>
142      *
143      * @param name name of the attribute to set.
144      * @param value value for this attribute.
145      */

146     void setAttribute(final String JavaDoc name,
147             final Serializable JavaDoc value);
148 }
149
Popular Tags