Source code: com/RuntimeCollective/webapps/bean/User.java
1 /* $Header: /home/CVS/rjp/src/com/RuntimeCollective/webapps/bean/User.java,v 1.13 2003/09/30 15:13:10 joe Exp $
2 * $Revision: 1.13 $
3 * $Date: 2003/09/30 15:13:10 $
4 *
5 * ====================================================================
6 *
7 * Josephine : http://www.runtime-collective.com/josephine/index.html
8 *
9 * Copyright (C) 2003 Runtime Collective
10 *
11 * This product includes software developed by the
12 * Apache Software Foundation (http://www.apache.org/).
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30 package com.RuntimeCollective.webapps.bean;
31
32 import java.sql.SQLException;
33 import java.io.IOException;
34 import java.util.Date;
35
36 import com.RuntimeCollective.webapps.bean.EntityBean;
37
38 /** Interface for all objects that represent a registered user of a Runtime Webapp.
39 * SimpleUser provides a basic implementation of this interface.
40 * Different modules will want to add to the properties of a user: the school module has Students and Staff, the content management system will have Authors etc. These should be implemented as wrappers of User that implement the Actor interface.
41 *
42 * @see com.RuntimeCollective.webapps.bean.SimpleUser
43 * @see com.RuntimeCollective.webapps.bean.Actor
44 * @version $Id: User.java,v 1.13 2003/09/30 15:13:10 joe Exp $
45 */
46 public interface User extends EntityBean {
47
48 /** Not sure we need this, but EBS complains otherwise */
49 public static String DATABASE_TABLE = "global_object";
50
51 public void setEmail ( String email );
52 public String getEmail ( );
53 public void setPassword ( String password );
54 public String getPassword ( );
55 public String getFirstName ( );
56 public void setFirstName (String firstName);
57 public String getLastName ( );
58 public void setLastName (String lastName);
59 public void setCreateDate ( Date createDate );
60 public Date getCreateDate ( );
61 public void setRoles (int[] roles);
62 public int[] getRoles ();
63 public boolean hasRole (int role);
64 public void setAddress (Address address);
65 public Address getAddress ();
66
67 public void addRole (int role) throws SQLException;
68 public void removeRole(int role) throws SQLException;
69
70 /** Get the value of an attribute. Note that these attributes held on here should be relevant to all users of the system, such as bookmarks or webfolders. If there is an attribute that is specific to a particular type of user, or actor, then it should be held on the relevant Actor object. */
71 public Object getAttribute( String name );
72
73 /** Set the value of an attribute. Note that these attributes held on here should be relevant to all users of the system, such as bookmarks or webfolders. If there is an attribute that is specific to a particular type of user, or actor, then it should be held on the relevant Actor object. */
74 public void setAttribute( String name, Object value );
75 }
76
77
78