org.ow2.jonas.security.internal.realm.principal
Class User

java.lang.Object
  extended by org.ow2.jonas.security.internal.realm.principal.User
All Implemented Interfaces:
Serializable, Principal, UserMBean, JUser
Direct Known Subclasses:
LDAPUser

public class User
extends Object
implements Principal, Serializable, UserMBean, JUser

This class define the User class which represent a user by its name, password, etc.

Author:
Florent Benoit (initial developer), Alexandre Thaveau (add DN for the certificates in method setName), Marc-Antoine Bourgeot (add DN for the certificates in method setName)
See Also:
Serialized Form

Field Summary
protected static String SEPARATOR
          Separator of the groups/roles
 
Constructor Summary
User()
          Constructor
User(String name, String password)
          Constructor with a given login / password
 
Method Summary
 void addGroup(String group)
          Add the specified group to this user
 void addRole(String role)
          Add a role to this user
 String[] getArrayGroups()
          Get the groups
 String[] getArrayRoles()
          Get the roles
 ArrayList getCombinedRoles()
          Get the combined roles of this user
 String getGroups()
          Get the groups
 HashPassword getHashPassword()
          Set the hashed password of this user
 String getName()
          Get the name of this user
 String getPassword()
          Get the password of this user
 String getRoles()
          Get the roles
 void removeGroup(String group)
          Remove a group from this user
 void removeRole(String role)
          Remove a role from this user
 void setCombinedRoles(ArrayList combinedRoles)
          Set the combined roles of this user
 void setGroups(String groups)
          Set the groups of the user
protected  void setHashPassword(HashPassword hashPassword)
          Set the hashed password of this user
 void setName(String name)
          Set the name of this user
 void setPassword(String password)
          Set the password of this user
 void setRoles(String roles)
          Set the roles of the user
 String toString()
          Use the XML representation of this object
 String toXML()
          String representation of the user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode
 

Field Detail

SEPARATOR

protected static final String SEPARATOR
Separator of the groups/roles

See Also:
Constant Field Values
Constructor Detail

User

public User()
Constructor


User

public User(String name,
            String password)
Constructor with a given login / password

Parameters:
name - the given name
password - the given password
Method Detail

setName

public void setName(String name)
Description copied from interface: JUser
Set the name of this user

Specified by:
setName in interface JUser
Parameters:
name - Name of the user

getName

public String getName()
Description copied from interface: UserMBean
Get the name of this user

Specified by:
getName in interface Principal
Specified by:
getName in interface UserMBean
Specified by:
getName in interface JUser
Returns:
the name of this user

getPassword

public String getPassword()
Description copied from interface: UserMBean
Get the password of this user

Specified by:
getPassword in interface UserMBean
Specified by:
getPassword in interface JUser
Returns:
the password of this user

setPassword

public void setPassword(String password)
Description copied from interface: UserMBean
Set the password of this user

Specified by:
setPassword in interface UserMBean
Specified by:
setPassword in interface JUser
Parameters:
password - password of the user

setHashPassword

protected void setHashPassword(HashPassword hashPassword)
Set the hashed password of this user

Parameters:
hashPassword - hashed password of this user

getHashPassword

public HashPassword getHashPassword()
Description copied from interface: JUser
Set the hashed password of this user

Specified by:
getHashPassword in interface JUser
Returns:
hashPassword hashed password of this user

setGroups

public void setGroups(String groups)
Description copied from interface: JUser
Set the groups of the user

Specified by:
setGroups in interface JUser
Parameters:
groups - the comma separated list of the groups of the user

getGroups

public String getGroups()
Description copied from interface: JUser
Get the groups

Specified by:
getGroups in interface JUser
Returns:
the comma separated list of groups

getArrayGroups

public String[] getArrayGroups()
Description copied from interface: UserMBean
Get the groups

Specified by:
getArrayGroups in interface UserMBean
Specified by:
getArrayGroups in interface JUser
Returns:
the array of the groups

setRoles

public void setRoles(String roles)
Description copied from interface: JUser
Set the roles of the user

Specified by:
setRoles in interface JUser
Parameters:
roles - the comma separated list of the roles of the user

addGroup

public void addGroup(String group)
Description copied from interface: UserMBean
Add the specified group to this user

Specified by:
addGroup in interface UserMBean
Specified by:
addGroup in interface JUser
Parameters:
group - the group to add

addRole

public void addRole(String role)
Description copied from interface: UserMBean
Add a role to this user

Specified by:
addRole in interface UserMBean
Specified by:
addRole in interface JUser
Parameters:
role - the given role

removeGroup

public void removeGroup(String group)
Description copied from interface: UserMBean
Remove a group from this user

Specified by:
removeGroup in interface UserMBean
Specified by:
removeGroup in interface JUser
Parameters:
group - the given group

removeRole

public void removeRole(String role)
Description copied from interface: UserMBean
Remove a role from this user

Specified by:
removeRole in interface UserMBean
Specified by:
removeRole in interface JUser
Parameters:
role - the given role

getRoles

public String getRoles()
Description copied from interface: JUser
Get the roles

Specified by:
getRoles in interface JUser
Returns:
the array of the roles

setCombinedRoles

public void setCombinedRoles(ArrayList combinedRoles)
Description copied from interface: JUser
Set the combined roles of this user

Specified by:
setCombinedRoles in interface JUser
Parameters:
combinedRoles - combined of the user

getCombinedRoles

public ArrayList getCombinedRoles()
Description copied from interface: JUser
Get the combined roles of this user

Specified by:
getCombinedRoles in interface JUser
Returns:
the combined of the user

getArrayRoles

public String[] getArrayRoles()
Description copied from interface: UserMBean
Get the roles

Specified by:
getArrayRoles in interface UserMBean
Specified by:
getArrayRoles in interface JUser
Returns:
the array of the roles

toXML

public String toXML()
Description copied from interface: JUser
String representation of the user

Specified by:
toXML in interface JUser
Returns:
the xml representation of the user

toString

public String toString()
Use the XML representation of this object

Specified by:
toString in interface Principal
Overrides:
toString in class Object
Returns:
the XML representation of this object


Copyright © 2010 OW2 Consortium. All Rights Reserved.