HttpContent. implementation that wraps any other HttpContent. instance
using it as a caching authority. Only HttpContent instances whose path is not a directory are cached.
No eviction is done by this HttpContent., once an entry is in the cache it is always
assumed to be valid. This class can be extended to implement the validation behaviours on
CachingHttpContent which allow entries to be evicted once they become invalid.
ValidatingCachingHttpContentFactory
| Modifier and Type | Class and Description |
|---|---|
| protected class | |
| protected static interface | |
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpContent. | |
| private final ByteBufferPool | |
| private final ConcurrentHashMap | |
| private final AtomicLong | |
| private int | |
| private int | |
| private long | |
| private boolean | |
| private static final long | |
| private static final int | |
| private static final int | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| protected ConcurrentMap | |
| public int | |
| public long | |
| public HttpContent | getContent(String
The path within the context to the resource path)Implements org.
|
| public int | |
| public int | |
| public long | |
| protected boolean | Returns: whether the HttpContent is cacheable.the HttpContent to test. httpContent)Tests whether the given HttpContent is cacheable, and if there is enough room to fit it in the cache. |
| public boolean | |
| protected CachingHttpContentFactory. | |
| protected CachingHttpContentFactory. | |
| protected void | |
| public void | setMaxCachedFiles(int
the max number of cached files. maxCachedFiles)Set the max number of cached files.. |
| public void | |
| public void | |
| public void | |
| private void |
| _authority | back to summary |
|---|---|
| private final HttpContent. | |
| _bufferPool | back to summary |
|---|---|
| private final ByteBufferPool _bufferPool | |
| _cache | back to summary |
|---|---|
| private final ConcurrentHashMap<String, CachingHttpContentFactory. | |
| _cachedSize | back to summary |
|---|---|
| private final AtomicLong _cachedSize | |
| _maxCachedFiles | back to summary |
|---|---|
| private int _maxCachedFiles | |
| _maxCachedFileSize | back to summary |
|---|---|
| private int _maxCachedFileSize | |
| _maxCacheSize | back to summary |
|---|---|
| private long _maxCacheSize | |
| _useDirectByteBuffers | back to summary |
|---|---|
| private boolean _useDirectByteBuffers | |
| DEFAULT_MAX_CACHE_SIZE | back to summary |
|---|---|
| private static final long DEFAULT_MAX_CACHE_SIZE | |
| DEFAULT_MAX_CACHED_FILE_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_MAX_CACHED_FILE_SIZE | |
| DEFAULT_MAX_CACHED_FILES | back to summary |
|---|---|
| private static final int DEFAULT_MAX_CACHED_FILES | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| CachingHttpContentFactory | back to summary |
|---|---|
| public CachingHttpContentFactory(HttpContent. | |
| flushCache | back to summary |
|---|---|
| public void flushCache() | |
| getCache | back to summary |
|---|---|
| protected ConcurrentMap | |
| getCachedFiles | back to summary |
|---|---|
| public int getCachedFiles() | |
| getCachedSize | back to summary |
|---|---|
| public long getCachedSize() | |
| getContent | back to summary |
|---|---|
| public HttpContent getContent(String path) throws IOException Implements org.
| |
| getMaxCachedFiles | back to summary |
|---|---|
| public int getMaxCachedFiles() Get the max number of cached files..
| |
| getMaxCachedFileSize | back to summary |
|---|---|
| public int getMaxCachedFileSize() | |
| getMaxCacheSize | back to summary |
|---|---|
| public long getMaxCacheSize() | |
| isCacheable | back to summary |
|---|---|
| protected boolean isCacheable(HttpContent httpContent) Tests whether the given HttpContent is cacheable, and if there is enough room to fit it in the cache.
| |
| isUseDirectByteBuffers | back to summary |
|---|---|
| public boolean isUseDirectByteBuffers() | |
| newCachedContent | back to summary |
|---|---|
| protected CachingHttpContentFactory. | |
| newNotFoundContent | back to summary |
|---|---|
| protected CachingHttpContentFactory. | |
| removeFromCache | back to summary |
|---|---|
| protected void removeFromCache(CachingHttpContentFactory. | |
| setMaxCachedFiles | back to summary |
|---|---|
| public void setMaxCachedFiles(int maxCachedFiles) Set the max number of cached files..
| |
| setMaxCachedFileSize | back to summary |
|---|---|
| public void setMaxCachedFileSize(int maxCachedFileSize) | |
| setMaxCacheSize | back to summary |
|---|---|
| public void setMaxCacheSize(long maxCacheSize) | |
| setUseDirectByteBuffers | back to summary |
|---|---|
| public void setUseDirectByteBuffers(boolean useDirectByteBuffers) | |
| shrinkCache | back to summary |
|---|---|
| private void shrinkCache() | |
| Modifier and Type | Field and Description |
|---|---|
| private final RetainableByteBuffer | |
| private final long | |
| private final String | |
| private final String | |
| private final Set | |
| private final HttpField | |
| private final long | |
| private final HttpField | |
| private final boolean | |
| private volatile long | |
| private final HttpField | |
| private final Instant | |
| private final String | |
| private final MimeTypes. | |
| private final Retainable. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | getByteBuffer()
Overrides org. Implements org. Get this HTTP content as a |
| public long | |
| public String | |
| public HttpField | |
| public long | |
| public HttpField | |
| public String | |
| public String | |
| public long | |
| public HttpField | |
| public Instant | |
| public String | |
| public MimeTypes. | |
| public Set | |
| public boolean | |
| public void | |
| public boolean | |
| public void |
| _buffer | back to summary |
|---|---|
| private final RetainableByteBuffer _buffer | |
| _bytesOccupied | back to summary |
|---|---|
| private final long _bytesOccupied | |
| _cacheKey | back to summary |
|---|---|
| private final String _cacheKey | |
| _characterEncoding | back to summary |
|---|---|
| private final String _characterEncoding | |
| _compressedFormats | back to summary |
|---|---|
| private final Set<CompressedContentFormat> _compressedFormats | |
| _contentLength | back to summary |
|---|---|
| private final HttpField _contentLength | |
| _contentLengthValue | back to summary |
|---|---|
| private final long _contentLengthValue | |
| _etagField | back to summary |
|---|---|
| private final HttpField _etagField | |
| _isValid | back to summary |
|---|---|
| private final boolean _isValid | |
| _lastAccessed | back to summary |
|---|---|
| private volatile long _lastAccessed | |
| _lastModified | back to summary |
|---|---|
| private final HttpField _lastModified | |
| _lastModifiedInstant | back to summary |
|---|---|
| private final Instant _lastModifiedInstant | |
| _lastModifiedValue | back to summary |
|---|---|
| private final String _lastModifiedValue | |
| _mimeType | back to summary |
|---|---|
| private final MimeTypes. | |
| _referenceCount | back to summary |
|---|---|
| private final Retainable. | |
| CachedHttpContent | back to summary |
|---|---|
| public CachedHttpContent(String key, HttpContent httpContent) | |
| getByteBuffer | back to summary |
|---|---|
| public ByteBuffer getByteBuffer() Overrides org. Implements org. Doc from org. Get this HTTP content as a Each invocation returns a new
| |
| getBytesOccupied | back to summary |
|---|---|
| public long getBytesOccupied() Overrides org. Overrides default org.
| |
| getCharacterEncoding | back to summary |
|---|---|
| public String getCharacterEncoding() Overrides org. Implements org.
| |
| getContentLength | back to summary |
|---|---|
| public HttpField getContentLength() Overrides org. Implements org.
| |
| getContentLengthValue | back to summary |
|---|---|
| public long getContentLengthValue() Overrides org. Implements org.
| |
| getETag | back to summary |
|---|---|
| public HttpField getETag() Overrides org. Implements org.
| |
| getETagValue | back to summary |
|---|---|
| public String getETagValue() Overrides org. Implements org.
| |
| getKey | back to summary |
|---|---|
| public String getKey() Implements org.
| |
| getLastAccessedNanos | back to summary |
|---|---|
| public long getLastAccessedNanos() Implements org.
| |
| getLastModified | back to summary |
|---|---|
| public HttpField getLastModified() Overrides org. Implements org.
| |
| getLastModifiedInstant | back to summary |
|---|---|
| public Instant getLastModifiedInstant() Overrides org. Implements org.
| |
| getLastModifiedValue | back to summary |
|---|---|
| public String getLastModifiedValue() Overrides org. Implements org.
| |
| getMimeType | back to summary |
|---|---|
| public MimeTypes. Overrides org. Implements org.
| |
| getPreCompressedContentFormats | back to summary |
|---|---|
| public Set Overrides org. Implements org.
| |
| isValid | back to summary |
|---|---|
| public boolean isValid() Implements org.
| |
| release | back to summary |
|---|---|
| public void release() Overrides org. Implements org.
| |
| retain | back to summary |
|---|---|
| public boolean retain() Implements org.
| |
| setLastAccessedNanos | back to summary |
|---|---|
| public void setLastAccessedNanos(long nanosTime) Implements org.
| |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public long | |
| public boolean | |
| public boolean | |
| public void |
| getKey | back to summary |
|---|---|
| public String getKey() | |
| getLastAccessedNanos | back to summary |
|---|---|
| public long getLastAccessedNanos() | |
| isValid | back to summary |
|---|---|
| public boolean isValid() | |
| retain | back to summary |
|---|---|
| public boolean retain() | |
| setLastAccessedNanos | back to summary |
|---|---|
| public void setLastAccessedNanos(long nanosTime) | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private volatile long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | getByteBuffer()
Implements org. Get this HTTP content as a |
| public String | |
| public HttpField | |
| public String | |
| public HttpField | |
| public long | |
| public HttpField | |
| public String | |
| public HttpField | |
| public String | |
| public String | |
| public long | |
| public HttpField | |
| public Instant | |
| public String | |
| public MimeTypes. | |
| public Set | |
| public Resource | |
| public boolean | |
| public void | |
| public boolean | |
| public void |
| _key | back to summary |
|---|---|
| private final String _key | |
| _lastAccessed | back to summary |
|---|---|
| private volatile long _lastAccessed | |
| NotFoundHttpContent | back to summary |
|---|---|
| public NotFoundHttpContent(String key) | |
| getByteBuffer | back to summary |
|---|---|
| public ByteBuffer getByteBuffer() Implements org. Doc from org. Get this HTTP content as a Each invocation returns a new
| |
| getCharacterEncoding | back to summary |
|---|---|
| public String getCharacterEncoding() Implements org.
| |
| getContentEncoding | back to summary |
|---|---|
| public HttpField getContentEncoding() Implements org.
| |
| getContentEncodingValue | back to summary |
|---|---|
| public String getContentEncodingValue() Implements org.
| |
| getContentLength | back to summary |
|---|---|
| public HttpField getContentLength() Implements org.
| |
| getContentLengthValue | back to summary |
|---|---|
| public long getContentLengthValue() Implements org.
| |
| getContentType | back to summary |
|---|---|
| public HttpField getContentType() Implements org.
| |
| getContentTypeValue | back to summary |
|---|---|
| public String getContentTypeValue() Implements org.
| |
| getETag | back to summary |
|---|---|
| public HttpField getETag() Implements org.
| |
| getETagValue | back to summary |
|---|---|
| public String getETagValue() Implements org.
| |
| getKey | back to summary |
|---|---|
| public String getKey() Implements org.
| |
| getLastAccessedNanos | back to summary |
|---|---|
| public long getLastAccessedNanos() Implements org.
| |
| getLastModified | back to summary |
|---|---|
| public HttpField getLastModified() Implements org.
| |
| getLastModifiedInstant | back to summary |
|---|---|
| public Instant getLastModifiedInstant() Implements org.
| |
| getLastModifiedValue | back to summary |
|---|---|
| public String getLastModifiedValue() Implements org.
| |
| getMimeType | back to summary |
|---|---|
| public MimeTypes. Implements org.
| |
| getPreCompressedContentFormats | back to summary |
|---|---|
| public Set Implements org.
| |
| getResource | back to summary |
|---|---|
| public Resource getResource() Implements org.
| |
| isValid | back to summary |
|---|---|
| public boolean isValid() Implements org.
| |
| release | back to summary |
|---|---|
| public void release() Implements org.
| |
| retain | back to summary |
|---|---|
| public boolean retain() Implements org.
| |
| setLastAccessedNanos | back to summary |
|---|---|
| public void setLastAccessedNanos(long nanosTime) Implements org.
| |