| Modifier and Type | Class and Description |
|---|---|
| public static enum | |
| public static enum | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicInteger | cacheSize
Cache size. |
| private volatile File | compressedFilesFolder
Folder to store compressed cached files |
| pack-priv static final String[] | |
| private final CompressionConfig | compressionConfig
Compression configuration, used to decide if cached resource has to be compressed or not |
| private DelayedExecutor. | |
| private boolean | enabled
Is the file cache enabled. |
| private final ConcurrentMap | fileCacheMap
A |
| private boolean | fileSendEnabled
true, if zero-copy file-send feature could be used, or false otherwise. |
| private final AtomicLong | heapSize
The current cache size in bytes |
| private static final Logger | |
| private final AtomicLong | mappedMemorySize
The current cache size in bytes |
| private volatile int | maxCacheEntries
The maximum entries in the |
| private long | maxEntrySize
The maximum size of a cached resource. |
| private volatile long | maxLargeFileCacheSize
The maximum memory mapped bytes. |
| private volatile long | maxSmallFileCacheSize
The maximum cached bytes |
| private long | minEntrySize
The maximum size of a cached resource. |
| protected final DefaultMonitoringConfig | monitoringConfig
File cache probes |
| private final FileCacheEntry | |
| private int | secondsMaxAge
Specifies the maximum time in seconds a resource may be cached. |
| private static final File |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FileCache. | |
| public FileCache. | |
| protected FileCache. | add(final HttpRequestPacket request, final File cacheFile, final long lastModified)
Add a resource to the cache. |
| protected final long | |
| protected final long | |
| private boolean | canBeCompressed(final File cacheFile, final String contentType)
Checks if the |
| private HttpStatus | Returns: HttpStatus if the decision has been made and the response status has been defined, or null
otherwiseCheck if the conditions specified in the optional If headers are satisfied. |
| private HttpStatus | Returns: HttpStatus if the decision has been made and the response status has been defined, or null
otherwisethe FileCacheEntry to validate entry, final HttpRequestPacket The servlet request we are processing request)Check if the if-match condition is satisfied. |
| private HttpStatus | Returns: HttpStatus if the decision has been made and the response status has been defined, or null
otherwiseCheck if the if-modified-since condition is satisfied. |
| private HttpStatus | Returns: HttpStatus if the decision has been made and the response status has been defined, or null
otherwiseCheck if the if-none-match condition is satisfied. |
| private HttpStatus | Returns: HttpStatus if the decision has been made and the response status has been defined, or null
otherwiseCheck if the if-unmodified-since condition is satisfied. |
| protected void | compressFile(final FileCacheEntry entry)
Creates a temporary compressed representation of the given cache entry. |
| protected static long | |
| private FileCacheEntry | |
| protected Object | |
| public FileCacheEntry | |
| public File | |
| public CompressionConfig | |
| public long | |
| public long | |
| public int | |
| public long | getMaxEntrySize()
Returns: the maximum size, in bytes, a resource may be before it can no longer be considered cacheable. |
| public long | |
| public long | getMaxSmallFileCacheSize()
Returns: the maximum size, in bytes, of the heap cache for files below the water mark set by
|
| public long | getMinEntrySize()
Returns: the minimum size, in bytes, a file must be in order to be cached in the heap cache. |
| public MonitoringConfig | getMonitoringConfig()
Implements org. Return the object associated |
| public int | |
| public void | |
| public boolean | |
| public boolean | Returns: true if resources will be sent using
java..
Returns |
| protected static void | notifyProbesEntryAdded(final FileCache
the FileCache event occurred on. fileCache, final FileCacheEntry entry been added entry)Notify registered |
| protected static void | notifyProbesEntryHit(final FileCache
the FileCache event occurred on. fileCache, final FileCacheEntry entry been hit. entry)Notify registered |
| protected static void | notifyProbesEntryMissed(final FileCache
the FileCache event occurred on. fileCache, final HttpRequestPacket HTTP request. request)Notify registered |
| protected static void | notifyProbesEntryRemoved(final FileCache
the FileCache event occurred on. fileCache, final FileCacheEntry entry been removed entry)Notify registered |
| protected static void | notifyProbesError(final FileCache
the FileCache event occurred on. fileCache, final Throwable error)Notify registered |
| protected void | |
| public void | setCompressedFilesFolder(final File compressedFilesFolder)
Sets the folder to be used to store temporary compressed files. |
| public void | |
| public void | setFileSendEnabled(boolean
true to enable
java. support.Configure whether or send-file support will enabled which allows sending |
| public void | setMaxCacheEntries(int
the maximum number of files that may be cached. maxCacheEntries)Sets the maximum number of files that may be cached. |
| public void | setMaxEntrySize(long
the maximum size, in bytes, a resource may be before it can no longer be considered cacheable. maxEntrySize)The maximum size, in bytes, a resource may be before it can no longer be considered cacheable. |
| public void | setMaxLargeFileCacheSize(long
the maximum size, in bytes, of the memory mapped cache for large files. maxLargeFileCacheSize)Sets the maximum size, in bytes, of the memory mapped cache for large files. |
| public void | setMaxSmallFileCacheSize(long
the maximum size, in bytes, of the heap cache for files below the water mark set by
maxSmallFileCacheSize)getMinEntrySize().The maximum size, in bytes, of the heap cache for files below the water mark set by |
| public void | setMinEntrySize(long
the maximum size, in bytes, a file must be in order to be cached in the heap cache. minEntrySize)The maximum size, in bytes, a file must be in order to be cached in the heap cache. |
| public void | setSecondsMaxAge(int
max age of a cached file, in seconds. secondsMaxAge)Sets the maximum time, in seconds, a file may be cached. |
| protected final long | |
| protected final long | |
| private FileCacheEntry | Returns: the preinitializedFileCacheEntryMap the file to a |
| cacheSize | back to summary |
|---|---|
| private final AtomicInteger cacheSize Cache size. | |
| compressedFilesFolder | back to summary |
|---|---|
| private volatile File compressedFilesFolder Folder to store compressed cached files | |
| COMPRESSION_ALIASES | back to summary |
|---|---|
| pack-priv static final String[] COMPRESSION_ALIASES | |
| compressionConfig | back to summary |
|---|---|
| private final CompressionConfig compressionConfig Compression configuration, used to decide if cached resource has to be compressed or not | |
| delayQueue | back to summary |
|---|---|
| private DelayedExecutor. | |
| enabled | back to summary |
|---|---|
| private boolean enabled Is the file cache enabled. | |
| fileCacheMap | back to summary |
|---|---|
| private final ConcurrentMap<FileCacheKey, FileCacheEntry> fileCacheMap A | |
| fileSendEnabled | back to summary |
|---|---|
| private boolean fileSendEnabled true, if zero-copy file-send feature could be used, or false otherwise. | |
| heapSize | back to summary |
|---|---|
| private final AtomicLong heapSize The current cache size in bytes | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| mappedMemorySize | back to summary |
|---|---|
| private final AtomicLong mappedMemorySize The current cache size in bytes | |
| maxCacheEntries | back to summary |
|---|---|
| private volatile int maxCacheEntries The maximum entries in the | |
| maxEntrySize | back to summary |
|---|---|
| private long maxEntrySize The maximum size of a cached resource. | |
| maxLargeFileCacheSize | back to summary |
|---|---|
| private volatile long maxLargeFileCacheSize The maximum memory mapped bytes. | |
| maxSmallFileCacheSize | back to summary |
|---|---|
| private volatile long maxSmallFileCacheSize The maximum cached bytes | |
| minEntrySize | back to summary |
|---|---|
| private long minEntrySize The maximum size of a cached resource. | |
| monitoringConfig | back to summary |
|---|---|
| protected final DefaultMonitoringConfig<FileCacheProbe> monitoringConfig File cache probes | |
| NULL_CACHE_ENTRY | back to summary |
|---|---|
| private final FileCacheEntry NULL_CACHE_ENTRY | |
| secondsMaxAge | back to summary |
|---|---|
| private int secondsMaxAge Specifies the maximum time in seconds a resource may be cached. | |
| TMP_DIR | back to summary |
|---|---|
| private static final File TMP_DIR | |
| FileCache | back to summary |
|---|---|
| public FileCache() | |
| add | back to summary |
|---|---|
| public FileCache. Add a resource to the cache. Unlike the | |
| add | back to summary |
|---|---|
| public FileCache. Add a | |
| add | back to summary |
|---|---|
| protected FileCache. Add a resource to the cache. | |
| addHeapSize | back to summary |
|---|---|
| protected final long addHeapSize(long size) | |
| addMappedMemorySize | back to summary |
|---|---|
| protected final long addMappedMemorySize(long size) | |
| canBeCompressed | back to summary |
|---|---|
| private boolean canBeCompressed(final File cacheFile, final String contentType) Checks if the | |
| checkIfHeaders | back to summary |
|---|---|
| private HttpStatus checkIfHeaders(final FileCacheEntry entry, final HttpRequestPacket request) throws IOException Check if the conditions specified in the optional If headers are satisfied.
| |
| checkIfMatch | back to summary |
|---|---|
| private HttpStatus checkIfMatch(final FileCacheEntry entry, final HttpRequestPacket request) throws IOException Check if the if-match condition is satisfied.
| |
| checkIfModifiedSince | back to summary |
|---|---|
| private HttpStatus checkIfModifiedSince(final FileCacheEntry entry, final HttpRequestPacket request) throws IOException Check if the if-modified-since condition is satisfied.
| |
| checkIfNoneMatch | back to summary |
|---|---|
| private HttpStatus checkIfNoneMatch(final FileCacheEntry entry, final HttpRequestPacket request) throws IOException Check if the if-none-match condition is satisfied.
| |
| checkIfUnmodifiedSince | back to summary |
|---|---|
| private HttpStatus checkIfUnmodifiedSince(final FileCacheEntry entry, final HttpRequestPacket request) throws IOException Check if the if-unmodified-since condition is satisfied.
| |
| compressFile | back to summary |
|---|---|
| protected void compressFile(final FileCacheEntry entry) Creates a temporary compressed representation of the given cache entry. | |
| convertToLong | back to summary |
|---|---|
| protected static long convertToLong(final String dateHeader) | |
| createEntry | back to summary |
|---|---|
| private FileCacheEntry createEntry(final File file) Creates | |
| createJmxManagementObject | back to summary |
|---|---|
| protected Object createJmxManagementObject() | |
| get | back to summary |
|---|---|
| public FileCacheEntry get(final HttpRequestPacket request) Returns | |
| getCompressedFilesFolder | back to summary |
|---|---|
| public File getCompressedFilesFolder() Returns the folder to be used to store temporary compressed files. | |
| getCompressionConfig | back to summary |
|---|---|
| public CompressionConfig getCompressionConfig() Returns the FileCache compression configuration settings. | |
| getHeapCacheSize | back to summary |
|---|---|
| public long getHeapCacheSize() Return the heap space used for cache
| |
| getMappedCacheSize | back to summary |
|---|---|
| public long getMappedCacheSize() Return the size of Mapped memory used for caching
| |
| getMaxCacheEntries | back to summary |
|---|---|
public int getMaxCacheEntries()
| |
| getMaxEntrySize | back to summary |
|---|---|
public long getMaxEntrySize()
| |
| getMaxLargeFileCacheSize | back to summary |
|---|---|
public long getMaxLargeFileCacheSize()
| |
| getMaxSmallFileCacheSize | back to summary |
|---|---|
public long getMaxSmallFileCacheSize()
| |
| getMinEntrySize | back to summary |
|---|---|
public long getMinEntrySize()
| |
| getMonitoringConfig | back to summary |
|---|---|
| public MonitoringConfig Implements org. Doc from org. Return the object associated
| |
| getSecondsMaxAge | back to summary |
|---|---|
public int getSecondsMaxAge()
| |
| initialize | back to summary |
|---|---|
| public void initialize(final DelayedExecutor delayedExecutor) | |
| isEnabled | back to summary |
|---|---|
public boolean isEnabled()
| |
| isFileSendEnabled | back to summary |
|---|---|
| public boolean isFileSendEnabled()
Returns
By default, this property will be true, except in the following cases:
Finally, if the connection between endpoints is secure, send file functionality will be disabled regardless of configuration.
| |
| notifyProbesEntryAdded | back to summary |
|---|---|
| protected static void notifyProbesEntryAdded(final FileCache fileCache, final FileCacheEntry entry) Notify registered
| |
| notifyProbesEntryHit | back to summary |
|---|---|
| protected static void notifyProbesEntryHit(final FileCache fileCache, final FileCacheEntry entry) Notify registered
| |
| notifyProbesEntryMissed | back to summary |
|---|---|
| protected static void notifyProbesEntryMissed(final FileCache fileCache, final HttpRequestPacket request) Notify registered
| |
| notifyProbesEntryRemoved | back to summary |
|---|---|
| protected static void notifyProbesEntryRemoved(final FileCache fileCache, final FileCacheEntry entry) Notify registered
| |
| notifyProbesError | back to summary |
|---|---|
| protected static void notifyProbesError(final FileCache fileCache, final Throwable error) Notify registered
| |
| remove | back to summary |
|---|---|
| protected void remove(final FileCacheEntry entry) | |
| setCompressedFilesFolder | back to summary |
|---|---|
| public void setCompressedFilesFolder(final File compressedFilesFolder) Sets the folder to be used to store temporary compressed files. | |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean enabled) Enables/disables the
| |
| setFileSendEnabled | back to summary |
|---|---|
| public void setFileSendEnabled(boolean fileSendEnabled) Configure whether or send-file support will enabled which allows sending
| |
| setMaxCacheEntries | back to summary |
|---|---|
| public void setMaxCacheEntries(int maxCacheEntries) Sets the maximum number of files that may be cached.
| |
| setMaxEntrySize | back to summary |
|---|---|
| public void setMaxEntrySize(long maxEntrySize) The maximum size, in bytes, a resource may be before it can no longer be considered cacheable.
| |
| setMaxLargeFileCacheSize | back to summary |
|---|---|
| public void setMaxLargeFileCacheSize(long maxLargeFileCacheSize) Sets the maximum size, in bytes, of the memory mapped cache for large files.
| |
| setMaxSmallFileCacheSize | back to summary |
|---|---|
| public void setMaxSmallFileCacheSize(long maxSmallFileCacheSize) The maximum size, in bytes, of the heap cache for files below the water mark set by
| |
| setMinEntrySize | back to summary |
|---|---|
| public void setMinEntrySize(long minEntrySize) The maximum size, in bytes, a file must be in order to be cached in the heap cache.
| |
| setSecondsMaxAge | back to summary |
|---|---|
| public void setSecondsMaxAge(int secondsMaxAge) Sets the maximum time, in seconds, a file may be cached.
| |
| subHeapSize | back to summary |
|---|---|
| protected final long subHeapSize(long size) | |
| subMappedMemorySize | back to summary |
|---|---|
| protected final long subMappedMemorySize(long size) | |
| tryMapFileToBuffer | back to summary |
|---|---|
| private FileCacheEntry tryMapFileToBuffer(final File file) Map the file to a
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileCache. | |
| public static final FileCache. | |
| public static final FileCache. | |
| public static final FileCache. | |
| public static final FileCache. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static FileCache. | |
| public static FileCache. |
| FAILED | back to summary |
|---|---|
| public static final FileCache. | |
| FAILED_CACHE_FULL | back to summary |
|---|---|
| public static final FileCache. | |
| FAILED_ENTRY_EXISTS | back to summary |
|---|---|
| public static final FileCache. | |
| OK_CACHED | back to summary |
|---|---|
| public static final FileCache. | |
| OK_CACHED_TIMESTAMP | back to summary |
|---|---|
| public static final FileCache. | |
| CacheResult | back to summary |
|---|---|
| private CacheResult() | |
| valueOf | back to summary |
|---|---|
| public static FileCache. | |
| values | back to summary |
|---|---|
| public static FileCache. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileCache. | |
| public static final FileCache. | |
| public static final FileCache. | |
| public static final FileCache. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static FileCache. | |
| public static FileCache. |
| FILE | back to summary |
|---|---|
| public static final FileCache. | |
| HEAP | back to summary |
|---|---|
| public static final FileCache. | |
| MAPPED | back to summary |
|---|---|
| public static final FileCache. | |
| TIMESTAMP | back to summary |
|---|---|
| public static final FileCache. | |
| CacheType | back to summary |
|---|---|
| private CacheType() | |
| valueOf | back to summary |
|---|---|
| public static FileCache. | |
| values | back to summary |
|---|---|
| public static FileCache. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public boolean | |
| public void | setTimeoutMillis(FileCacheEntry element, long timeoutMillis)
Implements org.
|
| EntryResolver | back to summary |
|---|---|
| private EntryResolver() | |
| getTimeoutMillis | back to summary |
|---|---|
| public long getTimeoutMillis(FileCacheEntry element) Implements org.
| |
| removeTimeout | back to summary |
|---|---|
| public boolean removeTimeout(FileCacheEntry element) Implements org.
| |
| setTimeoutMillis | back to summary |
|---|---|
| public void setTimeoutMillis(FileCacheEntry element, long timeoutMillis) Implements org.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | doWork(final FileCacheEntry element)
Implements org. The method is executed by DelayExecutor once element's timeout expires. |
| EntryWorker | back to summary |
|---|---|
| private EntryWorker() | |
| doWork | back to summary |
|---|---|
| public boolean doWork(final FileCacheEntry element) Implements org. Doc from org. The method is executed by DelayExecutor once element's timeout expires.
| |