Class User
- java.lang.Object
-
- org.codehaus.cargo.container.property.User
-
public final class User extends Object
Represent an authenticating user for the Servlet container.
-
-
Constructor Summary
Constructors Constructor Description User()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRole(String role)
void
addRoles(List<String> roles)
static Map<String,List<User>>
createRoleMap(List<User> users)
Create a user map indexed on the roles.boolean
equals(Object userObject)
String
getName()
String
getPassword()
List<String>
getRoles()
int
hashCode()
protected static List<String>
parseRoles(String rolesAsString)
Parse roles defined as a list in the format "role1,role2,...protected static User
parseUser(String userAsString)
Parse a user defined in the format "name:pwd:role1,...roleN".static List<User>
parseUsers(String usersAsString)
Parse a string representing the users (seeServletPropertySet.USERS
.void
setName(String name)
void
setPassword(String password)
Sets the authenticated user password.
-
-
-
Method Detail
-
setName
public void setName(String name)
- Parameters:
name
- the user name
-
getName
public String getName()
- Returns:
- the user name
-
setPassword
public void setPassword(String password)
Sets the authenticated user password.- Parameters:
password
- the user password
-
getPassword
public String getPassword()
- Returns:
- the user password
-
addRole
public void addRole(String role)
- Parameters:
role
- a role attached to this user
-
addRoles
public void addRoles(List<String> roles)
- Parameters:
roles
- a list of roles attached to this user
-
parseUsers
public static List<User> parseUsers(String usersAsString)
Parse a string representing the users (seeServletPropertySet.USERS
.- Parameters:
usersAsString
- the string representing the users- Returns:
- a list of
User
objects
-
parseUser
protected static User parseUser(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 List<String> parseRoles(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
-
-