org.codehaus.cargo.container.property
Class User

java.lang.Object
  extended by org.codehaus.cargo.container.property.User

public final class User
extends java.lang.Object

Represent an authenticating user for the Servlet container.

Version:
$Id: User.java 987 2006-04-04 07:50:16Z vmassol $

Constructor Summary
User()
           
 
Method Summary
 void addRole(java.lang.String role)
           
 void addRoles(java.util.List roles)
           
static java.util.Map createRoleMap(java.util.List users)
          Create a user map indexed on the roles.
 boolean equals(java.lang.Object userObject)
          
 java.lang.String getName()
           
 java.lang.String getPassword()
           
 java.util.List getRoles()
           
 int hashCode()
          
protected static java.util.List parseRoles(java.lang.String rolesAsString)
          Parse roles defined as a list in the format "role1,role2,...,roleN".
protected static User parseUser(java.lang.String userAsString)
          Parse a user defined in the format "name:pwd:role1,...roleN".
static java.util.List parseUsers(java.lang.String usersAsString)
          Parse a string representing the users (see ServletPropertySet.USERS.
 void setName(java.lang.String name)
           
 void setPassword(java.lang.String password)
          Sets the authenticated user password.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User()
Method Detail

setName

public void setName(java.lang.String name)
Parameters:
name - the user name

getName

public java.lang.String getName()
Returns:
the user name

setPassword

public void setPassword(java.lang.String password)
Sets the authenticated user password.

Parameters:
password - the user password

getPassword

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

addRole

public void addRole(java.lang.String role)
Parameters:
role - a role attached to this user

addRoles

public void addRoles(java.util.List roles)
Parameters:
roles - a list of roles attached to this user

getRoles

public java.util.List getRoles()
Returns:
the list of roles attached to this user

equals

public boolean equals(java.lang.Object userObject)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

parseUsers

public static java.util.List parseUsers(java.lang.String usersAsString)
Parse a string representing the users (see ServletPropertySet.USERS.

Parameters:
usersAsString - the string representing the users
Returns:
a list of User objects

parseUser

protected static User parseUser(java.lang.String userAsString)
Parse a user defined in the format "name:pwd:role1,...roleN".

Parameters:
userAsString - the user defines as a string
Returns:
the parsed user

parseRoles

protected static java.util.List parseRoles(java.lang.String rolesAsString)
Parse roles defined as a list in the format "role1,role2,...,roleN".

Parameters:
rolesAsString - the roles defined as a string
Returns:
the parsed list of roles

createRoleMap

public static java.util.Map createRoleMap(java.util.List users)
Create a user map indexed on the roles.

Parameters:
users - list of User for which to extract roles from
Returns:
a map of roles containing users


Copyright © 2004-2009 Codehaus. All Rights Reserved.