Class CacheIndex

java.lang.Object
net.adoptopenjdk.icedteaweb.resources.cache.CacheIndex

class CacheIndex extends Object
Index of the cached resources.

This implementation uses a least recently accessed approach to evict resources when the total size of the cache exceeds the limit.

  • Field Details

  • Constructor Details

  • Method Details

    • findEntry

      Finds a single entry.
      Returns:
      the entry found or empty, never null.
    • findAndMarkAsAccessed

      Optional<CacheIndexEntry> findAndMarkAsAccessed(CacheKey key)
      Finds a single entry and marks it as accessed.
      Returns:
      the entry found or empty, never null.
    • findAllEntries

      Set<CacheIndexEntry> findAllEntries(URL resourceHref)
      Finds all entries matching the resource independent of their version.
      Returns:
      a set of all matching entries, never null.
    • findAllEntries

      Set<CacheIndexEntry> findAllEntries(URL resourceHref, VersionString versionString)
      Finds all entries matching the resource and version.
      Returns:
      a set of all matching entries, never null.
    • getAllEntries

      List<CacheIndexEntry> getAllEntries()
      Returns:
      all entries
    • createEntry

      CacheIndexEntry createEntry(CacheKey key, String entryId)
      Create a new entry.
      Returns:
      the newly created entry
    • removeEntry

      void removeEntry(CacheKey key)
      Marks the entry for deletion
    • removeEntry

      void removeEntry(CacheIndexEntry entry)
      Removes an entry from the index.
    • requestCompression

      void requestCompression()
    • clear

      void clear()
      Removes all entries.
    • markAccessed

      private void markAccessed(CacheIndexEntry entry)