- public class User
- extends klentry
Represents a vqServer user. Also contains static methods which provide
functionality similar to the vq.server.UserXXX servlets.
Warning: the key field is used to store a unique identifier
and should not be modified.
User()
- Creates a new user.
getAccesses()
- Returns the number of times the user has made an authenticated request since
the user was created.
getAddress()
- Returns the user's postal address.
getCreationTime()
- Returns the time (as returned by System.currentTimeMillis())
the user was created.
getEmail()
- Returns the user's email address.
getID()
- Returns the user's ID.
getLastAccessTime()
- Returns the time (as returned by System.currentTimeMillis())
the user last made an authenticated request.
getName()
- Returns the user's name.
getNote()
- Returns the user's note field.
getPwd()
- Returns the user's password.
getPwdChangedTime()
- Returns the time (as returned by System.currentTimeMillis())
the user's password was last changed.
kill()
- Kills the user (metaphorically).
login(String, String, HttpServletResponse)
- Checks the user ID and password specified against the vqServer user database.
login(String, String, String, HttpServletResponse)
- Checks the user ID and password specified against the vqServer user database
and access control lists.
logout(HttpServletResponse)
- Removes any vqServer authentication cookie from the user's session,
thus logging the user out.
save(vqos)
- Writes the user to the specified output stream in vqServer .cfg file format.
setAddress(String)
- Sets the user's postal address.
setEmail(String)
- Sets the user's email address.
setID(String)
- Sets the user's ID.
setName(String)
- Sets the user's name.
setNote(String)
- Sets the user's note field.
setPwd(String)
- Sets the user's password.
User
public User()
Creates a new user.
kill
public void kill()
Kills the user (metaphorically).
Warning: do not invoke this method if the user
is a member of a list.
- Overrides:
- kill in class klentry
save
public void save(vqos os) throws java.io.IOException
Writes the user to the specified output stream in vqServer .cfg file format.
- Overrides:
- save in class klentry
getID
public java.lang.String getID()
Returns the user's ID.
setID
public void setID(java.lang.String theID)
Sets the user's ID. After using this method,
call Users.remove() and Users.add(User) to maintain the ordering of entries
in Users.
getName
public java.lang.String getName()
Returns the user's name.
setName
public void setName(java.lang.String theName)
Sets the user's name.
getPwd
public java.lang.String getPwd()
Returns the user's password.
setPwd
public void setPwd(java.lang.String thePwd)
Sets the user's password.
getEmail
public java.lang.String getEmail()
Returns the user's email address.
setEmail
public void setEmail(java.lang.String theEmail)
Sets the user's email address.
getAddress
public java.lang.String getAddress()
Returns the user's postal address.
setAddress
public void setAddress(java.lang.String theAddress)
Sets the user's postal address.
getNote
public java.lang.String getNote()
Returns the user's note field.
setNote
public void setNote(java.lang.String theNote)
Sets the user's note field.
getAccesses
public int getAccesses()
Returns the number of times the user has made an authenticated request since
the user was created.
getCreationTime
public long getCreationTime()
Returns the time (as returned by System.currentTimeMillis())
the user was created.
getLastAccessTime
public long getLastAccessTime()
Returns the time (as returned by System.currentTimeMillis())
the user last made an authenticated request.
getPwdChangedTime
public long getPwdChangedTime()
Returns the time (as returned by System.currentTimeMillis())
the user's password was last changed.
login
public static boolean login(java.lang.String userID,
java.lang.String pwd,
javax.servlet.http.HttpServletResponse rep)
Checks the user ID and password specified against the vqServer user database.
Returns true if the ID and password are valid and adds a vqServer authentication cookie to the
response so that the users doesn't have to keep filling in a password dialog.
The response parameter can be null.
login
public boolean login(java.lang.String userID,
java.lang.String pwd,
java.lang.String aclKey,
javax.servlet.http.HttpServletResponse rep)
Checks the user ID and password specified against the vqServer user database
and access control lists.
Returns true if the ID and password are valid AND the user belongs to the
specified access control list and adds a vqServer authentication cookie to the
response so that the users doesn't have to keep filling in a password dialog.
The response parameter can be null.
logout
public void logout(javax.servlet.http.HttpServletResponse rep)
Removes any vqServer authentication cookie from the user's session,
thus logging the user out.