|
||||||||||
| 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(java.lang.String strAccessCode)
Check weather the access code already exists or not |
int |
checkEmailAlreadyInUse(java.lang.String strEmail)
Checks the availibility of an email |
boolean |
checkRoleAttributed(java.lang.String strRoleKey)
Checks wether the role is in use or not |
int |
countUserPasswordHistoryFromDate(java.sql.Timestamp minDate,
int nUserId)
Get the number of password change done by a user since the given date. |
void |
delete(int nUserId)
Delete a admin user |
void |
deleteAllDelegatedRightsForUser(int nUserId,
int nUserLevel)
Deletes rights delegated by user ie rights with level < userlevel |
void |
deleteAllOwnRightsForUser(int nUserId,
int nUserLevel)
Deletes rights own by user ie rights with level >= userlevel |
void |
deleteAllRightsForUser(int nUserId)
Delete all rights for an user |
void |
deleteAllRolesForUser(int nUserId)
Remove all roles from an user |
void |
deleteRightForUser(int nUserId,
java.lang.String strIdRight)
Remove a right for an user |
void |
deleteRoleForUser(int nUserId,
java.lang.String strRoleKey)
Remove role for an user |
java.util.List<java.lang.Integer> |
findAllExpiredUserId()
Get the list of id of user with the expired status. |
java.util.List<java.lang.Integer> |
getIdUsersToSendFirstAlert(java.sql.Timestamp alertMaxDate)
Get the list of id of users that need to receive their first alert |
java.util.List<java.lang.Integer> |
getIdUsersToSendOtherAlert(java.sql.Timestamp alertMaxDate,
java.sql.Timestamp timeBetweenAlerts,
int maxNumberAlerts)
Get the list of id of users that need to receive their first alert |
java.util.List<java.lang.Integer> |
getIdUsersWithExpiredLifeTimeList(java.sql.Timestamp currentTimestamp)
Get the list of id of users that have an expired time life but not the expired status |
boolean |
hasRight(int nUserId,
java.lang.String strIdRight)
Check if the user has the given right |
boolean |
hasRole(int nUserId,
java.lang.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(java.lang.String strPassword,
int nUserId)
Log a password change in the password history |
void |
insertRightsListForUser(int nUserId,
java.lang.String strRightId)
Insert a right for a user |
void |
insertRolesListForUser(int nUserId,
java.lang.String strRoleKey)
Add a role to an user |
AdminUser |
load(int nUserId)
Load an AdminUser |
LuteceDefaultAdminUser |
loadDefaultAdminUser(int nUserId)
Gets a default admin user |
int |
newPrimaryKey()
Generates a new primary key |
void |
removeAllPasswordHistoryForUser(int nUserId)
Remove every password saved in the password history for a user. |
java.util.Map<java.lang.String,java.lang.Boolean> |
selectAnonymizationStatusUserStaticField()
Get the anonymization status of a user field. |
java.util.Map<java.lang.String,Right> |
selectRightsListForUser(int nUserId)
Get the right list associated to a given user id |
java.util.Map<java.lang.String,AdminRole> |
selectRolesListForUser(int nUserId)
Get the role list associated to a given user id |
AdminUser |
selectUserByAccessCode(java.lang.String strUserAccessCode)
Get an user by its access code (login) |
java.util.Collection<AdminUser> |
selectUserList()
Get a list of all admin users |
java.util.List<java.lang.String> |
selectUserPasswordHistory(int nUserID)
Gets the history of password of the given user |
java.util.Collection<AdminUser> |
selectUsersByFilter(AdminUserFilter auFilter)
Gets a collection of AdminUser by using a filter. |
java.util.Collection<AdminUser> |
selectUsersByLevel(int nIdLevel)
Select all user that own a given level |
java.util.Collection<AdminUser> |
selectUsersByRight(java.lang.String strIdRight)
Get all users having a given right |
java.util.Collection<AdminUser> |
selectUsersByRole(java.lang.String strRoleKey)
Select all user that own a given role |
void |
store(AdminUser user)
Store an admin user |
void |
store(LuteceDefaultAdminUser user)
Store an admin user |
void |
storeUsersRole(java.lang.String strOldRoleKey,
AdminRole role)
Update role key if role key name has change |
void |
updateAnonymizationStatusUserStaticField(java.lang.String strFieldName,
boolean bAnonymizeFiled)
Update the anonymization status of a user field. |
void |
updateNbAlert(java.util.List<java.lang.Integer> listIdUser)
Increment the number of alert send to users by 1 |
void |
updateUserExpirationDate(int nIdUser,
java.sql.Timestamp newExpirationDate)
Update the admin user expiration date with the new values. |
void |
updateUserStatus(java.util.List<java.lang.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)
IAdminUserDAO
load in interface IAdminUserDAOnUserId - th user id
public AdminUser selectUserByAccessCode(java.lang.String strUserAccessCode)
IAdminUserDAO
selectUserByAccessCode in interface IAdminUserDAOstrUserAccessCode - the login
public java.util.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 java.util.Map<java.lang.String,Right> selectRightsListForUser(int nUserId)
selectRightsListForUser in interface IAdminUserDAOnUserId - the id of the user to retrieve rights
public void insertRightsListForUser(int nUserId,
java.lang.String strRightId)
insertRightsListForUser in interface IAdminUserDAOnUserId - the user idstrRightId - the right idpublic void deleteAllRightsForUser(int nUserId)
deleteAllRightsForUser in interface IAdminUserDAOnUserId - the user idpublic java.util.Map<java.lang.String,AdminRole> selectRolesListForUser(int nUserId)
selectRolesListForUser in interface IAdminUserDAOnUserId - the id of the user to retrieve roles
public void insertRolesListForUser(int nUserId,
java.lang.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(java.lang.String strRoleKey)
checkRoleAttributed in interface IAdminUserDAOstrRoleKey - the role key to check
public int checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
checkAccessCodeAlreadyInUse in interface IAdminUserDAOstrAccessCode - The access code
public int checkEmailAlreadyInUse(java.lang.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 java.util.Collection<AdminUser> selectUsersByRole(java.lang.String strRoleKey)
selectUsersByRole in interface IAdminUserDAOstrRoleKey - The role
public java.util.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(java.lang.String strOldRoleKey,
AdminRole role)
storeUsersRole in interface IAdminUserDAOstrOldRoleKey - The old role key namerole - The new role key
public boolean hasRole(int nUserId,
java.lang.String strRoleKey)
hasRole in interface IAdminUserDAOnUserId - The ID of the userstrRoleKey - The role Key
public void deleteRoleForUser(int nUserId,
java.lang.String strRoleKey)
deleteRoleForUser in interface IAdminUserDAOnUserId - The ID of the userstrRoleKey - The role keypublic java.util.Collection<AdminUser> selectUsersByFilter(AdminUserFilter auFilter)
selectUsersByFilter in interface IAdminUserDAOauFilter - The filter
public java.util.Collection<AdminUser> selectUsersByRight(java.lang.String strIdRight)
selectUsersByRight in interface IAdminUserDAOstrIdRight - The ID right
public boolean hasRight(int nUserId,
java.lang.String strIdRight)
hasRight in interface IAdminUserDAOnUserId - The ID of the userstrIdRight - The ID right
public void deleteRightForUser(int nUserId,
java.lang.String strIdRight)
deleteRightForUser in interface IAdminUserDAOnUserId - The user IDstrIdRight - The right IDpublic java.util.List<java.lang.String> selectUserPasswordHistory(int nUserID)
selectUserPasswordHistory in interface IAdminUserDAOnUserID - Id of the user
public int countUserPasswordHistoryFromDate(java.sql.Timestamp minDate,
int nUserId)
countUserPasswordHistoryFromDate in interface IAdminUserDAOminDate - Minimum date to consider.nUserId - Id of the user
public void insertNewPasswordInHistory(java.lang.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 java.util.Map<java.lang.String,java.lang.Boolean> selectAnonymizationStatusUserStaticField()
selectAnonymizationStatusUserStaticField in interface IAdminUserDAO
public void updateAnonymizationStatusUserStaticField(java.lang.String strFieldName,
boolean bAnonymizeFiled)
updateAnonymizationStatusUserStaticField in interface IAdminUserDAOstrFieldName - Name of the field to updatebAnonymizeFiled - True if the field should be anonymize, false
otherwisepublic java.util.List<java.lang.Integer> findAllExpiredUserId()
findAllExpiredUserId in interface IAdminUserDAOpublic java.util.List<java.lang.Integer> getIdUsersWithExpiredLifeTimeList(java.sql.Timestamp currentTimestamp)
getIdUsersWithExpiredLifeTimeList in interface IAdminUserDAOcurrentTimestamp - Timestamp describing the current time.
public java.util.List<java.lang.Integer> getIdUsersToSendFirstAlert(java.sql.Timestamp alertMaxDate)
getIdUsersToSendFirstAlert in interface IAdminUserDAOalertMaxDate - The maximum date to send alerts.
public java.util.List<java.lang.Integer> getIdUsersToSendOtherAlert(java.sql.Timestamp alertMaxDate,
java.sql.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 void updateUserStatus(java.util.List<java.lang.Integer> listIdUser,
int nNewStatus)
updateUserStatus in interface IAdminUserDAOlistIdUser - List of user accounts to updatenNewStatus - New status of the userpublic void updateNbAlert(java.util.List<java.lang.Integer> listIdUser)
updateNbAlert in interface IAdminUserDAOlistIdUser - The list of users to update
public void updateUserExpirationDate(int nIdUser,
java.sql.Timestamp newExpirationDate)
updateUserExpirationDate in interface IAdminUserDAOnIdUser - Id of the admin user to updatenewExpirationDate - Id of the user to update
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||