userman
Class User

java.lang.Object
  extended by userman.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

This User class models Environmental Simulation Project web application users. Some of the User class properties correspond directly to the columns of the users database table:

Property Type Table Column
userId Integer userid
userName String name
hashedPassword byte[] password
accessLevel Integer accesslevel
firstName String first_name
lastName String last_name
email String email
institution String institution
title String title
session String session

Other properties are boolean convenience properties for determining the user's access level:

Property True If
guest accessLevel==0
readOnly accessLevel==1
readWrite accessLevel==2
suspended accessLevel==3
pending accessLevel==4
admin accessLevel==10

This class has a default constructor. Fields are populated by calls to setters.

This class does not represent a managed bean. It is best employed as a property of a managed bean such as UserManager.

See Also:
Serialized Form

Constructor Summary
User()
           
 
Method Summary
 int getAccessLevel()
          Getter for the accessLevel property.
 java.lang.String getEmail()
          Getter for the email property.
 java.lang.String getFirstName()
          Getter for the firstName property.
 byte[] getHashedPassword()
          Getter for the hashedPassword property.
 java.lang.String getInstitution()
          Getter for the institution property.
 java.lang.String getLastName()
          Getter for the lastName property.
 java.lang.String getPassword()
          Getter for the password property.
 java.lang.String getSession()
          Getter for the session property.
 java.lang.String getTitle()
          Getter for the title property.
 int getUserId()
          Getter for the userId property.
 java.lang.String getUserName()
          Getter for the userName property.
 boolean isAdmin()
          Getter for the admin property.
 boolean isGuest()
          Getter for the guest property.
 boolean isPending()
          Getter for the pending property.
 boolean isReadOnly()
          Getter for the readOnly property.
 boolean isReadWrite()
          Getter for the readWrite property.
 boolean isSuspended()
          Getter for the suspended property.
 void setAccessLevel(int accessLevel)
          Setter for the accessLevel property.
 void setEmail(java.lang.String email)
          Setter for the email property.
 void setFirstName(java.lang.String firstName)
          Setter for the firstName property.
 void setHashedPassword(byte[] hashedPassword)
          Setter for the hashedPassword property.
 void setInstitution(java.lang.String institution)
          Setter for the institution property.
 void setLastName(java.lang.String lastName)
          Setter for the lastName property.
 void setPassword(java.lang.String password)
          Setter for the password property.
 void setSession(java.lang.String session)
          Setter for the session property.
 void setTitle(java.lang.String title)
          Setter for the title property.
 void setUserId(int userId)
          Setter for the userId property.
 void setUserName(java.lang.String userName)
          Setter for the userName property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User()
Method Detail

isGuest

public boolean isGuest()
Getter for the guest property.

Returns:
true if user's access level is 0

isReadOnly

public boolean isReadOnly()
Getter for the readOnly property.

Returns:
true if user's access level is 1

isReadWrite

public boolean isReadWrite()
Getter for the readWrite property.

Returns:
true if user's access level is 2

isSuspended

public boolean isSuspended()
Getter for the suspended property.

Returns:
true if user's access level is 3

isPending

public boolean isPending()
Getter for the pending property.

Returns:
true if user's access level is 4

isAdmin

public boolean isAdmin()
Getter for the admin property.

Returns:
true if user's access level is 10

getEmail

public java.lang.String getEmail()
Getter for the email property.

Returns:
user's email address

setEmail

public void setEmail(java.lang.String email)
Setter for the email property.

Parameters:
email - the user's email address

getAccessLevel

public int getAccessLevel()
Getter for the accessLevel property.

Returns:
user's access level

setAccessLevel

public void setAccessLevel(int accessLevel)
Setter for the accessLevel property.

Parameters:
accessLevel - the user's access level

getFirstName

public java.lang.String getFirstName()
Getter for the firstName property.

Returns:
user's first name

setFirstName

public void setFirstName(java.lang.String firstName)
Setter for the firstName property.

Parameters:
firstName - the user's first name

getInstitution

public java.lang.String getInstitution()
Getter for the institution property.

Returns:
user's institution

setInstitution

public void setInstitution(java.lang.String institution)
Setter for the institution property.

Parameters:
institution - the user's institution

getLastName

public java.lang.String getLastName()
Getter for the lastName property.

Returns:
user's last name

setLastName

public void setLastName(java.lang.String lastName)
Setter for the lastName property.

Parameters:
lastName - the user's last name

getPassword

public java.lang.String getPassword()
Getter for the password property.

Returns:
user's submitted password

setPassword

public void setPassword(java.lang.String password)
Setter for the password property.

Parameters:
password - the user's submitted password

getHashedPassword

public byte[] getHashedPassword()
Getter for the hashedPassword property.

Returns:
user's hashed password

setHashedPassword

public void setHashedPassword(byte[] hashedPassword)
Setter for the hashedPassword property.

Parameters:
hashedPassword - the user's hashed password

getSession

public java.lang.String getSession()
Getter for the session property.

Returns:
user's session object

setSession

public void setSession(java.lang.String session)
Setter for the session property.

Parameters:
session - the user's session object

getTitle

public java.lang.String getTitle()
Getter for the title property.

Returns:
user's title

setTitle

public void setTitle(java.lang.String title)
Setter for the title property.

Parameters:
title - the user's title

getUserId

public int getUserId()
Getter for the userId property.

Returns:
user's database ID

setUserId

public void setUserId(int userId)
Setter for the userId property.

Parameters:
userId - the user's database ID

getUserName

public java.lang.String getUserName()
Getter for the userName property.

Returns:
user's login name

setUserName

public void setUserName(java.lang.String userName)
Setter for the userName property.

Parameters:
userName - the user's login name