Package com.logicaldoc.core.security.dao
Interface PasswordHistoryDAO
-
- All Superinterfaces:
PersistentObjectDAO<PasswordHistory>
- All Known Implementing Classes:
HibernatePasswordHistoryDAO
public interface PasswordHistoryDAO extends PersistentObjectDAO<PasswordHistory>
This class is a DAO-service for PasswordHistory-objects.- Since:
- 8.6.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanOldHistories(long userId, int retain)
This method deletes all the histories maintaining the most recent ones.List<PasswordHistory>
findByUserId(long userId, Integer max)
Gets all the histories related to a given user ordered by date descPasswordHistory
findByUserIdAndPassword(long userId, String password, int max)
Gets the password used by the user in last max times-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
findByUserIdAndPassword
PasswordHistory findByUserIdAndPassword(long userId, String password, int max) throws PersistenceException
Gets the password used by the user in last max times- Parameters:
userId
- Identifier of the userpassword
- The password to checkmax
- number of most recent records to evaluate- Returns:
- the found history record, if any
- Throws:
PersistenceException
- Error in the database
-
findByUserId
List<PasswordHistory> findByUserId(long userId, Integer max) throws PersistenceException
Gets all the histories related to a given user ordered by date desc- Parameters:
userId
- Identifier of the usermax
- maximum number of returned records- Returns:
- orderer list of histories
- Throws:
PersistenceException
- Error in the database
-
cleanOldHistories
void cleanOldHistories(long userId, int retain)
This method deletes all the histories maintaining the most recent ones. Ifretain
is 0 or -1, the cancellation is not made.- Parameters:
userId
- identifier of the userretain
- the number of most recent histories to maintain
-
-