|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.curn.DataPersister
public abstract class DataPersister
Persists data to the curn persistent data store, whatever that may be.
| Nested Class Summary | |
|---|---|
static interface |
DataPersister.LoadedDataHandler
Used to define a callback for handling loaded data. |
| Constructor Summary | |
|---|---|
protected |
DataPersister()
|
| Method Summary | |
|---|---|
void |
addPersistentDataClient(PersistentDataClient client)
Register a PersistentDataClient object with this registry. |
protected abstract void |
doLoad(DataPersister.LoadedDataHandler loadedDataHandler)
The actual load method; only called if the object is enabled. |
protected abstract void |
endLoadOperation()
Called at the end of the load operation to close files, clean up, etc. |
protected abstract void |
endSaveOperation()
Called at the end of the actual save operation to flush files, clean up, etc. |
abstract void |
init(CurnConfig curnConfig)
Called when the DataPersister is first instantiated. |
protected abstract boolean |
isEnabled()
Determine whether the data persister subclass is enabled or not (i.e., whether or not metadata is to be loaded and saved). |
void |
loadData(FeedCache feedCache)
Load the cache and metadata. |
void |
saveData(FeedCache feedCache)
Save the feed metadata. |
protected abstract void |
saveExtraMetadata(java.util.Collection<PersistentMetadataGroup> metadata)
Save any extra metadata (i.e., metadata that isn't attached to a specific feed or a specific item). |
protected abstract void |
saveFeedData(PersistentFeedData feedData)
Save the data for one feed, including the items. |
protected abstract void |
startLoadOperation()
Called at the beginning of the load operation to initialize the load. |
protected abstract void |
startSaveOperation()
Called at the beginning of the actual save operation to initialize the save, etc. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DataPersister()
| Method Detail |
|---|
public final void saveData(FeedCache feedCache)
throws CurnException
feedCache - FeedCache object to save
CurnException - on error
public void loadData(FeedCache feedCache)
throws CurnException
feedCache - the FeedCache object to fill
CurnException - on errorpublic final void addPersistentDataClient(PersistentDataClient client)
PersistentDataClient object with this registry.
When data for that client is read, this object will call the
client's process methods. When it's time to save the metadata,
this object will call the client's get methods. Multiple
PersistentDataClient objects may be registered with this object.
client - the PersistentDataClient object
public abstract void init(CurnConfig curnConfig)
throws CurnException
curnConfig - the configuration
CurnException - on errorprotected abstract boolean isEnabled()
protected abstract void startLoadOperation()
throws CurnException
CurnException - on error
protected abstract void endLoadOperation()
throws CurnException
CurnException - on error
protected abstract void doLoad(DataPersister.LoadedDataHandler loadedDataHandler)
throws CurnException
loadedDataHandler - object to receive data as it's loaded
CurnException - on error
protected abstract void startSaveOperation()
throws CurnException
CurnException - on error
protected abstract void endSaveOperation()
throws CurnException
CurnException - on error
protected abstract void saveFeedData(PersistentFeedData feedData)
throws CurnException
feedData - the feed data to be saved
CurnException - on error
protected abstract void saveExtraMetadata(java.util.Collection<PersistentMetadataGroup> metadata)
throws CurnException
metadata - the collection of metadata items
CurnException - on error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||