|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps.bean
Class SimpleUser

java.lang.Objectcom.RuntimeCollective.webapps.bean.SimpleUser
- All Implemented Interfaces:
- EntityBean, java.io.Serializable, User
- Direct Known Subclasses:
- SimpleTrackedUser
- public class SimpleUser
- extends java.lang.Object
- implements User
- extends java.lang.Object
Simple implementation of the User interface representing a user that has an address.
- Version:
- $Id: SimpleUser.java,v 1.32 2003/09/30 15:13:10 joe Exp $
| Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean |
NULL_ID |
| Constructor Summary | |
SimpleUser()
Construct a new blank user, giving it a new unique ID. |
|
SimpleUser(int id)
Get a current user from the RuntimeDataSource, given an id. |
|
| Method Summary | |
void |
addRole(int role)
|
void |
archive()
Archive this bean. |
void |
delete()
Delete this bean from the database. |
static int |
findByEmail(java.lang.String email,
boolean current)
Get the id of a user from the RuntimeDataSource, given an email address. |
Address |
getAddress()
Get the address object of this user. |
java.lang.Object |
getAttribute(java.lang.String name)
Get the value of an attribute. |
java.util.Date |
getCreateDate()
Get the date that the user was registered onto the system. |
java.lang.String |
getEmail()
Get the user's email address -- used as a unique identifier when logging in. |
java.lang.String |
getFirstName()
Get first name |
int |
getId()
Get the user's ID. |
java.lang.String |
getLastName()
Get last name |
static java.lang.String |
getName(int id)
Get the name (first surname) of a user for a particular id. |
java.lang.String |
getPassword()
Get the user's password. |
static java.lang.String |
getProperty(int id,
java.lang.String propertyName)
Get a named property of a user for a particular id. |
int[] |
getRoles()
|
boolean |
hasRole(int role)
|
void |
removeRole(int role)
|
void |
save()
Save this user to the RuntimeDataSource. |
static com.RuntimeCollective.webapps.SearchResults |
searchUsers(com.RuntimeCollective.webapps.form.SearchUserForm form)
Search for current users that match the parameters on the UserSearchForm. |
void |
setAddress(Address address)
Set the address object of this user. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set the value of an attribute. |
void |
setCreateDate(java.util.Date createDate)
Set the date that the user was registered onto the system. |
void |
setEmail(java.lang.String email)
Set the user's email address -- used as a unique identifier when logging in. |
void |
setFirstName(java.lang.String firstName)
Set first name |
void |
setId(int id)
Set the user's ID. |
void |
setLastName(java.lang.String lastName)
Set last name |
void |
setPassword(java.lang.String password)
Set the user's password. |
void |
setRoles(int[] roles)
|
java.lang.String |
toString()
Convert this Object to a human-readable String. |
void |
unArchive()
Unarchive this bean. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
INTERFACE_BEAN
public static final java.lang.String INTERFACE_BEAN
- name of interface used to identify this bean
- See Also:
- Constant Field Values
DATABASE_TABLE
public static final java.lang.String DATABASE_TABLE
- The name of the database table for this bean type.
- See Also:
- Constant Field Values
SELECT_DATE
private static final java.lang.String SELECT_DATE
- See Also:
- Constant Field Values
ARCHIVE_DATE_NULL
private static final java.lang.String ARCHIVE_DATE_NULL
- See Also:
- Constant Field Values
SELECT_ROLES
private static final java.lang.String SELECT_ROLES
- See Also:
- Constant Field Values
private static final java.lang.String EMAIL
- See Also:
- Constant Field Values
PASSWORD
private static final java.lang.String PASSWORD
- See Also:
- Constant Field Values
FIRST
private static final java.lang.String FIRST
- See Also:
- Constant Field Values
SURNAME
private static final java.lang.String SURNAME
- See Also:
- Constant Field Values
ADDRESS_ID
private static final java.lang.String ADDRESS_ID
- See Also:
- Constant Field Values
CREATE_DATE
private static final java.lang.String CREATE_DATE
- See Also:
- Constant Field Values
DELETE_ROLES
private static final java.lang.String DELETE_ROLES
- See Also:
- Constant Field Values
INSERT_ROLE
private static final java.lang.String INSERT_ROLE
- See Also:
- Constant Field Values
COMMA
private static final java.lang.String COMMA
- See Also:
- Constant Field Values
END_PAR
private static final java.lang.String END_PAR
- See Also:
- Constant Field Values
UPDATE
private static final java.lang.String UPDATE
- See Also:
- Constant Field Values
SET_ARCHIVE_DATE
private static final java.lang.String SET_ARCHIVE_DATE
- See Also:
- Constant Field Values
SET_ARCHIVE_DATE_NULL
private static final java.lang.String SET_ARCHIVE_DATE_NULL
- See Also:
- Constant Field Values
WHERE_ID
private static final java.lang.String WHERE_ID
- See Also:
- Constant Field Values
DELETE_WHERE
private static final java.lang.String DELETE_WHERE
- See Also:
- Constant Field Values
SELECT_ID_WHERE_EMAIL
private static final java.lang.String SELECT_ID_WHERE_EMAIL
- See Also:
- Constant Field Values
RESULTS
private static final java.lang.String RESULTS
- See Also:
- Constant Field Values
USER_TABLE
private static final java.lang.String USER_TABLE
- See Also:
- Constant Field Values
ROLE_TABLE
private static final java.lang.String ROLE_TABLE
- See Also:
- Constant Field Values
ADDRESS_TABLE
private static final java.lang.String ADDRESS_TABLE
- See Also:
- Constant Field Values
ROLE_JOIN
private static final java.lang.String ROLE_JOIN
- See Also:
- Constant Field Values
ADDRESS_JOIN
private static final java.lang.String ADDRESS_JOIN
- See Also:
- Constant Field Values
NOT_ARCHIVED_CONDITION
private static final java.lang.String NOT_ARCHIVED_CONDITION
- See Also:
- Constant Field Values
FIRST_LIKE
private static final java.lang.String FIRST_LIKE
- See Also:
- Constant Field Values
SURNAME_LIKE
private static final java.lang.String SURNAME_LIKE
- See Also:
- Constant Field Values
CITY_LIKE
private static final java.lang.String CITY_LIKE
- See Also:
- Constant Field Values
COUNTRY_LIKE
private static final java.lang.String COUNTRY_LIKE
- See Also:
- Constant Field Values
NATIONALITY_LIKE
private static final java.lang.String NATIONALITY_LIKE
- See Also:
- Constant Field Values
EMAIL_LIKE
private static final java.lang.String EMAIL_LIKE
- See Also:
- Constant Field Values
POSTCODE_LIKE
private static final java.lang.String POSTCODE_LIKE
- See Also:
- Constant Field Values
SELECT
private static final java.lang.String SELECT
- See Also:
- Constant Field Values
FROM
private static final java.lang.String FROM
- See Also:
- Constant Field Values
WHERE
private static final java.lang.String WHERE
- See Also:
- Constant Field Values
ORDER_BY
private static final java.lang.String ORDER_BY
- See Also:
- Constant Field Values
LIKE_AND
private static final java.lang.String LIKE_AND
- See Also:
- Constant Field Values
AND
private static final java.lang.String AND
- See Also:
- Constant Field Values
NOTHING
private static final java.lang.String NOTHING
- See Also:
- Constant Field Values
ESC
private static final java.lang.String ESC
- See Also:
- Constant Field Values
id
protected int id
- ID
protected java.lang.String email
- Email address -- used as a unique identifier when logging in.
password
protected java.lang.String password
- Password.
createDate
protected java.util.Date createDate
- The date that the user was registered onto the system.
roles
protected int[] roles
firstName
protected java.lang.String firstName
- First name
lastName
protected java.lang.String lastName
- Last name
address
protected Address address
- The address object of this user.
attributes
public java.util.Hashtable attributes
- The attributes of this user.
| Constructor Detail |
SimpleUser
public SimpleUser()
throws java.sql.SQLException
- Construct a new blank user, giving it a new unique ID.
This will also create a new Address object for this user.
SimpleUser
public SimpleUser(int id)
throws java.sql.SQLException
- Get a current user from the RuntimeDataSource, given an id.
| Method Detail |
save
public void save()
throws java.sql.SQLException
- Save this user to the RuntimeDataSource.
- Specified by:
savein interfaceEntityBean
archive
public void archive()
throws java.sql.SQLException
- Archive this bean.
unArchive
public void unArchive()
throws java.sql.SQLException
- Unarchive this bean.
delete
public void delete()
throws java.sql.SQLException
- Delete this bean from the database.
- Specified by:
deletein interfaceEntityBean
getId
public int getId()
- Get the user's ID.
- Specified by:
getIdin interfaceEntityBean
setId
public void setId(int id)
- Set the user's ID.
- Specified by:
setIdin interfaceEntityBean
getEmail
public java.lang.String getEmail()
- Get the user's email address -- used as a unique identifier when logging in.
setEmail
public void setEmail(java.lang.String email)
- Set the user's email address -- used as a unique identifier when logging in.
getPassword
public java.lang.String getPassword()
- Get the user's password.
- Specified by:
getPasswordin interfaceUser
setPassword
public void setPassword(java.lang.String password)
- Set the user's password.
- Specified by:
setPasswordin interfaceUser
setCreateDate
public void setCreateDate(java.util.Date createDate)
- Set the date that the user was registered onto the system.
- Specified by:
setCreateDatein interfaceUser
getCreateDate
public java.util.Date getCreateDate()
- Get the date that the user was registered onto the system.
- Specified by:
getCreateDatein interfaceUser
getRoles
public int[] getRoles()
setRoles
public void setRoles(int[] roles)
hasRole
public boolean hasRole(int role)
getFirstName
public java.lang.String getFirstName()
- Get first name
- Specified by:
getFirstNamein interfaceUser
setFirstName
public void setFirstName(java.lang.String firstName)
- Set first name
- Specified by:
setFirstNamein interfaceUser
getLastName
public java.lang.String getLastName()
- Get last name
- Specified by:
getLastNamein interfaceUser
setLastName
public void setLastName(java.lang.String lastName)
- Set last name
- Specified by:
setLastNamein interfaceUser
getAddress
public Address getAddress()
- Get the address object of this user.
- Specified by:
getAddressin interfaceUser
setAddress
public void setAddress(Address address)
- Set the address object of this user.
- Specified by:
setAddressin interfaceUser
searchUsers
public static com.RuntimeCollective.webapps.SearchResults searchUsers(com.RuntimeCollective.webapps.form.SearchUserForm form) throws java.sql.SQLException
- Search for current users that match the parameters on the UserSearchForm.
The search form must be validated before this method is called.
addRole
public void addRole(int role)
throws java.sql.SQLException
removeRole
public void removeRole(int role)
throws java.sql.SQLException
- Specified by:
removeRolein interfaceUser
findByEmail
public static int findByEmail(java.lang.String email, boolean current) throws java.sql.SQLException
- Get the id of a user from the RuntimeDataSource, given an email address.
getName
public static java.lang.String getName(int id) throws java.sql.SQLException
- Get the name (first surname) of a user for a particular id.
getProperty
public static java.lang.String getProperty(int id, java.lang.String propertyName) throws java.sql.SQLException
- Get a named property of a user for a particular id.
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- Get the value of an attribute.
These attributes are *not* saved.
Null is returned if the attribute for this name has not been. 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.- Specified by:
getAttributein interfaceUser
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
- Set the value of an attribute.
These attributes are *not* saved.
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.- Specified by:
setAttributein interfaceUser
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.webapps.bean.SimpleUser