001: /*
002: * $Id: SecurityServer.java,v 1.3 2005/10/14 14:01:46 colinmacleod Exp $
003: * Copyright (c) 2001 - 2005 ivata limited.
004: * All rights reserved.
005: * -----------------------------------------------------------------------------
006: * ivata groupware may be redistributed under the GNU General Public
007: * License as published by the Free Software Foundation;
008: * version 2 of the License.
009: *
010: * These programs are free software; you can redistribute them and/or
011: * modify them under the terms of the GNU General Public License
012: * as published by the Free Software Foundation; version 2 of the License.
013: *
014: * These programs are distributed in the hope that they will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
017: *
018: * See the GNU General Public License in the file LICENSE.txt for more
019: * details.
020: *
021: * If you would like a copy of the GNU General Public License write to
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place - Suite 330
025: * Boston, MA 02111-1307, USA.
026: *
027: *
028: * To arrange commercial support and licensing, contact ivata at
029: * http://www.ivata.com/contact.jsp
030: * -----------------------------------------------------------------------------
031: * $Log: SecurityServer.java,v $
032: * Revision 1.3 2005/10/14 14:01:46 colinmacleod
033: * Changed password checking routines to return boolean, rather than throwing
034: * an exception.
035: *
036: * Revision 1.2 2005/04/09 17:19:57 colinmacleod
037: * Changed copyright text to GPL v2 explicitly.
038: *
039: * Revision 1.1.1.1 2005/03/10 17:51:41 colinmacleod
040: * Restructured ivata op around Hibernate/PicoContainer.
041: * Renamed ivata groupware.
042: *
043: * Revision 1.2 2004/11/12 15:57:18 colinmacleod
044: * Removed dependencies on SSLEXT.
045: * Moved Persistence classes to ivata masks.
046: *
047: * Revision 1.1 2004/09/30 15:15:58 colinmacleod
048: * Split off addressbook elements into security subproject.
049: *
050: * Revision 1.4 2004/07/13 19:41:12 colinmacleod
051: * Moved project to POJOs from EJBs.
052: * Applied PicoContainer to services layer (replacing session EJBs).
053: * Applied Hibernate to persistence layer (replacing entity EJBs).
054: *
055: * Revision 1.3 2004/03/21 21:16:05 colinmacleod
056: * Shortened name to ivata op.
057: *
058: * Revision 1.2 2004/03/21 20:16:57 colinmacleod
059: * Changed from class singleton to factory interface.
060: *
061: * Revision 1.1.1.1 2004/01/27 20:57:45 colinmacleod
062: * Moved ivata openportal to SourceForge..
063: *
064: * Revision 1.4 2003/12/16 15:06:09 jano
065: * fixing functionaality
066: *
067: * Revision 1.3 2003/11/13 16:03:15 jano
068: * commitng everything to CVS
069: * can deploy and application is ruuning, can login into
070: *
071: * Revision 1.2 2003/10/17 12:36:12 jano
072: * fixing problems with building
073: * converting intranet -> portal
074: * Eclipse building
075: *
076: * Revision 1.1.1.1 2003/10/13 20:50:07 colin
077: * Restructured portal into subprojects
078: * -----------------------------------------------------------------------------
079: */
080: package com.ivata.groupware.admin.security.server;
081:
082: import java.io.Serializable;
083:
084: import com.ivata.groupware.admin.security.user.UserDO;
085: import com.ivata.mask.util.SystemException;
086:
087: /**
088: * <p>
089: * Instances of this class define how we authenticate and add users to the local
090: * system.
091: * <p>
092: *
093: * @author Colin MacLeod
094: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
095: */
096: public interface SecurityServer extends Serializable {
097: /**
098: * Add a new user to the system.
099: *
100: * @param securitySession Used to authenticate the current user.
101: * @param userName user name to add.
102: * @param fullName full name under which the user will be filed.
103: * @throws SystemException if this user cannot be added.
104: */
105: void addUser(final SecuritySession securitySession,
106: final String userName, final String fullName)
107: throws SystemException;
108:
109: /**
110: * Check the password for a user is correct.
111: *
112: * @param securitySession Used to authenticate the current user.
113: * @param userName name of the user for whom to check the password.
114: * @param password the new password value to check against the system.
115: * @return TODO
116: * @throws SystemException if the password cannot be checked for any
117: * reason.
118: */
119: boolean checkPassword(final SecuritySession securitySession,
120: final String userName, final String password)
121: throws SystemException;
122:
123: /**
124: * <copyDoc>Refer to {@link com.ivata.groupware.admin.security.Security
125: * #getSystemUserName}.</copyDoc>
126: *
127: * @param securitySession Used to authenticate the current user.
128: * @param userName
129: * <copyDoc>Refer to {@link com.ivata.groupware.admin.security.Security
130: * #getSystemUserName}.</copyDoc>
131: * @return
132: * <copyDoc>Refer to {@link com.ivata.groupware.admin.security.Security
133: * #getSystemUserName}.</copyDoc>
134: */
135: String getSystemUserName(final SecuritySession securitySession,
136: final String userName);
137:
138: /**
139: * <copyDoc>Refer to {@link com.ivata.groupware.admin.security.Security
140: * #getUserNameFromSystemUserName}.
141: * </copyDoc>
142: *
143: * @param securitySession Used to authenticate the current user.
144: * @param systemUserName
145: * <copyDoc>Refer to {@link com.ivata.groupware.admin.security.Security
146: * #getUserNameFromSystemUserName}.
147: * </copyDoc>
148: * @return
149: * <copyDoc>Refer to {@link com.ivata.groupware.admin.security.Security
150: * #getUserNameFromSystemUserName}.
151: * </copyDoc>
152: */
153: String getUserNameFromSystemUserName(
154: final SecuritySession securitySession,
155: final String systemUserName);
156:
157: /**
158: * Find out if a user name is used or not.
159: *
160: * @param securitySession Used to authenticate the current user.
161: * @param userName user to check
162: * @throws SystemException if the user name cannot be checked for any
163: * reason.
164: * @return <code>true</code> if there is a user with the name given.
165: */
166: boolean isUser(final SecuritySession securitySession,
167: final String userName) throws SystemException;
168:
169: /**
170: * Login to an authentication server using the user name and password
171: * provided.
172: *
173: * @param user user to login to the server.
174: * @param password used to login to the server
175: * @return valid session for this username password combination.
176: * @throws SystemException if this user cannot be authenticated.
177: */
178: SecuritySession login(final UserDO user, final String password)
179: throws SystemException;
180:
181: /**
182: * Login as a guest user to an authentication server.
183: *
184: * @return valid session for the guest user.
185: * @throws SystemException if this user cannot be authenticated.
186: */
187: SecuritySession loginGuest() throws SystemException;
188:
189: /**
190: * <p>Remove the user with the given name from the system.</p>
191: *
192: * @param securitySession Used to authenticate the current user.
193: * @param userName name of the user to be removed.
194: * @throws SystemException if this user cannot be removed.
195: */
196: void removeUser(final SecuritySession securitySession,
197: final String userName) throws SystemException;
198:
199: /**
200: * Set the password for a user.
201: *
202: * @param securitySession Used to authenticate the current user.
203: * @param userName name of the user for whom to set the password.
204: * @param password the new password value to set.
205: * @throws SystemException if the password cannot be set for any
206: * reason.
207: */
208: void setPassword(final SecuritySession securitySession,
209: final String userName, final String password)
210: throws SystemException;
211:
212: }
|