org.clapper.curn
Class XMLDataPersister

java.lang.Object
  extended by org.clapper.curn.DataPersister
      extended by org.clapper.curn.XMLDataPersister

public class XMLDataPersister
extends DataPersister

Version:
$Revision: 6498 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.clapper.curn.DataPersister
DataPersister.LoadedDataHandler
 
Constructor Summary
XMLDataPersister()
          Creates a new instance of XMLDataPersister
 
Method Summary
protected  void doLoad(DataPersister.LoadedDataHandler loadedDataHandler)
          The actual load method; only called if the object is enabled.
protected  void endLoadOperation()
          Called at the end of the load operation to close files, clean up, etc.
protected  void endSaveOperation()
          Called at the end of the actual save operation to flush files, clean up, etc.
 void init(CurnConfig curnConfig)
          Called when the DataPersister is first instantiated.
protected  boolean isEnabled()
          Determine whether the data persister subclass is enabled or not (i.e., whether or not metadata is to be loaded and saved).
protected  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  void saveFeedData(PersistentFeedData feedData)
          Save the data for one feed, including the items.
protected  void startLoadOperation()
          Called at the beginning of the load operation to initialize the load.
protected  void startSaveOperation()
          Called at the beginning of the actual save operation to initialize the save, etc.
 
Methods inherited from class org.clapper.curn.DataPersister
addPersistentDataClient, loadData, saveData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDataPersister

public XMLDataPersister()
Creates a new instance of XMLDataPersister

Method Detail

init

public void init(CurnConfig curnConfig)
          throws CurnException
Called when the DataPersister is first instantiated. Useful for retrieving configuration values, etc.

Specified by:
init in class DataPersister
Parameters:
curnConfig - the configuration
Throws:
CurnException - on error

isEnabled

protected boolean isEnabled()
Determine whether the data persister subclass is enabled or not (i.e., whether or not metadata is to be loaded and saved). The configuration usually determines whether or not the data persister is enabled.

Specified by:
isEnabled in class DataPersister
Returns:
true if enabled, false if disabled.

startSaveOperation

protected void startSaveOperation()
                           throws CurnException
Called at the beginning of the actual save operation to initialize the save, etc.

Specified by:
startSaveOperation in class DataPersister
Throws:
CurnException - on error

endSaveOperation

protected void endSaveOperation()
                         throws CurnException
Called at the end of the actual save operation to flush files, clean up, etc.

Specified by:
endSaveOperation in class DataPersister
Throws:
CurnException - on error

saveFeedData

protected void saveFeedData(PersistentFeedData feedData)
                     throws CurnException
Save the data for one feed, including the items.

Specified by:
saveFeedData in class DataPersister
Parameters:
feedData - the feed data to be saved
Throws:
CurnException - on error

saveExtraMetadata

protected void saveExtraMetadata(java.util.Collection<PersistentMetadataGroup> metadata)
                          throws CurnException
Save any extra metadata (i.e., metadata that isn't attached to a specific feed or a specific item).

Specified by:
saveExtraMetadata in class DataPersister
Parameters:
metadata - the collection of metadata items
Throws:
CurnException - on error

startLoadOperation

protected void startLoadOperation()
                           throws CurnException
Called at the beginning of the load operation to initialize the load.

Specified by:
startLoadOperation in class DataPersister
Throws:
CurnException - on error

endLoadOperation

protected void endLoadOperation()
                         throws CurnException
Called at the end of the load operation to close files, clean up, etc.

Specified by:
endLoadOperation in class DataPersister
Throws:
CurnException - on error

doLoad

protected void doLoad(DataPersister.LoadedDataHandler loadedDataHandler)
               throws CurnException
The actual load method; only called if the object is enabled.

Specified by:
doLoad in class DataPersister
Parameters:
loadedDataHandler - object to receive data as it's loaded
Throws:
CurnException - on error


Copyright © 2004-2006 Brian M. Clapper. All Rights Reserved.