|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openlaszlo.lzproject.model.PersistenceBaseClass
org.openlaszlo.lzproject.model.User
public class User
Class User is the representation of a user in the model.
Field Summary | |
---|---|
private java.lang.String |
email
The email. |
private int |
id
The user id, the primary key value in the DB table. |
private java.util.Date |
lastLogin
Last login date and time. |
private org.apache.log4j.Logger |
log
Log4J logger. |
private java.lang.String |
login
The login or user name. |
private java.lang.String |
password
MD5 hash of the user's password. |
private java.lang.String |
realName
User's real name. |
private static long |
serialVersionUID
serialVersionUID used for serialization. |
Fields inherited from class org.openlaszlo.lzproject.model.PersistenceBaseClass |
---|
bundle, conn, dbName, realPath |
Constructor Summary | |
---|---|
User()
Defaul constructor for User class. |
|
User(java.lang.String path)
Constructor for User class. |
Method Summary | |
---|---|
private boolean |
authorize(java.lang.String checksum)
Compare the MD5 hash passed to this method with the user's password hash. |
RestServiceResult |
create(RestServiceResult result)
Create a new user in the database. |
RestServiceResult |
deleteByLogin(RestServiceResult result)
Delete a user by login name. |
java.lang.String |
getEmail()
Getter for email. |
int |
getId()
Getter for user id. |
java.util.Date |
getLastLogin()
Getter for last login. |
java.lang.String |
getLogin()
Getter for login. |
java.lang.String |
getPassword()
Getter for password (MD5 hashed) |
java.lang.String |
getRealName()
Getter for real name. |
RestServiceResult |
login(javax.servlet.http.HttpSession session,
RestServiceResult result)
Handle a user login request. |
RestServiceResult |
logout(javax.servlet.http.HttpSession session,
RestServiceResult result)
Handle a logout request. |
private java.lang.String |
md5(java.lang.String pass)
Generate an MD5 hash for the string passed to the method. |
void |
setEmail(java.lang.String email)
Setter for email. |
void |
setId(int id)
Setter for user id. |
void |
setLastLogin(java.util.Date lastLogin)
Setter for last login. |
void |
setLogin(java.lang.String login)
Setter for login. |
void |
setPassword(java.lang.String password)
Setter for password. |
void |
setRealName(java.lang.String realName)
Setter for real name. |
private java.lang.String |
toHexString(byte b)
Convert a byte into a hexadezimal string representation. |
RestServiceResult |
update(RestServiceResult result)
Update a users data. |
Methods inherited from class org.openlaszlo.lzproject.model.PersistenceBaseClass |
---|
dbConnect, dbDisconnect, getBundle, handleSQLError, setBundle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private int id
private java.lang.String realName
private java.lang.String login
private java.lang.String email
private transient org.apache.log4j.Logger log
private java.lang.String password
private java.util.Date lastLogin
Constructor Detail |
---|
public User()
public User(java.lang.String path)
path
- The real path to the WEB-INF folder.Method Detail |
---|
public RestServiceResult create(RestServiceResult result)
In case of failure the error is passed back contained in the
RestServiceResult
returned.
result
- The RestServiceResult
which will contain the localized
messages and SQL state.
RestServiceResult
containing the outcome of this
operation.public RestServiceResult update(RestServiceResult result)
In case of failure the error is passed back contained in the
RestServiceResult
returned.
result
- The RestServiceResult
which will contain the localized
messages and SQL state.
RestServiceResult
containing the outcome of this
operation.public RestServiceResult deleteByLogin(RestServiceResult result)
In case of failure the error is passed back contained in the
RestServiceResult
returned.
result
- The RestServiceResult
which will contain the localized
messages and SQL state.
RestServiceResult
containing the outcome of this
operation.public RestServiceResult login(javax.servlet.http.HttpSession session, RestServiceResult result)
In case of failure the error is passed back contained in the
RestServiceResult
returned.
result
- The RestServiceResult
which will contain the localized
messages and SQL state.
RestServiceResult
containing the outcome of this
operation.public RestServiceResult logout(javax.servlet.http.HttpSession session, RestServiceResult result)
In case of failure the error is passed back contained in the
RestServiceResult
returned.
result
- The RestServiceResult
which will contain the localized
messages and SQL state.
RestServiceResult
containing the outcome of this
operation.private boolean authorize(java.lang.String checksum)
checksum
- The MD5 hash of the entered password.
private java.lang.String md5(java.lang.String pass)
pass
- The string for which we need to generate the hash.
private java.lang.String toHexString(byte b)
b
- The byte to be converted.
public int getId()
public void setId(int id)
id
- The new id.public java.lang.String getLogin()
public void setLogin(java.lang.String login)
login
- The new login.public java.lang.String getRealName()
public void setRealName(java.lang.String realName)
realName
- The new real name.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The new password.public java.util.Date getLastLogin()
public void setLastLogin(java.util.Date lastLogin)
lastLogin
- The new last login date and time.public java.lang.String getEmail()
public void setEmail(java.lang.String email)
email
- The new email.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |