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 voidaddRole(String role)voidaddRoles(List<String> roles)static Map<String,List<User>>createRoleMap(List<User> users)Create a user map indexed on the roles.booleanequals(Object userObject)StringgetName()StringgetPassword()List<String>getRoles()inthashCode()protected static List<String>parseRoles(String rolesAsString)Parse roles defined as a list in the format "role1,role2,...protected static UserparseUser(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.voidsetName(String name)voidsetPassword(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
Userobjects
-
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
-
-