public interface WGAPICache
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Callback function used, when the cache is no longer needed.
|
void |
flushAll()
Flush the whole cache, expiring all entries.
|
void |
flushDatabaseCache(WGDatabase database)
Flush the cache for the given database, including all its documents
|
void |
flushDocumentCache(WGDocument doc)
Flush the cache for the given document.
|
long |
getMaxSize()
Returns the maximum number of entries allowed in the cache
|
long |
getSize()
Returns the current number of entries in the cache
|
int |
getUtilisation()
Returns a percent value, describing how many cache retrieval operations actually could return a cache value.
|
void |
init(java.lang.String name,
int capacity)
Initialisation method
|
java.util.Map<java.lang.String,java.lang.Object> |
readExtensionDataCache(WGDocument doc)
Tries to read the extension data cache map for the given document from the cache.
|
java.util.Map<java.lang.String,java.lang.Object> |
readFileMetaDataCache(WGDocument doc)
Tries to read the fileMetadata cache map for the given document from the cache.
|
java.util.Map<java.lang.String,java.lang.Object> |
readItemCache(WGDocument doc)
Tries to read the item cache map for the given document from the cache.
|
java.util.Map<java.lang.String,java.lang.Object> |
readMetaCache(WGDocument doc)
Tries to read the metadata cache map for the given document from the cache.
|
java.util.Map<java.lang.String,java.lang.Object> |
readRelationCache(WGDocument doc)
Tries to read the relation cache map for the given document from the cache.
|
void |
writeExtensionDataCache(WGDocument doc,
java.util.Map<java.lang.String,java.lang.Object> cache)
Writes the extension data cache map for this document to the cache for later retrieval.
|
void |
writeFileMetaDataCache(WGDocument doc,
java.util.Map<java.lang.String,java.lang.Object> cache)
Writes the file meta data cache map for this document to the cache for later retrieval.
|
void |
writeItemCache(WGDocument doc,
java.util.Map<java.lang.String,java.lang.Object> cache)
Writes the item cache map for this document to the cache for later retrieval.
|
void |
writeMetaCache(WGDocument doc,
java.util.Map<java.lang.String,java.lang.Object> cache)
Writes the metadata cache map for this document to the cache for later retrieval.
|
void |
writeRelationCache(WGDocument doc,
java.util.Map<java.lang.String,java.lang.Object> cache)
Writes the relation cache map for this document to the cache for later retrieval.
|
void init(java.lang.String name, int capacity) throws java.lang.Exception
name
- Name of the cachecapacity
- Maximum capacity (entries) of the cachejava.lang.Exception
void destroy()
void writeItemCache(WGDocument doc, java.util.Map<java.lang.String,java.lang.Object> cache)
doc
- The document who's data is cached in this mapcache
- the cache mapvoid writeMetaCache(WGDocument doc, java.util.Map<java.lang.String,java.lang.Object> cache)
doc
- The document who's data is cached in this mapcache
- the cache mapvoid writeRelationCache(WGDocument doc, java.util.Map<java.lang.String,java.lang.Object> cache)
doc
- The document who's data is cached in this mapcache
- the cache mapvoid writeExtensionDataCache(WGDocument doc, java.util.Map<java.lang.String,java.lang.Object> cache)
doc
- The document who's data is cached in this mapcache
- the cache mapvoid writeFileMetaDataCache(WGDocument doc, java.util.Map<java.lang.String,java.lang.Object> cache)
doc
- The document who's data is cached in this mapcache
- the cache mapjava.util.Map<java.lang.String,java.lang.Object> readItemCache(WGDocument doc)
doc
- The document whose item cache map is to be retrievedjava.util.Map<java.lang.String,java.lang.Object> readMetaCache(WGDocument doc)
doc
- The document whose metadata cache map is to be retrievedjava.util.Map<java.lang.String,java.lang.Object> readRelationCache(WGDocument doc)
doc
- The document whose metadata cache map is to be retrievedjava.util.Map<java.lang.String,java.lang.Object> readExtensionDataCache(WGDocument doc)
doc
- The document whose item cache map is to be retrievedjava.util.Map<java.lang.String,java.lang.Object> readFileMetaDataCache(WGDocument doc)
doc
- The document whose item cache map is to be retrievedvoid flushDocumentCache(WGDocument doc)
doc
- void flushAll()
long getSize()
long getMaxSize()
int getUtilisation()
void flushDatabaseCache(WGDatabase database)
database
-