vooga.network.data
Class LocalDataManager

java.lang.Object
  extended by vooga.network.data.DataManager
      extended by vooga.network.data.LocalDataManager

public class LocalDataManager
extends DataManager

LocalDataManager is a DataManager subclass for storing data locally when not connected to the server. It provides the ability to synchronize its locally stored data to the server store upon reconnection.

Author:
tanner schmidt

Constructor Summary
LocalDataManager(VoogaModule module)
          This creates a LocalDataManager for the given module.
 
Method Summary
protected  void initialize()
          Allows subclasses to perform any additional initialization once the data has been loaded from file.
 void synchronizeWithServer()
          Synchronizes the local manager's data with the server.
 
Methods inherited from class vooga.network.data.DataManager
containsData, containsData, containsTable, createTable, eraseData, eraseData, eraseTable, getAllData, getData, getData, getMyData, getMyModule, loadData, saveData, storeData, storeData, synchronize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDataManager

public LocalDataManager(VoogaModule module)
This creates a LocalDataManager for the given module. The manager has access to the local storage of that module's data.

Parameters:
module -
Method Detail

synchronizeWithServer

public void synchronizeWithServer()
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
Synchronizes the local manager's data with the server. The method iterates through each table and key in the local storage. If the server does not contain the table and key combination, it is uploaded, and if it does the most recently updated object is stored in both locations.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

initialize

protected void initialize()
Description copied from class: DataManager
Allows subclasses to perform any additional initialization once the data has been loaded from file.

Specified by:
initialize in class DataManager