|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.portal.business.user.AdminUserHome
public final class AdminUserHome
This class provides instances management methods (create, find, ...) for AdminUser objects
Method Summary | |
---|---|
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 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(String strPassword,
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<String> |
selectUserPasswordHistory(int nUserID)
Gets the history of password of the given user |
static void |
update(AdminUser user)
|
static void |
update(LuteceDefaultAdminUser user)
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AdminUser findUserByLogin(String strUserLogin)
strUserLogin
- the login
public static String findUserByEmail(String strEmail)
strEmail
- The email
public static AdminUser findByPrimaryKey(int nUserId)
nUserId
- the user identifier
public 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 rights
public 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 rights
public 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 check
public static int checkAccessCodeAlreadyInUse(String strAccessCode)
strAccessCode
- The login
public static int checkEmailAlreadyInUse(String strEmail)
strEmail
- The email
public static boolean hasRole(AdminUser user, String strRoleKey)
user
- The AdminUserstrRoleKey
- The role Key
public 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 LuteceDefaultAdminUser findLuteceDefaultAdminUserByPrimaryKey(int nUserId)
nUserId
- the user identifier
public static Collection<AdminUser> findByRole(String strRoleKey)
strRoleKey
- The role key
public static Collection<AdminUser> findByLevel(int nIdLevel)
nIdLevel
- The level
public static void updateUsersRole(String strOldRoleKey, AdminRole role)
strOldRoleKey
- The old role key namerole
- The new rolepublic static Collection<AdminUser> findUserByFilter(AdminUserFilter auFilter)
auFilter
- The filter
public static Collection<AdminUser> findByRight(String strIdRight)
strIdRight
- The ID right
public static boolean hasRight(AdminUser user, String strIdRight)
user
- The Admin UserstrIdRight
- The ID right
public static void removeRightForUser(int nUserId, String strIdRight)
nUserId
- The user IDstrIdRight
- The right IDpublic static List<String> selectUserPasswordHistory(int nUserID)
nUserID
- Id of the user
public static int countUserPasswordHistoryFromDate(Timestamp minDate, int nUserId)
minDate
- Minimum date to consider.nUserId
- Id of the user
public static void insertNewPasswordInHistory(String strPassword, int nUserId)
strPassword
- 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 user
public 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 user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |