Class ForcedDiskCacheStorage
- java.lang.Object
-
- io.github.jeremylong.openvulnerability.client.ForcedDiskCacheStorage
-
- All Implemented Interfaces:
org.apache.hc.client5.http.cache.HttpCacheStorage
public class ForcedDiskCacheStorage extends java.lang.Object implements org.apache.hc.client5.http.cache.HttpCacheStorageForced persistent cache storage. The implementation will cache the response to disk and consider it valid for a configurable duration, the default is 20 hours.
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.DurationDEFAULT_TTL
-
Constructor Summary
Constructors Constructor Description ForcedDiskCacheStorage(java.lang.String storagePath)ForcedDiskCacheStorage(java.lang.String storagePath, java.time.Duration timeToLive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,org.apache.hc.client5.http.cache.HttpCacheEntry>getEntries(java.util.Collection<java.lang.String> keys)org.apache.hc.client5.http.cache.HttpCacheEntrygetEntry(java.lang.String key)voidputEntry(java.lang.String key, org.apache.hc.client5.http.cache.HttpCacheEntry entry)voidremoveEntry(java.lang.String key)voidupdateEntry(java.lang.String key, org.apache.hc.client5.http.cache.HttpCacheCASOperation casOperation)
-
-
-
Constructor Detail
-
ForcedDiskCacheStorage
public ForcedDiskCacheStorage(java.lang.String storagePath) throws java.io.IOException- Throws:
java.io.IOException
-
ForcedDiskCacheStorage
public ForcedDiskCacheStorage(java.lang.String storagePath, java.time.Duration timeToLive) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
putEntry
public void putEntry(java.lang.String key, org.apache.hc.client5.http.cache.HttpCacheEntry entry) throws org.apache.hc.client5.http.cache.ResourceIOException- Specified by:
putEntryin interfaceorg.apache.hc.client5.http.cache.HttpCacheStorage- Throws:
org.apache.hc.client5.http.cache.ResourceIOException
-
getEntry
public org.apache.hc.client5.http.cache.HttpCacheEntry getEntry(java.lang.String key) throws org.apache.hc.client5.http.cache.ResourceIOException- Specified by:
getEntryin interfaceorg.apache.hc.client5.http.cache.HttpCacheStorage- Throws:
org.apache.hc.client5.http.cache.ResourceIOException
-
removeEntry
public void removeEntry(java.lang.String key) throws org.apache.hc.client5.http.cache.ResourceIOException- Specified by:
removeEntryin interfaceorg.apache.hc.client5.http.cache.HttpCacheStorage- Throws:
org.apache.hc.client5.http.cache.ResourceIOException
-
updateEntry
public void updateEntry(java.lang.String key, org.apache.hc.client5.http.cache.HttpCacheCASOperation casOperation) throws org.apache.hc.client5.http.cache.ResourceIOException- Specified by:
updateEntryin interfaceorg.apache.hc.client5.http.cache.HttpCacheStorage- Throws:
org.apache.hc.client5.http.cache.ResourceIOException
-
getEntries
public java.util.Map<java.lang.String,org.apache.hc.client5.http.cache.HttpCacheEntry> getEntries(java.util.Collection<java.lang.String> keys) throws org.apache.hc.client5.http.cache.ResourceIOException- Specified by:
getEntriesin interfaceorg.apache.hc.client5.http.cache.HttpCacheStorage- Throws:
org.apache.hc.client5.http.cache.ResourceIOException
-
-