org.locomotive.loco.store.user
Class UserStoreJdbcPostgresql

java.lang.Object
  |
  +--org.locomotive.loco.store.user.UserStore
        |
        +--org.locomotive.loco.store.user.UserStoreJdbc
              |
              +--org.locomotive.loco.store.user.UserStoreJdbcPostgresql

public class UserStoreJdbcPostgresql
extends UserStoreJdbc


Constructor Summary
UserStoreJdbcPostgresql()
           
 
Method Summary
 int createUser(java.sql.Connection conn, int uid, java.lang.String un, java.lang.String pword, int locoflg)
          Persistantly stores User's data.
 void save(java.sql.Connection conn, int userid, java.lang.String username, java.lang.String password, int loco_flags)
          Updates the User data in the database if changes have been made, silently ignored on anonymous users
 void saveLoginTime(java.sql.Connection conn, int userid)
          Updates the user.last_login field in the database.
 
Methods inherited from class org.locomotive.loco.store.user.UserStoreJdbc
exists, exists, existsAnyCase, getNextUserId, getUsername, getUsernames, load, load, loadAllUserNames, loadUsers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserStoreJdbcPostgresql

public UserStoreJdbcPostgresql()
Method Detail

createUser

public int createUser(java.sql.Connection conn,
                      int uid,
                      java.lang.String un,
                      java.lang.String pword,
                      int locoflg)
               throws LoadUserException
Persistantly stores User's data. Will fail if uid is not unique (uid <= 0 will cause system to pick a userid). Will also fail if un (intended username) is already used.
Overrides:
createUser in class UserStoreJdbc
Parameters:
conn - a JDBC connection with access to the Loco user database
uid - the userid, system will pick if <= 0
un - username of the new user
pword - password of the new user
locoflg - flags of the new user for Loco-specific functions
Throws:
LoadUserException - if there is a database storage error

saveLoginTime

public void saveLoginTime(java.sql.Connection conn,
                          int userid)
                   throws LoadUserException
Updates the user.last_login field in the database. silently ignored on anonymous users
Overrides:
saveLoginTime in class UserStoreJdbc
Parameters:
conn - an active JDBC connection
Throws:
LoadUserException - if there is a database storage error

save

public void save(java.sql.Connection conn,
                 int userid,
                 java.lang.String username,
                 java.lang.String password,
                 int loco_flags)
          throws LoadUserException
Updates the User data in the database if changes have been made, silently ignored on anonymous users
Overrides:
save in class UserStoreJdbc
Parameters:
conn - an active JDBC connection
Throws:
LoadUserException - if there is a database storage error