Package com.jalios.jstore
Class SyncManager
- java.lang.Object
 - 
- com.jalios.jstore.SyncManager
 
 
- 
- All Implemented Interfaces:
 StoreConstants,StoreListener
public class SyncManager extends java.lang.Object implements StoreListener, StoreConstants
This class manages store synchronization- Version:
 - $Revision: 27753 $
 - Author:
 - Olivier Dedieu
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREVISION- 
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
Constructors Constructor Description SyncManager(Store store, LogManager logMgr) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.TreeMap<java.lang.String,java.util.List<StorableLogEntry>>getDataMap()StampgetGreatestCommonStamp()LogEntrygetLastSync()java.util.DategetLastSyncDate()java.lang.StringgetLogFilename()intgetOpCount()java.util.TreeMap<java.lang.String,java.util.TreeSet<StorableLogEntry>>getOpMap()StoregetStore()voidhandleCommitUpdate(Storable storable, Storable oldStorable, boolean firstTime)This method gets called when after a storable has been updated.voidhandleCreate(Storable storable, boolean firstTime)This method gets called when a storable is created.voidhandleDelete(Storable storable, boolean firstTime)This method gets called when a storable is deleted.voidhandlePrepareUpdate(Storable storable, java.util.Map<java.lang.String,java.lang.String> attributes, boolean firstTime)This method gets called when before a storable will be updated.booleanisAvailable()voidreplaceDivergentSuffix(java.util.TreeSet<StorableLogEntry> newSuffix)voidsetLastSyncStamp(Stamp lastSyncStamp) 
 - 
 
- 
- 
Field Detail
- 
REVISION
public static final java.lang.String REVISION
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
SyncManager
public SyncManager(Store store, LogManager logMgr)
 
 - 
 
- 
Method Detail
- 
isAvailable
public boolean isAvailable()
 
- 
getLastSyncDate
public java.util.Date getLastSyncDate()
 
- 
getLastSync
public LogEntry getLastSync()
 
- 
setLastSyncStamp
public void setLastSyncStamp(Stamp lastSyncStamp)
 
- 
getOpMap
public java.util.TreeMap<java.lang.String,java.util.TreeSet<StorableLogEntry>> getOpMap()
 
- 
getDataMap
public java.util.TreeMap<java.lang.String,java.util.List<StorableLogEntry>> getDataMap()
 
- 
getOpCount
public int getOpCount()
 
- 
getGreatestCommonStamp
public Stamp getGreatestCommonStamp()
 
- 
getLogFilename
public java.lang.String getLogFilename()
 
- 
getStore
public Store getStore()
 
- 
replaceDivergentSuffix
public void replaceDivergentSuffix(java.util.TreeSet<StorableLogEntry> newSuffix) throws java.io.IOException
- Throws:
 java.io.IOException
 
- 
handleCreate
public void handleCreate(Storable storable, boolean firstTime)
This method gets called when a storable is created.- Specified by:
 handleCreatein interfaceStoreListener- Parameters:
 storable- the storablefirstTime- true if it is the first time this operation is processed
 
- 
handlePrepareUpdate
public void handlePrepareUpdate(Storable storable, java.util.Map<java.lang.String,java.lang.String> attributes, boolean firstTime)
This method gets called when before a storable will be updated.- Specified by:
 handlePrepareUpdatein interfaceStoreListener- Parameters:
 storable- the storableattributes- the attributes to updatefirstTime- 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:
 handleCommitUpdatein interfaceStoreListener- Parameters:
 storable- the storableoldStorable- the previous version of the storablefirstTime- 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:
 handleDeletein interfaceStoreListener- Parameters:
 storable- the storablefirstTime- true if it is the first time this operation is processed
 
 - 
 
 -