|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.strangelight.db.TableRow | +--com.strangelight.db.KeyedRow | +--com.strangelight.db.User
This class encapsulates a user of the strangelight.com system.
Persistent information about this user is stored in the strangelight
database. Changes made to a User
object will be
transferred to persistent storage in the database when the object is
garbage-collected, or when the object's commit()
method is called.
UserServlet
Constructor Summary | |
User()
Creates a new User object, which will be
transferred to persistent storage in the database when this
User object is garbage-collected, or when this
User object's commit()
method is called. |
|
User(int uid)
Attempts to fetch a User object from the database
given a user's numerical id. |
|
User(int uid,
Cleartext password)
Attempts to fetch a User object from the database,
given a user's numerical id and (cleartext) password. |
|
User(int uid,
Cryptword password)
Attempts to fetch a User object from the database,
given a user's numerical id and (encrypted) password. |
|
User(java.lang.Integer uid)
Attempts to fetch a User object from the database
given a user's numerical id. |
|
User(java.lang.Integer uid,
Cleartext password)
Attempts to fetch a User object from the database,
given a user's numerical id and (cleartext) password. |
|
User(java.lang.Integer uid,
Cryptword password)
Attempts to fetch a User object from the database,
given a user's numerical id and (encrypted) password. |
|
User(java.lang.String username)
Attempts to fetch a User object from the database
given a username. |
|
User(java.lang.String username,
Cleartext password)
Attempts to fetch a User object
from the database, given a username and (cleartext) password. |
|
User(java.lang.String username,
Cryptword password)
Attempts to fetch a User object
from the database, given a username and (encrypted) password. |
Method Summary | |
void |
finalize()
|
static Cleartext |
genRandomPassword()
generates a truly random 6-character alphanumeric string for use as a random password. |
java.lang.String |
get_email()
gets this user's email address. |
java.lang.String |
get_login()
gets this user's login name (username). |
Cryptword |
get_passwd()
gets this user's (encrypted) password. |
protected java.lang.String |
getTableName()
|
boolean |
is_passwd(Cleartext s)
tests a given (cleartext) password against the user's password. |
boolean |
is_passwd(Cryptword s)
tests a given (encrypted) password against the user's password. |
void |
set_email(java.lang.String s)
sets this user's email address. |
void |
set_login(java.lang.String s)
sets this user's login name (i.e. username). |
void |
set_passwd(Cleartext s)
sets this user's password to the given cleartext String. |
void |
set_passwd(Cryptword s)
sets this user's password to the given encrypted String. |
Methods inherited from class com.strangelight.db.KeyedRow |
commit, get_id, getId |
Methods inherited from class com.strangelight.db.TableRow |
drop, getFields, getObject, getString, getWhereClause, setObject, setString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public User()
User
object, which will be
transferred to persistent storage in the database when this
User
object is garbage-collected, or when this
User
object's commit()
method is called.
public User(java.lang.String username, Cleartext password) throws E_NoSuchEntity, E_BadPassword
User
object
from the database, given a username and (cleartext) password.
username
- the user's username (i.e. login name).password
- the user's password, in cleartext form.
E_NoSuchEntity
- if the user cannot be found in the database
E_BadPassword
- if the password
is incorrect.public User(int uid, Cleartext password) throws E_NoSuchEntity, E_BadPassword
User
object from the database,
given a user's numerical id and (cleartext) password.
password
- the user's password, in cleartext form.
E_NoSuchEntity
- if the user cannot be found in the database
E_BadPassword
- if the password
is incorrect.public User(java.lang.Integer uid, Cleartext password) throws E_NoSuchEntity, E_BadPassword
User
object from the database,
given a user's numerical id and (cleartext) password.
password
- the user's password, in cleartext form.
E_NoSuchEntity
- if the user cannot be found in the database
E_BadPassword
- if the password
is incorrect.public User(java.lang.String username, Cryptword password) throws E_NoSuchEntity, E_BadPassword
User
object
from the database, given a username and (encrypted) password.
username
- the user's username (i.e. login name).password
- the user's password, in encrypted form.
E_NoSuchEntity
- if the user cannot be found in the database
E_BadPassword
- if the password
is incorrect.public User(int uid, Cryptword password) throws E_NoSuchEntity, E_BadPassword
User
object from the database,
given a user's numerical id and (encrypted) password.
password
- the user's password, in encrypted form.
E_NoSuchEntity
- if the user cannot be found in the database
E_BadPassword
- if the password
is incorrect.public User(java.lang.Integer uid, Cryptword password) throws E_NoSuchEntity, E_BadPassword
User
object from the database,
given a user's numerical id and (encrypted) password.
password
- the user's password, in encrypted form.
E_NoSuchEntity
- if the user cannot be found in the database
E_BadPassword
- if the password
is incorrect.public User(java.lang.String username) throws E_NoSuchEntity
User
object from the database
given a username. Because this method does not do any password
verification, applications should take special care that they do
not use the returned object in a way that would compromise
security.
username
- the user's username (i.e. login name).
E_NoSuchEntity
- if the user cannot be found in the databasepublic User(java.lang.Integer uid) throws E_NoSuchEntity
User
object from the database
given a user's numerical id. Because this method does not do any password
verification, applications should take special care that they do
not use the returned object in a way that would compromise
security.
E_NoSuchEntity
- if the user cannot be found in the databasepublic User(int uid) throws E_NoSuchEntity
User
object from the database
given a user's numerical id. Because this method does not do any password
verification, applications should take special care that they do
not use the returned object in a way that would compromise
security.
E_NoSuchEntity
- if the user cannot be found in the databaseMethod Detail |
protected java.lang.String getTableName()
getTableName
in class TableRow
String
object. For
example, a typical implementation might be:
protected String getTableName() { return "MyTable"; }
public void set_login(java.lang.String s)
s
- the user's new login name.public void set_passwd(Cleartext s)
s
- the user's new password (as cleartext).Cleartext
public void set_passwd(Cryptword s)
s
- the user's new password (as an encrypted String).Cryptword
public void set_email(java.lang.String s)
s
- the user's new email addie.public java.lang.String get_login()
public boolean is_passwd(Cleartext s)
s
- the password to test (as a cleartext string).
true
if s
is the user's password,
false
otherwise.public boolean is_passwd(Cryptword s)
s
- the password to test (as an encrypted string).
true
if s
is the user's password,
false
otherwise.public java.lang.String get_email()
public Cryptword get_passwd()
Cryptword
public static Cleartext genRandomPassword()
public void finalize()
finalize
in class KeyedRow
TableRow.commit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |