fr.paris.lutece.plugins.mylutece.modules.database.authentication.business
Interface IDatabaseUserDAO

All Known Implementing Classes:
DatabaseUserDAO

public interface IDatabaseUserDAO

Author:
Etienne

Method Summary
 boolean checkPassword(String strLogin, String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check the password for a DatabaseUser
 int countUserPasswordHistoryFromDate(Timestamp minDate, int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of password change done by a user since the given date.
 void delete(DatabaseUser databaseUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 List<Integer> findAllExpiredUserId(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of user with the expired status.
 int findDatabaseUserIdFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get a user id from his login
 List<Integer> getIdUsersToSendFirstAlert(Timestamp alertMaxDate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that need to receive their first alert
 List<Integer> getIdUsersToSendOtherAlert(Timestamp alertMaxDate, Timestamp timeBetweenAlerts, int maxNumberAlerts, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that need to receive their first alert
 List<Integer> getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that have an expired time life but not the expired status
 List<Integer> getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that have an expired password but not the change password flag
 int getNbAccountLifeTimeNotification(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of notification send to a user to warn him about the expiration of his account
 void insert(DatabaseUser databaseUser, String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 void insertNewPasswordInHistory(String strPassword, int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Log a password change in the password history
 DatabaseUser load(int nDatabaseUserId, 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
 void removeAllPasswordHistoryForUser(int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove every password saved in the password history for a user.
 Collection<DatabaseUser> selectDatabaseUserList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of databaseUsers
 Collection<DatabaseUser> selectDatabaseUserListForEmail(String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of DatabaseUsers for a email
 Collection<DatabaseUser> selectDatabaseUserListForLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of DatabaseUsers for a login
 List<DatabaseUser> selectDatabaseUsersListByFilter(DatabaseUserFilter duFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of DatabaseUsers by a filter
 String selectPasswordByPrimaryKey(int nDatabaseUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the password of the specified user
 List<String> selectUserPasswordHistory(int nUserID, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets the history of password of the given user
 void store(DatabaseUser databaseUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 void updateChangePassword(List<Integer> listIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Set the "change password" flag of users to true
 void updateNbAlert(List<Integer> listIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Increment the number of alert send to users by 1
 void updatePassword(DatabaseUser databaseUser, String strNewPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 void updateResetPassword(DatabaseUser databaseUser, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 void updateUserExpirationDate(int nIdUser, Timestamp newExpirationDate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the user expiration date with the new values.
 void updateUserLastLoginDate(String strLogin, Timestamp dateLastLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update a user last login date
 void updateUserStatus(List<Integer> listIdUser, int nNewStatus, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update status of a list of user accounts
 

Method Detail

newPrimaryKey

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

Parameters:
plugin - The Plugin using this data access service
Returns:
The new primary key

insert

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

Parameters:
databaseUser - The databaseUser object
strPassword - The user password
plugin - The Plugin using this data access service

load

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

Parameters:
nDatabaseUserId - The identifier of databaseUser
plugin - The Plugin using this data access service
Returns:
the instance of the DatabaseUser

delete

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

Parameters:
databaseUser - The databaseUser object
plugin - The Plugin using this data access service

store

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

Parameters:
databaseUser - The reference of databaseUser
plugin - The Plugin using this data access service

updatePassword

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

Parameters:
databaseUser - The reference of databaseUser
strNewPassword - The new password to store
plugin - The Plugin using this data access service

updateResetPassword

void updateResetPassword(DatabaseUser databaseUser,
                         boolean bNewValue,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Parameters:
databaseUser - The reference of databaseUser
bNewValue - The new value of the resetPassword attribute
plugin - The Plugin using this data access service

selectPasswordByPrimaryKey

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

Parameters:
nDatabaseUserId - The Primary key of the databaseUser
plugin - The current plugin using this method
Returns:
String the user password

selectDatabaseUserList

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

Parameters:
plugin - The Plugin using this data access service
Returns:
The Collection of the databaseUsers

selectDatabaseUserListForLogin

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

Parameters:
strLogin - The login of DatabaseUser
plugin - The Plugin using this data access service
Returns:
The Collection of the DatabaseUsers

selectDatabaseUserListForEmail

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

Parameters:
strEmail - The email of DatabaseUser
plugin - The Plugin using this data access service
Returns:
The Collection of the DatabaseUsers

checkPassword

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

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

selectDatabaseUsersListByFilter

List<DatabaseUser> selectDatabaseUsersListByFilter(DatabaseUserFilter duFilter,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of DatabaseUsers by a filter

Parameters:
duFilter - filter
plugin - Plugin
Returns:
a list of DatabaseUser

findDatabaseUserIdFromLogin

int findDatabaseUserIdFromLogin(String strLogin,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get a user id from his login

Parameters:
strLogin - The login of the user
plugin - The plugin
Returns:
The user id, or 0 if no user has this login.

selectUserPasswordHistory

List<String> selectUserPasswordHistory(int nUserID,
                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets the history of password of the given user

Parameters:
nUserID - Id of the user
plugin - The plugin
Returns:
The collection of recent passwords used by the user.

countUserPasswordHistoryFromDate

int countUserPasswordHistoryFromDate(Timestamp minDate,
                                     int nUserId,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of password change done by a user since the given date.

Parameters:
minDate - Minimum date to consider.
nUserId - Id of the user
plugin - The plugin
Returns:
The number of password change done by the user since the given date.

insertNewPasswordInHistory

void insertNewPasswordInHistory(String strPassword,
                                int nUserId,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Log a password change in the password history

Parameters:
strPassword - New password of the user
nUserId - Id of the user
plugin - The plugin

removeAllPasswordHistoryForUser

void removeAllPasswordHistoryForUser(int nUserId,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove every password saved in the password history for a user.

Parameters:
nUserId - Id of the user
plugin - The plugin

findAllExpiredUserId

List<Integer> findAllExpiredUserId(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of user with the expired status.

Parameters:
plugin - The plugin
Returns:
The list of if of user with the expired status.

getIdUsersWithExpiredLifeTimeList

List<Integer> getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp,
                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that have an expired time life but not the expired status

Parameters:
currentTimestamp - Timestamp describing the current time.
plugin - The plugin
Returns:
the list of id of users with expired time life

getIdUsersToSendFirstAlert

List<Integer> getIdUsersToSendFirstAlert(Timestamp alertMaxDate,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that need to receive their first alert

Parameters:
alertMaxDate - The maximum date to send alerts.
plugin - The plugin
Returns:
the list of id of users that need to receive their first alert

getIdUsersToSendOtherAlert

List<Integer> getIdUsersToSendOtherAlert(Timestamp alertMaxDate,
                                         Timestamp timeBetweenAlerts,
                                         int maxNumberAlerts,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that need to receive their first alert

Parameters:
alertMaxDate - The maximum date to send alerts.
timeBetweenAlerts - Timestamp describing the time between two alerts.
maxNumberAlerts - Maximum number of alerts to send to a user
plugin - The plugin
Returns:
the list of id of users that need to receive their first alert

getIdUsersWithExpiredPasswordsList

List<Integer> getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp,
                                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that have an expired password but not the change password flag

Parameters:
currentTimestamp - Timestamp describing the current time.
plugin - The plugin
Returns:
the list of id of users with expired passwords

updateUserStatus

void updateUserStatus(List<Integer> listIdUser,
                      int nNewStatus,
                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update status of a list of user accounts

Parameters:
listIdUser - List of user accounts to update
nNewStatus - New status of the user
plugin - The plugin

updateNbAlert

void updateNbAlert(List<Integer> listIdUser,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Increment the number of alert send to users by 1

Parameters:
listIdUser - The list of users to update
plugin - The plugin

updateChangePassword

void updateChangePassword(List<Integer> listIdUser,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Set the "change password" flag of users to true

Parameters:
listIdUser - The list of users to update
plugin - The plugin

updateUserExpirationDate

void updateUserExpirationDate(int nIdUser,
                              Timestamp newExpirationDate,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the user expiration date with the new values. Also update his alert account to 0

Parameters:
nIdUser - Id of the user to update
newExpirationDate - Id of the user to update
plugin - The plugin

getNbAccountLifeTimeNotification

int getNbAccountLifeTimeNotification(int nIdUser,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of notification send to a user to warn him about the expiration of his account

Parameters:
nIdUser - Id of the user
plugin - The plugin
Returns:
The number of notification send to the user

updateUserLastLoginDate

void updateUserLastLoginDate(String strLogin,
                             Timestamp dateLastLogin,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update a user last login date

Parameters:
strLogin - Login of the user to update
dateLastLogin - date of the last login of the user
plugin - The plugin


Copyright © 2014 Mairie de Paris. All Rights Reserved.