|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.portal.business.user.AdminUserDAO
public class AdminUserDAO
This class porvides Data Access methods for AdminUser objects
| Constructor Summary | |
|---|---|
AdminUserDAO()
|
|
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdminUserDAO()
| Method Detail |
|---|
public AdminUser load(int nUserId)
load in interface IAdminUserDAOnUserId - the user id
public AdminUser selectUserByAccessCode(String strUserAccessCode)
selectUserByAccessCode in interface IAdminUserDAOstrUserAccessCode - the login
public String selectUserByEmail(String strEmail)
selectUserByEmail in interface IAdminUserDAOstrEmail - The email
public Collection<AdminUser> selectUserList()
selectUserList in interface IAdminUserDAOpublic int newPrimaryKey()
newPrimaryKey in interface IAdminUserDAOpublic void insert(AdminUser user)
insert in interface IAdminUserDAOuser - The AdminUserpublic void store(AdminUser user)
store in interface IAdminUserDAOuser - The AdminUserpublic void delete(int nUserId)
delete in interface IAdminUserDAOnUserId - the user idpublic Map<String,Right> selectRightsListForUser(int nUserId)
selectRightsListForUser in interface IAdminUserDAOnUserId - the id of the user to retrieve rights
public void insertRightsListForUser(int nUserId,
String strRightId)
insertRightsListForUser in interface IAdminUserDAOnUserId - the user idstrRightId - the right idpublic void deleteAllRightsForUser(int nUserId)
deleteAllRightsForUser in interface IAdminUserDAOnUserId - the user idpublic Map<String,AdminRole> selectRolesListForUser(int nUserId)
selectRolesListForUser in interface IAdminUserDAOnUserId - the id of the user to retrieve roles
public void insertRolesListForUser(int nUserId,
String strRoleKey)
insertRolesListForUser in interface IAdminUserDAOnUserId - the user idstrRoleKey - the key rolepublic void deleteAllRolesForUser(int nUserId)
deleteAllRolesForUser in interface IAdminUserDAOnUserId - the user idpublic boolean checkRoleAttributed(String strRoleKey)
checkRoleAttributed in interface IAdminUserDAOstrRoleKey - the role key to check
public int checkAccessCodeAlreadyInUse(String strAccessCode)
checkAccessCodeAlreadyInUse in interface IAdminUserDAOstrAccessCode - The access code
public int checkEmailAlreadyInUse(String strEmail)
checkEmailAlreadyInUse in interface IAdminUserDAOstrEmail - The email
public void insert(LuteceDefaultAdminUser user)
insert in interface IAdminUserDAOuser - The AdminUserpublic void store(LuteceDefaultAdminUser user)
store in interface IAdminUserDAOuser - The AdminUserpublic LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
loadDefaultAdminUser in interface IAdminUserDAOnUserId - the user id
public Collection<AdminUser> selectUsersByRole(String strRoleKey)
selectUsersByRole in interface IAdminUserDAOstrRoleKey - The role key
public Collection<AdminUser> selectUsersByLevel(int nIdLevel)
selectUsersByLevel in interface IAdminUserDAOnIdLevel - The level
public void deleteAllOwnRightsForUser(int nUserId,
int nUserLevel)
deleteAllOwnRightsForUser in interface IAdminUserDAOnUserId - the user idnUserLevel - the user level
public void deleteAllDelegatedRightsForUser(int nUserId,
int nUserLevel)
deleteAllDelegatedRightsForUser in interface IAdminUserDAOnUserId - the user idnUserLevel - the user level
public void storeUsersRole(String strOldRoleKey,
AdminRole role)
storeUsersRole in interface IAdminUserDAOstrOldRoleKey - The old role key namerole - The new role
public boolean hasRole(int nUserId,
String strRoleKey)
hasRole in interface IAdminUserDAOnUserId - The ID of the userstrRoleKey - The role Key
public void deleteRoleForUser(int nUserId,
String strRoleKey)
deleteRoleForUser in interface IAdminUserDAOnUserId - The ID of the userstrRoleKey - The role keypublic Collection<AdminUser> selectUsersByFilter(AdminUserFilter auFilter)
selectUsersByFilter in interface IAdminUserDAOauFilter - the filter
public Collection<AdminUser> selectUsersByRight(String strIdRight)
selectUsersByRight in interface IAdminUserDAOstrIdRight - The ID right
public boolean hasRight(int nUserId,
String strIdRight)
hasRight in interface IAdminUserDAOnUserId - The ID of the userstrIdRight - The ID right
public void deleteRightForUser(int nUserId,
String strIdRight)
deleteRightForUser in interface IAdminUserDAOnUserId - The user IDstrIdRight - The right IDpublic List<String> selectUserPasswordHistory(int nUserID)
selectUserPasswordHistory in interface IAdminUserDAOnUserID - Id of the user
public int countUserPasswordHistoryFromDate(Timestamp minDate,
int nUserId)
countUserPasswordHistoryFromDate in interface IAdminUserDAOminDate - Minimum date to consider.nUserId - Id of the user
public void insertNewPasswordInHistory(String strPassword,
int nUserId)
insertNewPasswordInHistory in interface IAdminUserDAOstrPassword - New password of the usernUserId - Id of the userpublic void removeAllPasswordHistoryForUser(int nUserId)
removeAllPasswordHistoryForUser in interface IAdminUserDAOnUserId - Id of the userpublic Map<String,Boolean> selectAnonymizationStatusUserStaticField()
selectAnonymizationStatusUserStaticField in interface IAdminUserDAO
public void updateAnonymizationStatusUserStaticField(String strFieldName,
boolean bAnonymizeFiled)
updateAnonymizationStatusUserStaticField in interface IAdminUserDAOstrFieldName - Name of the field to updatebAnonymizeFiled - True if the field should be anonymized, false otherwisepublic List<Integer> findAllExpiredUserId()
findAllExpiredUserId in interface IAdminUserDAOpublic List<Integer> getIdUsersWithExpiredLifeTimeList(Timestamp currentTimestamp)
getIdUsersWithExpiredLifeTimeList in interface IAdminUserDAOcurrentTimestamp - Timestamp describing the current time.
public List<Integer> getIdUsersToSendFirstAlert(Timestamp alertMaxDate)
getIdUsersToSendFirstAlert in interface IAdminUserDAOalertMaxDate - The maximum date to send alerts.
public List<Integer> getIdUsersToSendOtherAlert(Timestamp alertMaxDate,
Timestamp timeBetweenAlerts,
int maxNumberAlerts)
getIdUsersToSendOtherAlert in interface IAdminUserDAOalertMaxDate - 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 List<Integer> getIdUsersWithExpiredPasswordsList(Timestamp currentTimestamp)
getIdUsersWithExpiredPasswordsList in interface IAdminUserDAOcurrentTimestamp - Timestamp describing the current time.
public void updateUserStatus(List<Integer> listIdUser,
int nNewStatus)
updateUserStatus in interface IAdminUserDAOlistIdUser - List of user accounts to updatenNewStatus - New status of the userpublic void updateNbAlert(List<Integer> listIdUser)
updateNbAlert in interface IAdminUserDAOlistIdUser - The list of users to updatepublic void updateChangePassword(List<Integer> listIdUser)
updateChangePassword in interface IAdminUserDAOlistIdUser - The list of users to update
public void updateUserExpirationDate(int nIdUser,
Timestamp newExpirationDate)
updateUserExpirationDate in interface IAdminUserDAOnIdUser - Id of the admin user to updatenewExpirationDate - New expiration date of the user
public void updateDateLastLogin(int nIdUser,
Timestamp dateLastLogin)
updateDateLastLogin in interface IAdminUserDAOnIdUser - 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 | |||||||||