KickJava   Java API By Example, From Geeks To Geeks.

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


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

76 package com.ivata.groupware.admin.security.server;
77
78 import java.io.Serializable JavaDoc;
79
80 import com.ivata.groupware.admin.security.user.UserDO;
81 import com.ivata.mask.util.SystemException;
82
83 /**
84  * You must define a class which implements this interface, and set it as
85  * in the setting <code>securitySessionServer</code>.
86  *
87  * @author Colin MacLeod
88  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
89  */

90 public interface SecurityServer extends Serializable JavaDoc {
91     /**
92      * Add a new user to the system.
93      *
94      * @param userName user name to add.
95      * @param fullName full name under which the user will be filed.
96      * @throws BusinessException if this user cannot be added.
97      */

98     void addUser(final SecuritySession securitySession,
99             final String JavaDoc userName,
100             final String JavaDoc fullName)
101         throws SystemException;
102
103     /**
104      * Check the password for a user is correct.
105      *
106      * @param userName name of the user for whom to check the password.
107      * @param password the new password value to check against the system.
108      * @throws BusinessException if the password cannot be checked for any
109      * reason.
110      */

111     void checkPassword(final SecuritySession securitySession,
112             final String JavaDoc userName,
113             final String JavaDoc password)
114         throws SystemException;
115
116     String JavaDoc getSystemUserName(final SecuritySession securitySession,
117             final String JavaDoc userName);
118     String JavaDoc getUserNameFromSystemUserName(final SecuritySession securitySession,
119             final String JavaDoc systemUserName);
120
121     /**
122      * Find out if a user name is used or not.
123      * @param user user to check
124      * @throws SystemException if the user name cannot be checked for any
125      * reason.
126      */

127     boolean isUser(final SecuritySession securitySession,
128             final String JavaDoc userName)
129             throws SystemException;
130
131     /**
132      * Login to an authentication server using the user name and password
133      * provided.
134      *
135      * @param user user to login to the server.
136      * @param password used to login to the server
137      * @return valid session for this username password combination.
138      * @throws BusinessException if this user cannot be authenticated.
139      */

140     SecuritySession login(final UserDO user,
141             final String JavaDoc password)
142         throws SystemException;
143
144     /**
145      * Login as a guest user to an authentication server.
146      *
147      * @return valid session for the guest user.
148      * @throws BusinessException if this user cannot be authenticated.
149      */

150     SecuritySession loginGuest()
151         throws SystemException;
152
153     /**
154      * <p>Remove the user with the given name from the system.</p>
155      *
156      * @param userName name of the user to be removed.
157      * @throws BusinessException if this user cannot be removed.
158      */

159     void removeUser(final SecuritySession securitySession,
160             final String JavaDoc userName)
161         throws SystemException;
162
163     /**
164      * Set the password for a user.
165      *
166      * @param userName name of the user for whom to set the password.
167      * @param password the new password value to set.
168      * @throws BusinessException if the password cannot be set for any
169      * reason.
170      */

171     void setPassword(final SecuritySession securitySession,
172             final String JavaDoc userName,
173             final String JavaDoc password)
174         throws SystemException;
175
176 }
177
Popular Tags