com.monad.homerun.base
Class User

java.lang.Object
  extended by com.monad.homerun.base.User
All Implemented Interfaces:
java.io.Serializable

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

User is the class containing homerun user information. A user represents a person or other entity that interacts with the software - this is not the same as users represented in the software, although they frequently overlap.

See Also:
Serialized Form

Field Summary
static java.lang.String ADMIN
           
static int ADMIN_ROLE
           
static java.lang.String ANON_USER
           
static int EDIT_ROLE
           
static java.lang.String EDITOR
           
static java.lang.String OTHER
           
static int OTHER_ROLE
           
static java.lang.String USER
           
static int USER_ROLE
           
 
Constructor Summary
User()
           
User(java.lang.String name)
           
 
Method Summary
 void addRole(int role)
           
 long getCreateTime()
          Returns the time the user account was created
 long getExpireTime()
          Returns the expiration time of the user account
 java.lang.String getName()
          Returns the userName
 java.lang.String getPassword()
          Returns the user's password
 int getRoles()
          Returns the user's roles
 boolean hasRole(int role)
          Tests whether user has designated role
 void setCreateTime(long time)
           
 void setExpireTime(long time)
           
 void setPassword(java.lang.String password)
           
 void setRoles(int roles)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANON_USER

public static final java.lang.String ANON_USER
See Also:
Constant Field Values

ADMIN_ROLE

public static final int ADMIN_ROLE
See Also:
Constant Field Values

EDIT_ROLE

public static final int EDIT_ROLE
See Also:
Constant Field Values

USER_ROLE

public static final int USER_ROLE
See Also:
Constant Field Values

OTHER_ROLE

public static final int OTHER_ROLE
See Also:
Constant Field Values

ADMIN

public static final java.lang.String ADMIN
See Also:
Constant Field Values

EDITOR

public static final java.lang.String EDITOR
See Also:
Constant Field Values

USER

public static final java.lang.String USER
See Also:
Constant Field Values

OTHER

public static final java.lang.String OTHER
See Also:
Constant Field Values
Constructor Detail

User

public User()

User

public User(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Returns the userName

Returns:
name the user name relative to this site

getCreateTime

public long getCreateTime()
Returns the time the user account was created

Returns:
createTime the time the user account was created

setCreateTime

public void setCreateTime(long time)

getExpireTime

public long getExpireTime()
Returns the expiration time of the user account

Returns:
expireTime when the user account expires, or -1 for permanent accounts

setExpireTime

public void setExpireTime(long time)

getPassword

public java.lang.String getPassword()
Returns the user's password

Returns:
password the unencrypted password

setPassword

public void setPassword(java.lang.String password)

getRoles

public int getRoles()
Returns the user's roles

Returns:
an integer mask with all user's roles

setRoles

public void setRoles(int roles)

hasRole

public boolean hasRole(int role)
Tests whether user has designated role

Parameters:
role - the homerun role
Returns:
result true if user has role, false otherwise

addRole

public void addRole(int role)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.