|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Generic data fetcher/saver/remover interface to a storage receptacle backend like a DB or a filesystem branch. Primary keys of Objects to be stored/retrieved are generated and managed by the implementations of this interface. Therefore, primary keys do not need to be supplied to these methods. (The persist method can even ALWAYS generate a unique primary key on each call-- unless exists is set to true). DestKeys are used for many of the Repository methods below. DestKeys are used so that the repository can have multiple independent stores for multiple values with the same primary key. E.g., I could say this.persist("one"); and this.persist("two") and the DB will have saved this in two places. A particular Repository implementation may or may not permit a null destKey. In general, an implementing class will only be able to handle fetch/save/removes of specific classes. Attempts to fetch/save/remove Objects that do not implement any of these classes will cause a runtime exception.
| Method Summary | |
boolean |
addDestKey(java.lang.String destKey)
Make the supplied destKey a valid destKey. |
java.lang.Object[] |
arrayFetch(java.lang.String queryString,
java.lang.String destKey)
Fetch the reqeusted objects. |
java.lang.Object |
fetch(java.lang.String key,
java.lang.String destKey)
Fetch the requested object. |
java.lang.Class[] |
getPersistableClasses()
Tell what classes this Repository implementation can handle. |
StringSet |
getValidDestKeys()
Return a list of valid destination keys. |
boolean |
isDestKeyValid(java.lang.String destKey)
Says whether the given destKey is valid. |
java.lang.String |
persist(java.lang.Object object,
java.lang.String destKey)
Store the given object. |
java.lang.String |
persist(java.lang.Object object,
java.lang.String destKey,
boolean exists)
Store or update the given object. |
boolean |
remove(java.lang.Object object,
java.lang.String destKey)
Remove the given object from storage. |
boolean |
removeDestKey(java.lang.String destKey)
Make the supplied destKey an invalid destKey. |
| Methods inherited from interface com.admc.jamama.Configurable |
configure, getConfig, getName |
| Method Detail |
public java.lang.Class[] getPersistableClasses()
public StringSet getValidDestKeys()
public boolean isDestKeyValid(java.lang.String destKey)
destKey - The destKey to be checked.
public boolean addDestKey(java.lang.String destKey)
destKey - The key to be added to the valid destKey list.
public boolean removeDestKey(java.lang.String destKey)
destKey - The key to be removed from the valid destKey list.
public java.lang.String persist(java.lang.Object object,
java.lang.String destKey)
throws UnsupportedClassException,
java.io.IOException
object - The object to store. It must be an implementation
of a supported class.destKey - A valid destination key
UnsupportedClassException - if object does not implement a
supported class.
java.io.IOException
public boolean remove(java.lang.Object object,
java.lang.String destKey)
throws java.io.IOException
object - The object to remove. Only the generated primary
key (as generated by the Repository implementation)
is used.destKey - A valid destination key for the given stored object
java.io.IOException
public java.lang.String persist(java.lang.Object object,
java.lang.String destKey,
boolean exists)
throws UnsupportedClassException,
java.io.IOException
object - The object to store. It must be an implementation
of a supported class.destKey - A valid destination keyexists - Whether the primary key (as determined by the
Repository implementation) must already be in
storage for the given destKey.
UnsupportedClassException - if object does not implement a
supported class.
java.io.IOException
public java.lang.Object fetch(java.lang.String key,
java.lang.String destKey)
throws java.io.IOException
key - Primary key of object to fetchdestKey - A valid destination key
java.io.IOException
public java.lang.Object[] arrayFetch(java.lang.String queryString,
java.lang.String destKey)
throws java.io.IOException
queryString - A string used by the Repository implementation
to identify the subset of objects to fetch.destKey - A valid destination key
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||