|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.slamd.db.SLAMDUser
public class SLAMDUser
This class defines a set of information about a user defined in the SLAMD database, including the username and hashed password, the default folder, and the set of groups in which the user is a member.
| Field Summary | |
|---|---|
static java.lang.String |
ELEMENT_DEFAULT_FOLDER
The name of the encoded element that holds the name of the default folder for this user. |
static java.lang.String |
ELEMENT_GROUPS
The name of the encoded element that holds the groups names associated with this user. |
static java.lang.String |
ELEMENT_HASHED_PASSWORD
The name of the encoded element that holds the hashed password for this user. |
static java.lang.String |
ELEMENT_IS_ADMIN
The name of the encoded element that indicates whether this user is an administrator. |
static java.lang.String |
ELEMENT_USER_NAME
The name of the encoded element that holds the user name for this user. |
| Constructor Summary | |
|---|---|
SLAMDUser(java.lang.String userName,
byte[] hashedPassword,
java.lang.String[] groupNames,
boolean isAdmin,
java.lang.String defaultFolder)
Creates a new user with the provided information. |
|
| Method Summary | |
|---|---|
void |
addGroupName(java.lang.String groupName)
Adds the provided group name to the set of groups associated with this user. |
boolean |
checkPassword(java.lang.String password)
Determines whether the provided clear-text password is the correct password for this user. |
static SLAMDUser |
decode(byte[] encodedUser)
Decodes the provided byte array as information about a user. |
byte[] |
encode()
Encodes the information for this user into a byte array. |
java.lang.String |
getDefaultFolder()
Retrieves the name of the default folder for this user. |
java.lang.String[] |
getGroupNames()
Retrieves the names of the groups in which this user is a member. |
java.lang.String |
getUserName()
Retrieves the user name for this user. |
boolean |
isAdmin()
Indicates whether this user is an administrator with full rights. |
boolean |
memberOf(java.lang.String groupName)
Determines whether this user is a member of the specified group. |
void |
removeGroupName(java.lang.String groupName)
Removes the provided group name from the set of groups associated with this user. |
void |
setAdmin(boolean isAdmin)
Specifies whether this user is an administrator. |
void |
setDefaultFolder(java.lang.String defaultFolder)
Specifies the name of the default folder for this user. |
void |
setGroupNames(java.lang.String[] groupNames)
Specifies the names of the groups in which this user is a member. |
void |
setPassword(java.lang.String password)
Specifies the password to use for the user. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ELEMENT_DEFAULT_FOLDER
public static final java.lang.String ELEMENT_GROUPS
public static final java.lang.String ELEMENT_HASHED_PASSWORD
public static final java.lang.String ELEMENT_IS_ADMIN
public static final java.lang.String ELEMENT_USER_NAME
| Constructor Detail |
|---|
public SLAMDUser(java.lang.String userName,
byte[] hashedPassword,
java.lang.String[] groupNames,
boolean isAdmin,
java.lang.String defaultFolder)
userName - The user name for this user.hashedPassword - The SHA-1 hash of the password for this user.groupNames - The names of the groups in which this user is a
member.isAdmin - Indicates whether this user is an administrator.defaultFolder - The default folder for this user.| Method Detail |
|---|
public java.lang.String getUserName()
public boolean checkPassword(java.lang.String password)
password - The clear-text password to validate for this user.
true if the provided password is correct, or
false if not.public void setPassword(java.lang.String password)
password - The password to use for the user.public java.lang.String[] getGroupNames()
public boolean memberOf(java.lang.String groupName)
groupName - The name of the group for which to make the
determination.
true if this user is a member of the specified group,
or false if not.public void setGroupNames(java.lang.String[] groupNames)
groupNames - The names of the groups in which this user is a member.public void addGroupName(java.lang.String groupName)
groupName - The name of the group to add to the set of groups for
this user.public void removeGroupName(java.lang.String groupName)
groupName - The name of the group to remove from the set of groups
for this user.public boolean isAdmin()
true if this user is an administrator, or
false if not.public void setAdmin(boolean isAdmin)
isAdmin - Specifies whether this user is an administrator.public java.lang.String getDefaultFolder()
public void setDefaultFolder(java.lang.String defaultFolder)
defaultFolder - The name of the default folder for this user.public byte[] encode()
public static SLAMDUser decode(byte[] encodedUser)
throws DecodeException
encodedUser - The byte array containing the encoded user
information.
DecodeException - If a problem occurs while trying to decode the
provided byte array.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||