Interface Purgeable

All Known Implementing Classes:
FileHistoryDao

public interface Purgeable
Implementors support periodic purging of history entries.
Author:
Brandon Koepke
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isCreatedEntry(File historyDir)
    Determines whether the specified directory should be dropped or not.
    void
    purgeOldEntries(File itemHistoryRoot, int maxEntries)
    Purges entries when there are more entries than specified by max entries.
  • Method Details

    • purgeOldEntries

      void purgeOldEntries(File itemHistoryRoot, int maxEntries)
      Purges entries when there are more entries than specified by max entries.

      The purge will drop old entries according to:

      sort(entries, e.timestamp()); for (int i = maxEntries; i < entries.length(); i++) drop(entries[i]);

      Parameters:
      itemHistoryRoot - the history root to drop entries from.
      maxEntries - the maximum number of entries to retain.
    • isCreatedEntry

      boolean isCreatedEntry(File historyDir)
      Determines whether the specified directory should be dropped or not.
      Parameters:
      historyDir - the directory to check against.
      Returns:
      true if it can be deleted, false otherwise.