|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.davesag.generica.peer.UserPeer
This peer manipulates Users
using hibernate.
| Constructor Summary | |
UserPeer()
|
|
| Method Summary | |
static boolean |
active(Session sess,
String name,
String userclass)
A quick tests to determine if there is an active user object with the given name, using the supplied classname as qualifiers of the search. |
static User |
ctLogin(Session sess,
String username,
String password,
String userclass)
Retrieve the User with the supplied username and cleartext password, if valid and the user is active. |
static void |
delete(Session sess,
User user)
Delete this user. |
static boolean |
exists(Session sess,
String username,
String userclass)
A quick tests to determine if the username supplied matched a known user, whether active or inactive. |
static User |
load(Session sess,
String username,
String userclass)
Retrieve the User with the supplied username only, if valid, irrespecive of their active status. |
static List |
loadAll(Session sess,
String classname,
String sort)
loads all the users of the given optional classname and sort order. |
static User |
login(Session sess,
String username,
String password,
String userclass)
Retrieve the User with the supplied username and cleartext password, if valid and the user is active. |
static Long |
save(Session sess,
User user)
Save this user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UserPeer()
| Method Detail |
public static Long save(Session sess,
User user)
sess - The Session to use to save the user. The session will be
flushed but not closed.user - The user.
public static void delete(Session sess,
User user)
NOTE: if an user is deleted any text they wrote will be left in an
inconsistant state. hence we only allow the user to be deleted if they
have not authored any texts. and simply deactivate them if they have.
sess - The Session to use to delete the user. The session will be
flushed but not closed.user - The user.
public static boolean exists(Session sess,
String username,
String userclass)
sess - The Session to use to query for the user.username - The username to test.userclass - The fully qualified class of user to test. Typically
a site will have many kinds of users, eg admin users,
subscribers and so forth.
public static User load(Session sess,
String username,
String userclass)
login instead.
sess - The Session to use to query for the user.username - The username of the user we wish to login.userclass - The fully qualified class of user to test. Typically
a site will have many kinds of users, eg admin users,
subscribers and so forth.
public static boolean active(Session sess,
String name,
String userclass)
sess - The Session to use to query for the persistable
object.name - The name The actual name we are looking for.userclass - The fully qualified class of the persistable bean to
test for.
RuntimeException - if the params were invalid, or if there was a
HibernateException.
public static User login(Session sess,
String username,
String password,
String userclass)
sess - The Session to use to query for the user.username - The username of the user we wish to login.password - The clear text password of the user we wish to login.
This is hashed before being passed on to the
database.userclass - The fully qualified class of user to test. Typically
a site will have many kinds of users, eg admin users,
subscribers and so forth.
ctLogin(net.sf.hibernate.Session, java.lang.String, java.lang.String, java.lang.String)
public static User ctLogin(Session sess,
String username,
String password,
String userclass)
sess - The Session to use to query for the user.username - The username of the user we wish to login.password - The clear text password of the user we wish to login.userclass - The fully qualified class of user to test. Typically
a site will have many kinds of users, eg admin users,
subscribers and so forth.
RuntimeException - if the params were invalid, or if there was a
HibernateException.
public static List loadAll(Session sess,
String classname,
String sort)
sess - The Hibernate session.classname - The specific class of user to list. defaults to"
org.davesag.generica.core.User".sort - The sort order required. Defaults to "username asc".
RuntimeException - if the params are invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||