Interface DocumentHistoryDAO

All Superinterfaces:
PersistentObjectDAO<DocumentHistory>
All Known Implementing Classes:
HibernateDocumentHistoryDAO

public interface DocumentHistoryDAO extends PersistentObjectDAO<DocumentHistory>
DAO for DocumentHistory handling.
Author:
Michael Scholz, Alessandro Gasparini - LogicalDOC
  • Method Details

    • findByDocId

      List<DocumentHistory> findByDocId(long docId) throws PersistenceException
      This method selects all histories of a given document.
      Parameters:
      docId - - ID of the document.
      Returns:
      list of histories ordered by date
      Throws:
      PersistenceException - Error in the database
    • findByDocIdAndEvent

      List<DocumentHistory> findByDocIdAndEvent(long docId, String event) throws PersistenceException
      This method selects all histories of a given document.
      Parameters:
      docId - - ID of the document.
      event - - Optional event code
      Returns:
      list of histories ordered by date
      Throws:
      PersistenceException - Error in the database
    • findByUserId

      List<DocumentHistory> findByUserId(long userId) throws PersistenceException
      This method selects all histories of a given user.
      Parameters:
      userId - identifier of the user
      Returns:
      list of histories ordered by date
      Throws:
      PersistenceException - Error in the database
    • findByFolderId

      List<DocumentHistory> findByFolderId(long folderId) throws PersistenceException
      This method selects all histories of a given folder.
      Parameters:
      folderId - - ID of the document.
      Returns:
      list of histories ordered by date
      Throws:
      PersistenceException - Error in the database
    • findByPath

      List<DocumentHistory> findByPath(String pathExpression, Date oldestDate, Collection<String> events, Integer max) throws PersistenceException
      This method finds all histories about a path (you can use expression)
      Parameters:
      pathExpression - The path expression (like /Default/acme%)
      oldestDate - The older date for the retrieved histories
      events - events Optional list of event codes to be used as filter
      max - Optional maximum number of records
      Returns:
      list of histories ordered by date asc
      Throws:
      PersistenceException - Error in the database
    • findNotNotified

      List<DocumentHistory> findNotNotified(Integer max) throws PersistenceException
      This method selects all histories not notified yet.
      Parameters:
      max - Optional maximum number of records
      Returns:
      list of histories ordered by date
      Throws:
      PersistenceException - Error in the database
    • cleanOldHistories

      void cleanOldHistories(int ttl) throws PersistenceException
      This method deletes all the document history entries older than the given days from now. If ttl is 0 or -1, the deletion is not made.
      Parameters:
      ttl - The maximum number of days over which the history is considered old
      Throws:
      PersistenceException - Error in the database
    • markHistoriesAsRead

      void markHistoriesAsRead(String event, long userId) throws PersistenceException
      Marks all the histories of a specific event as read by the specified user.
      Parameters:
      event - the event name
      userId - identifier of the user
      Throws:
      PersistenceException - Error in the database
    • findByUserIdAndEvent

      List<DocumentHistory> findByUserIdAndEvent(long userId, String event, String sessionId) throws PersistenceException
      This method selects all histories of a given user and related to the given event.
      Parameters:
      userId - The user identifier
      sessionId - The session identifier (optional)
      event - Code of the event (optional)
      Returns:
      list of histories ordered by date
      Throws:
      PersistenceException - Error in the database