public interface CacheValidator
Modifier and Type | Method and Description |
---|---|
ContentHandlerResult |
validateCache(ContentHandlerInput input)
This method is called before each document is stored in or retrieved from the VirtualViewer document cache and
can confirm the operation or prevent it on a document-by-document basis.
|
ContentHandlerResult validateCache(ContentHandlerInput input)
This method is called before each document is stored in or retrieved from the VirtualViewer document cache and can confirm the operation or prevent it on a document-by-document basis.
The response for each document and operation is cached for a short time in VirtualViewer to prevent asking about the same operation multiple times in quick succession. In other words, if a specific document is prevented from being cached, VirtualViewer will not ask again for a few minutes and the document will remain uncached for that time.
input
- ContentHandlerInput containing the following values:
Key | Type | Description |
---|---|---|
KEY_CACHE_ACTION | ContentHandlerInput.VALUE_CACHE_GET or ContentHandlerInput.VALUE_CACHE_PUT | The action to be confirmed for the specified document. GET asks whether the document should be retrieved from the cache, while PUT asks if it should be stored. |
KEY_DOCUMENT_ID | java.lang.String | The key representing the document. Can be retrieved with String documentId = input.getDocumentId(); . |
KEY_CLIENT_INSTANCE_ID | java.lang.String | Custom configurable value used to pass data from client to content handler. If not set then will be
the session ID. Can be retrieved with String clientInstanceId = input.getClientInstanceId(); |
KEY_HTTP_SERVLET_REQUEST | javax.servlet.http.HttpServletRequest | Request that called this method. Can be retrieved with HttpServletRequest request = input.getHttpServletRequest(); |
Key | Type | Description |
---|---|---|
KEY_USE_OF_CACHE_ALLOWED | boolean | true to allow the operation to continue and false to prevent it. This response will be remembered for a few minutes. |
Copyright © 2020 Snowbound Software Corporation. All rights reserved.