fr.paris.lutece.portal.business.user
Interface IAdminUserDAO

All Known Implementing Classes:
AdminUserDAO

public interface IAdminUserDAO

AdminUserDAO Interface


Method Summary
 int checkAccessCodeAlreadyInUse(String strAccessCode)
          Checks the availibility of an access code
 int checkEmailAlreadyInUse(String strEmail)
          Checks the availibility of an email
 boolean checkRoleAttributed(String strRoleKey)
          Checks wether the role is in use or not
 int countUserPasswordHistoryFromDate(Timestamp minDate, int nUserId)
          Get the number of password change done by a user since the given date.
 void delete(int nUserId)
          Delete an user
 void deleteAllDelegatedRightsForUser(int nUserId, int nUserLevel)
          Deletes rights delegated by user ie rights with level < userlevel
 void deleteAllOwnRightsForUser(int nUserId, int nUserLevel)
          Deletes all rights owned by user ie rights with level >= userlevel
 void deleteAllRightsForUser(int nUserId)
          Delete all rights owned by an user
 void deleteAllRolesForUser(int nUserId)
          Remove all rights from an user
 void deleteRightForUser(int nUserId, String strIdRight)
          Remove a right for an user
 void deleteRoleForUser(int nUserId, String strRoleKey)
          Remove role for an user
 List<Integer> findAllExpiredUserId()
          Get the list of id of user with the expired status.
 List<Integer> getIdUsersToSendFirstAlert(Timestamp alertMaxDate)
          Get the list of id of users that need to receive their first alert
 List<Integer> getIdUsersToSendOtherAlert(Timestamp alertMaxDate, Timestamp timeBetweenAlerts, int maxNumberAlerts)
          Get the list of id of users that need to receive their first alert
 List<Integer> getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp)
          Get the list of id of users that have an expired time life but not the expired status
 List<Integer> getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp)
          Get the list of id of users that have an expired password but not the change password flag
 boolean hasRight(int nUserId, String strIdRight)
          Check if the user has the given right
 boolean hasRole(int nUserId, String strRoleKey)
          Check if the user has the role
 void insert(AdminUser user)
          Insert a new record in the table.
 void insert(LuteceDefaultAdminUser user)
          Insert a new record in the table.
 void insertNewPasswordInHistory(String strPassword, int nUserId)
          Log a password change in the password history
 void insertRightsListForUser(int nUserId, String strRightId)
          Add a right to an user
 void insertRolesListForUser(int nUserId, String strRoleKey)
          Gives a role to an user
 AdminUser load(int nUserId)
          Load an AdminUser
 LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
          Load a default AdminUser
 int newPrimaryKey()
          Generates a new primary key
 void removeAllPasswordHistoryForUser(int nUserId)
          Remove every password saved in the password history for a given user.
 Map<String,Boolean> selectAnonymizationStatusUserStaticField()
          Get a map of anonymization status of a user field.
 Map<String,Right> selectRightsListForUser(int nUserId)
          Get the right list associated to a given user id
 Map<String,AdminRole> selectRolesListForUser(int nUserId)
          Get the role list associated to a given user id
 AdminUser selectUserByAccessCode(String strUserAccessCode)
          Get an user by its access code (login)
 String selectUserByEmail(String strEmail)
          Get the user access code from its email.
 Collection<AdminUser> selectUserList()
          Gets the collection of all AdminUsers
 List<String> selectUserPasswordHistory(int nUserID)
          Gets the history of password of the given user
 Collection<AdminUser> selectUsersByFilter(AdminUserFilter auFilter)
          Select users by filter
 Collection<AdminUser> selectUsersByLevel(int nIdLevel)
          Select all user that own a given level
 Collection<AdminUser> selectUsersByRight(String strIdRight)
          Get all users having a given right
 Collection<AdminUser> selectUsersByRole(String strRoleKey)
          Gets a collection of AdminUser that share a given role
 void store(AdminUser user)
          Update AdminUser data
 void store(LuteceDefaultAdminUser user)
          Update AdminUser data
 void storeUsersRole(String strOldRoleKey, AdminRole role)
          Update role key if role key name has change
 void updateAnonymizationStatusUserStaticField(String strFieldName, boolean bAnonymizeFiled)
          Update the anonymization status of a user field.
 void updateChangePassword(List<Integer> listIdUser)
          Set the "change password" flag of users to true
 void updateDateLastLogin(int nIdUser, Timestamp dateLastLogin)
          Update the admin user last login date.
 void updateNbAlert(List<Integer> listIdUser)
          Increment the number of alert send to users by 1
 void updateUserExpirationDate(int nIdUser, Timestamp newExpirationDate)
          Update the admin user expiration date with the new values.
 void updateUserStatus(List<Integer> listIdUser, int nNewStatus)
          Update status of a list of user accounts
 

Method Detail

checkAccessCodeAlreadyInUse

int checkAccessCodeAlreadyInUse(String strAccessCode)
Checks the availibility of an access code

Parameters:
strAccessCode - The access code
Returns:
user ID if the access code is already used by another user, -1 otherwise

checkEmailAlreadyInUse

int checkEmailAlreadyInUse(String strEmail)
Checks the availibility of an email

Parameters:
strEmail - The email
Returns:
True if the email is already used by another user

checkRoleAttributed

boolean checkRoleAttributed(String strRoleKey)
Checks wether the role is in use or not

Parameters:
strRoleKey - the role key to check
Returns:
user ID if the emaile is already used by another user, -1 otherwise

delete

void delete(int nUserId)
Delete an user

Parameters:
nUserId - the user id

deleteAllDelegatedRightsForUser

void deleteAllDelegatedRightsForUser(int nUserId,
                                     int nUserLevel)
Deletes rights delegated by user ie rights with level < userlevel

Parameters:
nUserId - the user id
nUserLevel - the user level

deleteAllOwnRightsForUser

void deleteAllOwnRightsForUser(int nUserId,
                               int nUserLevel)
Deletes all rights owned by user ie rights with level >= userlevel

Parameters:
nUserId - the user id
nUserLevel - the user level

deleteAllRightsForUser

void deleteAllRightsForUser(int nUserId)
Delete all rights owned by an user

Parameters:
nUserId - the user id

deleteAllRolesForUser

void deleteAllRolesForUser(int nUserId)
Remove all rights from an user

Parameters:
nUserId - the user id

insert

void insert(AdminUser user)
Insert a new record in the table.

Parameters:
user - The AdminUser

insert

void insert(LuteceDefaultAdminUser user)
Insert a new record in the table.

Parameters:
user - The AdminUser

insertRightsListForUser

void insertRightsListForUser(int nUserId,
                             String strRightId)
Add a right to an user

Parameters:
nUserId - the user id
strRightId - the right id

insertRolesListForUser

void insertRolesListForUser(int nUserId,
                            String strRoleKey)
Gives a role to an user

Parameters:
nUserId - the user id
strRoleKey - the key role

load

AdminUser load(int nUserId)
Load an AdminUser

Parameters:
nUserId - the user id
Returns:
user

loadDefaultAdminUser

LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
Load a default AdminUser

Parameters:
nUserId - the user id
Returns:
user

newPrimaryKey

int newPrimaryKey()
Generates a new primary key

Returns:
nKey

selectRightsListForUser

Map<String,Right> selectRightsListForUser(int nUserId)
Get the right list associated to a given user id

Parameters:
nUserId - the id of the user to retrieve rights
Returns:
the right list as a collection of strings

selectRolesListForUser

Map<String,AdminRole> selectRolesListForUser(int nUserId)
Get the role list associated to a given user id

Parameters:
nUserId - the id of the user to retrieve roles
Returns:
the role list

selectUserByAccessCode

AdminUser selectUserByAccessCode(String strUserAccessCode)
Get an user by its access code (login)

Parameters:
strUserAccessCode - the login
Returns:
The user found, otherwise null

selectUserByEmail

String selectUserByEmail(String strEmail)
Get the user access code from its email.

Parameters:
strEmail - The email
Returns:
The access code of the user with the given email, or null if no user has been found

selectUserList

Collection<AdminUser> selectUserList()
Gets the collection of all AdminUsers

Returns:
The user list

selectUsersByRole

Collection<AdminUser> selectUsersByRole(String strRoleKey)
Gets a collection of AdminUser that share a given role

Parameters:
strRoleKey - The role key
Returns:
The user List

store

void store(AdminUser user)
Update AdminUser data

Parameters:
user - The AdminUser

store

void store(LuteceDefaultAdminUser user)
Update AdminUser data

Parameters:
user - The AdminUser

selectUsersByLevel

Collection<AdminUser> selectUsersByLevel(int nIdLevel)
Select all user that own a given level

Parameters:
nIdLevel - The level
Returns:
userList The user's list

storeUsersRole

void storeUsersRole(String strOldRoleKey,
                    AdminRole role)
Update role key if role key name has change

Parameters:
strOldRoleKey - The old role key name
role - The new role

hasRole

boolean hasRole(int nUserId,
                String strRoleKey)
Check if the user has the role

Parameters:
nUserId - The ID of the user
strRoleKey - The role Key
Returns:
true if the user has the role

deleteRoleForUser

void deleteRoleForUser(int nUserId,
                       String strRoleKey)
Remove role for an user

Parameters:
nUserId - The ID of the user
strRoleKey - The role key

selectUsersByFilter

Collection<AdminUser> selectUsersByFilter(AdminUserFilter auFilter)
Select users by filter

Parameters:
auFilter - the filter
Returns:
a list of AdminUser

selectUsersByRight

Collection<AdminUser> selectUsersByRight(String strIdRight)
Get all users having a given right

Parameters:
strIdRight - The ID right
Returns:
A collection of AdminUser

hasRight

boolean hasRight(int nUserId,
                 String strIdRight)
Check if the user has the given right

Parameters:
nUserId - The ID of the user
strIdRight - The ID right
Returns:
true if the user has the right

deleteRightForUser

void deleteRightForUser(int nUserId,
                        String strIdRight)
Remove a right for an user

Parameters:
nUserId - The user ID
strIdRight - The right ID

selectUserPasswordHistory

List<String> selectUserPasswordHistory(int nUserID)
Gets the history of password of the given user

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

countUserPasswordHistoryFromDate

int countUserPasswordHistoryFromDate(Timestamp minDate,
                                     int nUserId)
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
Returns:
The number of password change done by the user since the given date.

insertNewPasswordInHistory

void insertNewPasswordInHistory(String strPassword,
                                int nUserId)
Log a password change in the password history

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

removeAllPasswordHistoryForUser

void removeAllPasswordHistoryForUser(int nUserId)
Remove every password saved in the password history for a given user.

Parameters:
nUserId - Id of the user

selectAnonymizationStatusUserStaticField

Map<String,Boolean> selectAnonymizationStatusUserStaticField()
Get a map of anonymization status of a user field.

Returns:
A map containing the associations of user field name and a boolean describing whether the field should be anonymized.

updateAnonymizationStatusUserStaticField

void updateAnonymizationStatusUserStaticField(String strFieldName,
                                              boolean bAnonymizeFiled)
Update the anonymization status of a user field.

Parameters:
strFieldName - Name of the field to update
bAnonymizeFiled - True if the field should be anonymized, false otherwise

findAllExpiredUserId

List<Integer> findAllExpiredUserId()
Get the list of id of user with the expired status.

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

getIdUsersWithExpiredLifeTimeList

List<Integer> getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp)
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.
Returns:
the list of id of users with expired time life

getIdUsersToSendFirstAlert

List<Integer> getIdUsersToSendFirstAlert(Timestamp alertMaxDate)
Get the list of id of users that need to receive their first alert

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

getIdUsersToSendOtherAlert

List<Integer> getIdUsersToSendOtherAlert(Timestamp alertMaxDate,
                                         Timestamp timeBetweenAlerts,
                                         int maxNumberAlerts)
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
Returns:
the list of id of users that need to receive their first alert

getIdUsersWithExpiredPasswordsList

List<Integer> getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp)
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.
Returns:
the list of id of users with expired passwords

updateUserStatus

void updateUserStatus(List<Integer> listIdUser,
                      int nNewStatus)
Update status of a list of user accounts

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

updateNbAlert

void updateNbAlert(List<Integer> listIdUser)
Increment the number of alert send to users by 1

Parameters:
listIdUser - The list of users to update

updateChangePassword

void updateChangePassword(List<Integer> listIdUser)
Set the "change password" flag of users to true

Parameters:
listIdUser - The list of users to update

updateUserExpirationDate

void updateUserExpirationDate(int nIdUser,
                              Timestamp newExpirationDate)
Update the admin user expiration date with the new values. Also update his alert account to 0

Parameters:
nIdUser - Id of the admin user to update
newExpirationDate - New expiration date of the user

updateDateLastLogin

void updateDateLastLogin(int nIdUser,
                         Timestamp dateLastLogin)
Update the admin user last login date.

Parameters:
nIdUser - Id of the admin user to update
dateLastLogin - New last login date of the user


Copyright © 2014 Mairie de Paris. All Rights Reserved.