Class PersistentBinaryDataCache

    • Constructor Detail

      • PersistentBinaryDataCache

        public PersistentBinaryDataCache​(@NotNull
                                         File dir)
      • PersistentBinaryDataCache

        public PersistentBinaryDataCache​(@NotNull
                                         File dir,
                                         int maxElementsInMemory,
                                         int maxElementsOnDisk,
                                         int timeToLiveSeconds)
    • Method Detail

      • put

        public void put​(@NotNull
                        String key,
                        @Nullable
                        InputStream stream)
        Description copied from interface: BinaryDataCache
        Stores the data presented by the stream object for the given key. The caller is responsible for closing the stream.
        Specified by:
        put in interface BinaryDataCache
        Parameters:
        key - the key
        stream - the data stream. Null is acceptable.
      • hasEntry

        public boolean hasEntry​(@NotNull
                                String key)
        Description copied from interface: BinaryDataCache
        Whether some value with the key is present in the cache
        Specified by:
        hasEntry in interface BinaryDataCache
        Parameters:
        key - the key
        Returns:
        true if present (even null) and false otherwise
      • get

        @Nullable
        public BinaryDataCache.Entry get​(@NotNull
                                         String key)
        Description copied from interface: BinaryDataCache
        Returns the content element associated with the key.
        Specified by:
        get in interface BinaryDataCache
        Parameters:
        key - the key
        Returns:
        the element or null if no entry is present in the cache.
      • invalidate

        public void invalidate​(@NotNull
                               String key)
        Description copied from interface: BinaryDataCache
        Invalidates the data associated with the key.
        Specified by:
        invalidate in interface BinaryDataCache
        Parameters:
        key - the key
      • shutdown

        public void shutdown()
      • flush

        public void flush()