fr.paris.lutece.plugins.mylutece.modules.database.authentication.business
Class DatabaseUserDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.mylutece.modules.database.authentication.business.DatabaseUserDAO
All Implemented Interfaces:
IDatabaseUserDAO

public final class DatabaseUserDAO
extends java.lang.Object
implements IDatabaseUserDAO

This class provides Data Access methods for databaseUser objects


Method Summary
 boolean checkPassword(java.lang.String strLogin, java.lang.String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check the password for a DatabaseUser
 void delete(DatabaseUser databaseUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void insert(DatabaseUser databaseUser, java.lang.String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 DatabaseUser load(int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of DatabaseUser from the table
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 java.util.Collection<DatabaseUser> selectDatabaseUserList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of databaseUsers
 java.util.Collection<DatabaseUser> selectDatabaseUserListForEmail(java.lang.String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of DatabaseUsers for a email
 java.util.Collection<DatabaseUser> selectDatabaseUserListForLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of DatabaseUsers for a login
 java.lang.String selectPasswordByPrimaryKey(int nDatabaseUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the password of the specified user
 void store(DatabaseUser databaseUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 void updatePassword(DatabaseUser databaseUser, java.lang.String strNewPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newPrimaryKey

public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Generates a new primary key

Specified by:
newPrimaryKey in interface IDatabaseUserDAO
Parameters:
plugin - The Plugin using this data access service
Returns:
The new primary key

insert

public void insert(DatabaseUser databaseUser,
                   java.lang.String strPassword,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IDatabaseUserDAO
Parameters:
databaseUser - The databaseUser object
strPassword - The user password
plugin - The Plugin using this data access service

load

public DatabaseUser load(int nUserId,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of DatabaseUser from the table

Specified by:
load in interface IDatabaseUserDAO
Parameters:
nUserId - The identifier of User
plugin - The Plugin using this data access service
Returns:
the instance of the DatabaseUser

delete

public void delete(DatabaseUser databaseUser,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a record from the table

Specified by:
delete in interface IDatabaseUserDAO
Parameters:
databaseUser - The DatabaseUser object
plugin - The Plugin using this data access service

store

public void store(DatabaseUser databaseUser,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Specified by:
store in interface IDatabaseUserDAO
Parameters:
databaseUser - The reference of databaseUser
plugin - The Plugin using this data access service

updatePassword

public void updatePassword(DatabaseUser databaseUser,
                           java.lang.String strNewPassword,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Specified by:
updatePassword in interface IDatabaseUserDAO
Parameters:
databaseUser - The reference of databaseUser
strNewPassword - The new password to store
plugin - The Plugin using this data access service

selectPasswordByPrimaryKey

public java.lang.String selectPasswordByPrimaryKey(int nDatabaseUserId,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the password of the specified user

Specified by:
selectPasswordByPrimaryKey in interface IDatabaseUserDAO
Parameters:
nDatabaseUserId - The Primary key of the databaseUser
plugin - The current plugin using this method
Returns:
String the user password

selectDatabaseUserList

public java.util.Collection<DatabaseUser> selectDatabaseUserList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of databaseUsers

Specified by:
selectDatabaseUserList in interface IDatabaseUserDAO
Parameters:
plugin - The Plugin using this data access service
Returns:
The Collection of the databaseUsers

selectDatabaseUserListForLogin

public java.util.Collection<DatabaseUser> selectDatabaseUserListForLogin(java.lang.String strLogin,
                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of DatabaseUsers for a login

Specified by:
selectDatabaseUserListForLogin in interface IDatabaseUserDAO
Parameters:
strLogin - The login of DatabaseUser
plugin - The Plugin using this data access service
Returns:
The Collection of the DatabaseUsers

selectDatabaseUserListForEmail

public java.util.Collection<DatabaseUser> selectDatabaseUserListForEmail(java.lang.String strEmail,
                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of DatabaseUsers for a email

Specified by:
selectDatabaseUserListForEmail in interface IDatabaseUserDAO
Parameters:
strEmail - The email of DatabaseUser
plugin - The Plugin using this data access service
Returns:
The Collection of the DatabaseUsers

checkPassword

public boolean checkPassword(java.lang.String strLogin,
                             java.lang.String strPassword,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check the password for a DatabaseUser

Specified by:
checkPassword in interface IDatabaseUserDAO
Parameters:
strLogin - The user login of DatabaseUser
strPassword - The password of DatabaseUser
plugin - The Plugin using this data access service
Returns:
true if password is ok


Copyright © 2010 Mairie de Paris. All Rights Reserved.