KickJava   Java API By Example, From Geeks To Geeks.

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


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

44 package com.ivata.groupware.admin.security.server;
45
46 import java.io.Serializable JavaDoc;
47 import java.util.HashMap JavaDoc;
48 import java.util.Map JavaDoc;
49
50 import org.picocontainer.PicoContainer;
51
52 import com.ivata.groupware.admin.security.user.UserDO;
53
54 /**
55  * @author Colin MacLeod
56  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
57  * @since Jun 2, 2004
58  * @version $Revision: 1.2 $
59  */

60 public class TestSecuritySession implements SecuritySession {
61     int access;
62     Map JavaDoc attributes = new HashMap JavaDoc();
63     UserDO user;
64
65     /**
66      */

67     public TestSecuritySession(UserDO user) {
68         super();
69         this.user = user;
70     }
71
72     /**
73      * @see com.ivata.groupware.admin.security.server.SecuritySession#getAttribute(String)
74      */

75     public final Serializable JavaDoc getAttribute(final String JavaDoc name) {
76         return (Serializable JavaDoc) attributes.get(name);
77     }
78
79     /**
80      * @see com.ivata.groupware.admin.security.server.SecuritySession#setAttribute(String, java.io.Serializable)
81      */

82     public final void setAttribute(final String JavaDoc name,
83             final Serializable JavaDoc value) {
84         attributes.put(name, value);
85     }
86
87     /**
88      * @see com.ivata.groupware.admin.security.server.SecuritySession#getUser()
89      */

90     public UserDO getUser() {
91         return user;
92     }
93
94     /**
95      * @see com.ivata.groupware.admin.security.server.SecuritySession#getAccess()
96      */

97     public final int getAccess() {
98         return access;
99     }
100
101     /**
102      * @see com.ivata.groupware.admin.security.server.SecuritySession#setAccess(int)
103      */

104     public final void setAccess(final int access) {
105         this.access = access;
106     }
107
108     /**
109      * @see com.ivata.groupware.admin.security.server.SecuritySession#getContainer()
110      */

111     public final PicoContainer getContainer() {
112         return null;
113     }
114
115     /**
116      * Refer to {@link }.
117      * @see com.ivata.groupware.admin.security.server.SecuritySession#isGuest()
118      * @return
119      */

120     public boolean isGuest() {
121         return false;
122     }
123
124     /**
125      * Refer to {@link SecuritySession#getPassword}.
126      * @return Refer to {@link SecuritySession#getPassword}.
127      */

128     public String JavaDoc getPassword() {
129         return null;
130     }
131
132 }
133
Popular Tags