public final class AdminUserHome extends Object
Modifier and Type | Method and Description |
---|---|
static int |
checkAccessCodeAlreadyInUse(String strAccessCode)
Checks if a given login is already in use
|
static int |
checkEmailAlreadyInUse(String strEmail)
Checks if a given email is already in use
|
static boolean |
checkRoleAttributed(String strRoleKey)
Checks wether the role is in use or not
|
static int |
countUserPasswordHistoryFromDate(Timestamp minDate,
int nUserId)
Get the number of password change done by a user since the given date.
|
static void |
create(AdminUser user) |
static void |
create(LuteceDefaultAdminUser user) |
static void |
createRightForUser(int nUserId,
String strRightId) |
static void |
createRoleForUser(int nUserId,
String strRightId) |
static List<Integer> |
findAllExpiredUserId()
Get the list of id of user with the expired status.
|
static Collection<AdminUser> |
findByLevel(int nIdLevel)
Get all users having a given level
|
static AdminUser |
findByPrimaryKey(int nUserId)
Get the user infos from user id
|
static Collection<AdminUser> |
findByRight(String strIdRight)
Get all users having a given right
|
static Collection<AdminUser> |
findByRole(String strRoleKey)
Get all users having a given role
|
static LuteceDefaultAdminUser |
findLuteceDefaultAdminUserByPrimaryKey(int nUserId)
Get the user infos from user id
|
static String |
findUserByEmail(String strEmail)
Get the user access code from its email.
|
static Collection<AdminUser> |
findUserByFilter(AdminUserFilter auFilter)
Get all users by using a filter.
|
static AdminUser |
findUserByLogin(String strUserLogin)
Get the user infos from the access code.
|
static Collection<AdminUser> |
findUserList() |
static Map<String,Boolean> |
getAnonymizationStatusUserStaticField()
Get a map of anonymization status of a user field.
|
static List<Integer> |
getIdUsersToSendFirstAlert(Timestamp firstAlertMaxDate)
Get the list of id of users that need to receive their first alert
|
static List<Integer> |
getIdUsersToSendOtherAlert(Timestamp alertMaxDate,
Timestamp timeBetweenAlerts,
int maxNumberAlerts)
Get the list of id of users that need to receive their first alert
|
static List<Integer> |
getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp)
Get the list of id of users that have an expired time life but not the expired status
|
static List<Integer> |
getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp)
Get the list of id of users that have an expired password but not the change password flag
|
static Map<String,Right> |
getRightsListForUser(int nUserId)
Get the right list associated to a given user id
|
static Map<String,AdminRole> |
getRolesListForUser(int nUserId)
Get the role list associated to a given user id
|
static String |
getUserPasswordResetToken(int nIdUser,
Date timestamp,
String strSessionId)
Construct a password reset token.
|
static boolean |
hasRight(AdminUser user,
String strIdRight)
Check if the user has the given right
|
static boolean |
hasRole(AdminUser user,
String strRoleKey)
Check if the user has the role
|
static void |
insertNewPasswordInHistory(IPassword password,
int nUserId)
Log a password change in the password history
|
static void |
remove(int nUserId) |
static void |
removeAllDelegatedRightsForUser(AdminUser user) |
static void |
removeAllOwnRightsForUser(AdminUser user) |
static void |
removeAllPasswordHistoryForUser(int nUserId)
Remove every password saved in the password history for a user.
|
static void |
removeAllRightsForUser(int nUserId) |
static void |
removeAllRolesForUser(int nUserId) |
static void |
removeRightForUser(int nUserId,
String strIdRight)
Remove a right for an user
|
static void |
removeRoleForUser(int nUserId,
String strRoleKey)
Remove role for an user
|
static List<IPassword> |
selectUserPasswordHistory(int nUserID)
Gets the history of password of the given user
|
static void |
update(AdminUser user) |
static void |
update(LuteceDefaultAdminUser user) |
static void |
update(LuteceDefaultAdminUser user,
PasswordUpdateMode passwordMode) |
static void |
updateAnonymizationStatusUserStaticField(String strFieldName,
boolean bAnonymizeFiled)
Update the anonymization status of a user field.
|
static void |
updateChangePassword(List<Integer> listIdUser)
Set the "change password" flag of users to true
|
static void |
updateDateLastLogin(int nIdUser,
Timestamp dateLastLogin)
Update the admin user last login date.
|
static void |
updateNbAlert(List<Integer> listIdUser)
Increment the number of alert send to users by 1
|
static void |
updateUserExpirationDate(int nIdUser,
Timestamp newExpirationDate)
Update the admin user expiration date with the new values.
|
static void |
updateUsersRole(String strOldRoleKey,
AdminRole role)
Update role key if role key name has change
|
static void |
updateUserStatus(List<Integer> listIdUser,
int nNewStatus)
Update status of a list of user accounts
|
public static AdminUser findUserByLogin(String strUserLogin)
strUserLogin
- the loginpublic static String findUserByEmail(String strEmail)
strEmail
- The emailpublic static AdminUser findByPrimaryKey(int nUserId)
nUserId
- the user identifierpublic static Collection<AdminUser> findUserList()
public static void create(AdminUser user)
user
- The AdminUserpublic static void update(AdminUser user)
user
- The AdminUserpublic static void remove(int nUserId)
nUserId
- the user identifierpublic static Map<String,Right> getRightsListForUser(int nUserId)
nUserId
- the id of the user to retrieve rightspublic static void createRightForUser(int nUserId, String strRightId)
nUserId
- The user identifierstrRightId
- The right identifierpublic static void removeAllRightsForUser(int nUserId)
nUserId
- The user identifierpublic static void removeAllDelegatedRightsForUser(AdminUser user)
user
- The Admin User objectpublic static void removeAllOwnRightsForUser(AdminUser user)
user
- The Admin User objectpublic static Map<String,AdminRole> getRolesListForUser(int nUserId)
nUserId
- the id of the user to retrieve rightspublic static void createRoleForUser(int nUserId, String strRightId)
nUserId
- the id of the userstrRightId
- the right identifierpublic static void removeAllRolesForUser(int nUserId)
nUserId
- the user identifierpublic static boolean checkRoleAttributed(String strRoleKey)
strRoleKey
- the role key to checkpublic static int checkAccessCodeAlreadyInUse(String strAccessCode)
strAccessCode
- The loginpublic static int checkEmailAlreadyInUse(String strEmail)
strEmail
- The emailpublic static boolean hasRole(AdminUser user, String strRoleKey)
user
- The AdminUserstrRoleKey
- The role Keypublic static void removeRoleForUser(int nUserId, String strRoleKey)
nUserId
- The ID of the userstrRoleKey
- The role keypublic static void create(LuteceDefaultAdminUser user)
user
- the LuteceDefaultAdminUSerpublic static void update(LuteceDefaultAdminUser user)
user
- the LuteceDefaultAdminUSerpublic static void update(LuteceDefaultAdminUser user, PasswordUpdateMode passwordMode)
user
- the LuteceDefaultAdminUSerpasswordMode
- should the password be updated or notpublic static LuteceDefaultAdminUser findLuteceDefaultAdminUserByPrimaryKey(int nUserId)
nUserId
- the user identifierpublic static Collection<AdminUser> findByRole(String strRoleKey)
strRoleKey
- The role keypublic static Collection<AdminUser> findByLevel(int nIdLevel)
nIdLevel
- The levelpublic static void updateUsersRole(String strOldRoleKey, AdminRole role)
strOldRoleKey
- The old role key namerole
- The new rolepublic static Collection<AdminUser> findUserByFilter(AdminUserFilter auFilter)
auFilter
- The filterpublic static Collection<AdminUser> findByRight(String strIdRight)
strIdRight
- The ID rightpublic static boolean hasRight(AdminUser user, String strIdRight)
user
- The Admin UserstrIdRight
- The ID rightpublic static void removeRightForUser(int nUserId, String strIdRight)
nUserId
- The user IDstrIdRight
- The right IDpublic static List<IPassword> selectUserPasswordHistory(int nUserID)
nUserID
- Id of the userpublic static int countUserPasswordHistoryFromDate(Timestamp minDate, int nUserId)
minDate
- Minimum date to consider.nUserId
- Id of the userpublic static void insertNewPasswordInHistory(IPassword password, int nUserId)
password
- New password of the usernUserId
- Id of the userpublic static void removeAllPasswordHistoryForUser(int nUserId)
nUserId
- Id of the userpublic static Map<String,Boolean> getAnonymizationStatusUserStaticField()
public static void updateAnonymizationStatusUserStaticField(String strFieldName, boolean bAnonymizeFiled)
strFieldName
- Name of the field to updatebAnonymizeFiled
- True if the field should be anonymize, false otherwisepublic static List<Integer> findAllExpiredUserId()
public static List<Integer> getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp)
currentTimestamp
- Timestamp describing the current time.public static List<Integer> getIdUsersToSendFirstAlert(Timestamp firstAlertMaxDate)
firstAlertMaxDate
- The maximum expiration date to send first alert.public static List<Integer> getIdUsersToSendOtherAlert(Timestamp alertMaxDate, Timestamp timeBetweenAlerts, int maxNumberAlerts)
alertMaxDate
- The maximum date to send alerts.timeBetweenAlerts
- Timestamp describing the time between two alerts.maxNumberAlerts
- Maximum number of alerts to send to a userpublic static List<Integer> getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp)
currentTimestamp
- Timestamp describing the current time.public static void updateUserStatus(List<Integer> listIdUser, int nNewStatus)
listIdUser
- List of user accounts to updatenNewStatus
- New status of the userpublic static void updateNbAlert(List<Integer> listIdUser)
listIdUser
- The list of users to updatepublic static void updateChangePassword(List<Integer> listIdUser)
listIdUser
- The list of users to updatepublic static void updateUserExpirationDate(int nIdUser, Timestamp newExpirationDate)
nIdUser
- Id of the admin user to updatenewExpirationDate
- Id of the user to updatepublic static void updateDateLastLogin(int nIdUser, Timestamp dateLastLogin)
nIdUser
- Id of the admin user to updatedateLastLogin
- New last login date of the userpublic static String getUserPasswordResetToken(int nIdUser, Date timestamp, String strSessionId)
nIdUser
- the user IDtimestamp
- the timestampstrSessionId
- the session IDCopyright © 2020 City of Paris. All rights reserved.