org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class FileReplicationStatePersistor

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.FileReplicationStatePersistor
All Implemented Interfaces:
ReplicationStatePersister

public class FileReplicationStatePersistor
extends java.lang.Object
implements ReplicationStatePersister

A file-based persister for replication state.


Constructor Summary
FileReplicationStatePersistor(java.io.File stateFile)
          Creates a new instance.
 
Method Summary
 ReplicationState loadState()
          Loads the existing state.
 void saveState(ReplicationState state)
          Persists the state.
 boolean stateExists()
          Checks if state currently exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReplicationStatePersistor

public FileReplicationStatePersistor(java.io.File stateFile)
Creates a new instance.

Parameters:
stateFile - The location of the file containing the persisted data.
Method Detail

loadState

public ReplicationState loadState()
Loads the existing state.

Specified by:
loadState in interface ReplicationStatePersister
Returns:
The state to be loaded.

saveState

public void saveState(ReplicationState state)
Persists the state.

Specified by:
saveState in interface ReplicationStatePersister
Parameters:
state - The state to be persisted.

stateExists

public boolean stateExists()
Checks if state currently exists. If no state exists it will need to be initialized.

Specified by:
stateExists in interface ReplicationStatePersister
Returns:
True if state exists, false otherwise.