org.pentaho.platform.engine.security.userroledao
Class PentahoUser

java.lang.Object
  extended by org.pentaho.platform.engine.security.userroledao.PentahoUser
All Implemented Interfaces:
Serializable, IPentahoUser

public class PentahoUser
extends Object
implements IPentahoUser

A user of the Pentaho platform. Contains a set of roles for which this user is a member.

Note that roles are not considered during equals comparisons and hashCode calculations. This is because instances are sometimes stored in Java collections. The roles set is mutable and we don't want two users that have the same username but different roles in the same set.

Author:
mlowery
See Also:
PentahoRole, Serialized Form

Constructor Summary
PentahoUser(IPentahoUser userToCopy)
          Copy constructor
PentahoUser(String username)
           
PentahoUser(String username, String password, String description, boolean enabled)
           
 
Method Summary
 boolean addRole(IPentahoRole role)
           
 void clearRoles()
           
 boolean equals(Object obj)
           
 String getDescription()
           
 String getPassword()
           
 Set<IPentahoRole> getRoles()
           
 String getUsername()
           
 int hashCode()
           
 boolean isEnabled()
           
 boolean removeRole(IPentahoRole role)
           
 void setDescription(String description)
           
 void setEnabled(boolean enabled)
           
 void setPassword(String password)
           
 void setRoles(Set<IPentahoRole> roles)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PentahoUser

public PentahoUser(String username)

PentahoUser

public PentahoUser(String username,
                   String password,
                   String description,
                   boolean enabled)

PentahoUser

public PentahoUser(IPentahoUser userToCopy)
Copy constructor

Method Detail

getUsername

public String getUsername()
Specified by:
getUsername in interface IPentahoUser

getPassword

public String getPassword()
Specified by:
getPassword in interface IPentahoUser

setPassword

public void setPassword(String password)
Specified by:
setPassword in interface IPentahoUser

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface IPentahoUser

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface IPentahoUser

setRoles

public void setRoles(Set<IPentahoRole> roles)
Specified by:
setRoles in interface IPentahoUser

getRoles

public Set<IPentahoRole> getRoles()
Specified by:
getRoles in interface IPentahoUser

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getDescription

public String getDescription()
Specified by:
getDescription in interface IPentahoUser

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface IPentahoUser

toString

public String toString()
Overrides:
toString in class Object

addRole

public boolean addRole(IPentahoRole role)
Specified by:
addRole in interface IPentahoUser
Returns:
Same meaning as Set.add return value.

removeRole

public boolean removeRole(IPentahoRole role)
Specified by:
removeRole in interface IPentahoUser
Returns:
Same meaning as Set.remove return value.

clearRoles

public void clearRoles()
Specified by:
clearRoles in interface IPentahoUser