|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache
Cache for ontology terms. This cache provides temporary storage for terms after they are retrieved. It acts to minimize network calls (both improving efficiency as well as allowing uninterrupted operation over short-term network outages). Contents of the cache have limited life time (time-to-live), which means that they are removed from the cache after a period of time, and will be retrieved from their original source (when they are needed; this is to allow the system to update to potential changes to the published terminologies).
The cache can be primed by simply reading a term (e.g., with
SSWAP.createSSWAPDocument(java.net.URI)
, for example, during servlet
initialization. Upon reading, full closure of terms referenced therein will
be also be cached. But terms will be purged after the time-to-live (TTL), so
to keep terms persistent in the cache, said terms will need to be re-read at
an interval less than the cache TTL.
The methods in this interface allow basic of control the cache (e.g.,
clear its contents, set time-to-live, etc.). Low level control
of certain parameters may be set with Config
.
Config
,
SSWAP
Method Summary | |
---|---|
void |
clear()
Removes all entries from the cache. |
java.io.File |
getDirectory()
Gets the directory where the cache contents are stored. |
long |
getTimeToLive()
Gets the current time-to-live for entries in this cache; that is, the time after which an entry in this cache is considered stale, and will be retrieved again from its source. |
void |
setTimeToLive(long timeToLive)
Sets the time-to-live for entries in this cache; that is, the time after which an entry in this cache is considered stale, and will be retrieved again from its source. |
Method Detail |
---|
void clear()
long getTimeToLive()
void setTimeToLive(long timeToLive)
timeToLive
- time-to-live for a cache entry in milliseconds (0 disables the cache;
a negative value resets the time-to-live to the default value, as defined in Config
).java.io.File getDirectory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |