com.jalios.jstore
Class SyncManager

java.lang.Object
  extended by com.jalios.jstore.SyncManager
All Implemented Interfaces:
StoreConstants, StoreListener

public class SyncManager
extends Object
implements StoreListener, StoreConstants

This class manages store synchronization

Version:
$Revision: 27753 $
Author:
Olivier Dedieu

Field Summary
static String REVISION
           
 
Fields inherited from interface com.jalios.jstore.StoreConstants
ARRAY_FLAG, CLEANING_STATE, COLLECTION_FLAG, CREATE_OP, DELETE_OP, IDLE_STATE, INNER_LOGS, INNER_MILESTONE, INNER_PREFIX, INNER_SYNC, ITEM_ESCAPE_CHAR, ITEM_SEPARATOR, LOADING_STATE, MAP_ASSIGN, MAP_CHARS_TO_ESCAPE, MAP_CLASS_SEPARATOR, MAP_FLAG, NAMESPACE, SH_SUFFIX, STORING_STATE, UPDATE_OP
 
Constructor Summary
SyncManager(Store store, LogManager logMgr)
           
 
Method Summary
 TreeMap<String,List<StorableLogEntry>> getDataMap()
           
 Stamp getGreatestCommonStamp()
           
 LogEntry getLastSync()
           
 Date getLastSyncDate()
           
 String getLogFilename()
           
 int getOpCount()
           
 TreeMap<String,TreeSet<StorableLogEntry>> getOpMap()
           
 Store getStore()
           
 void handleCommitUpdate(Storable storable, Storable oldStorable, boolean firstTime)
          This method gets called when after a storable has been updated.
 void handleCreate(Storable storable, boolean firstTime)
          This method gets called when a storable is created.
 void handleDelete(Storable storable, boolean firstTime)
          This method gets called when a storable is deleted.
 void handlePrepareUpdate(Storable storable, Map<String,String> attributes, boolean firstTime)
          This method gets called when before a storable will be updated.
 boolean isAvailable()
           
 void replaceDivergentSuffix(TreeSet<StorableLogEntry> newSuffix)
           
 void setLastSyncStamp(Stamp lastSyncStamp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

SyncManager

public SyncManager(Store store,
                   LogManager logMgr)
Method Detail

isAvailable

public boolean isAvailable()

getLastSyncDate

public Date getLastSyncDate()

getLastSync

public LogEntry getLastSync()

setLastSyncStamp

public void setLastSyncStamp(Stamp lastSyncStamp)

getOpMap

public TreeMap<String,TreeSet<StorableLogEntry>> getOpMap()

getDataMap

public TreeMap<String,List<StorableLogEntry>> getDataMap()

getOpCount

public int getOpCount()

getGreatestCommonStamp

public Stamp getGreatestCommonStamp()

getLogFilename

public String getLogFilename()

getStore

public Store getStore()

replaceDivergentSuffix

public void replaceDivergentSuffix(TreeSet<StorableLogEntry> newSuffix)
                            throws IOException
Throws:
IOException

handleCreate

public void handleCreate(Storable storable,
                         boolean firstTime)
This method gets called when a storable is created.

Specified by:
handleCreate in interface StoreListener
Parameters:
storable - the storable
firstTime - true if it is the first time this operation is processed

handlePrepareUpdate

public void handlePrepareUpdate(Storable storable,
                                Map<String,String> attributes,
                                boolean firstTime)
This method gets called when before a storable will be updated.

Specified by:
handlePrepareUpdate in interface StoreListener
Parameters:
storable - the storable
attributes - the attributes to update
firstTime - true if it is the first time this operation is processed

handleCommitUpdate

public void handleCommitUpdate(Storable storable,
                               Storable oldStorable,
                               boolean firstTime)
This method gets called when after a storable has been updated.

Specified by:
handleCommitUpdate in interface StoreListener
Parameters:
storable - the storable
oldStorable - the previous version of the storable
firstTime - true if it is the first time this operation is processed

handleDelete

public void handleDelete(Storable storable,
                         boolean firstTime)
This method gets called when a storable is deleted.

Specified by:
handleDelete in interface StoreListener
Parameters:
storable - the storable
firstTime - true if it is the first time this operation is processed


Copyright © 2001-2010 Jalios SA. All Rights Reserved.