|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CacheRetriever
Interface for retrieving objects to be stored in a Cache. This
interface may be implemented in order to retrieve templates from a different
data store, such as a relational database.
| Method Summary | |
|---|---|
boolean |
connectionOk()
Corresponds to checkCacheDir for file-system implementations. |
boolean |
exists(java.lang.String location)
Tests whether the object still exists in the template repository. |
java.lang.String |
getConnection()
Gets the connection for this retriever. |
java.util.List |
getPreloadData()
Returns a list of objects ( Strings) to pre-load the cache
with. |
long |
lastModified(java.lang.String location)
Determines when the object in the template repository was last modified. |
Cacheable |
loadData(java.lang.String location,
java.lang.String type)
Retrieves data of the appropriate type to be stored in the cache. |
void |
setConnection(java.lang.String connection)
Sets the connection for this retriever. |
| Method Detail |
|---|
Cacheable loadData(java.lang.String location,
java.lang.String type)
throws TemplateException
location - the location of the data to be retrievedtype - the type of object to be returned
Cacheable object loaded from the data source
TemplateException - the object could not be loadedboolean exists(java.lang.String location)
location - the location of the object to be tested
true if the object still exists in the repository,
otherwise falselastModified(java.lang.String)
long lastModified(java.lang.String location)
throws TemplateException
Determines when the object in the template repository was last modified.
location - the location of the object to be tested
TemplateException - is thrown whenever the item:
java.util.List getPreloadData()
throws TemplateException
Strings) to pre-load the cache
with.
List of Strings to preload the cache
with
TemplateException
boolean connectionOk()
throws TemplateException
true if the connection is ok, otherwise
false
TemplateException - whenever the connection has failed, and cannot be
re-establishedvoid setConnection(java.lang.String connection)
connection - the connection string for this retrieverjava.lang.String getConnection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||