Interface QuotaManagerStrategy

All Known Implementing Classes:
StandardQuotaStrategy, UnlimitedQuotaStrategy

public interface QuotaManagerStrategy
Disk quota managers for the CachingContentStore must implement this interface.
Author:
Matt Ward
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    afterWritingCacheFile(long contentSize)
    Called immediately after writing a cache file - specifying the size of the file that was written.
    boolean
    beforeWritingCacheFile(long contentSize)
    Called immediately before writing a cache file or (when cacheOnInBound is set to true for the CachingContentStore) before handing a ContentWriter to a content producer.
  • Method Details

    • beforeWritingCacheFile

      boolean beforeWritingCacheFile(long contentSize)
      Called immediately before writing a cache file or (when cacheOnInBound is set to true for the CachingContentStore) before handing a ContentWriter to a content producer.

      In the latter case, the contentSize will be unknown (0), since the content length hasn't been established yet.

      Parameters:
      contentSize - The size of the content that will be written or 0 if not known.
      Returns:
      true to allow the cache file to be written, false to veto.
    • afterWritingCacheFile

      boolean afterWritingCacheFile(long contentSize)
      Called immediately after writing a cache file - specifying the size of the file that was written. The return value allows implementations control over whether the new cache file is kept (true) or immediately removed (false).
      Parameters:
      contentSize - The size of the content that was written.
      Returns:
      true to allow the cache file to remain, false to immediately delete.