Package org.javlo.service.syncro
Class BaseSynchroContext
- java.lang.Object
-
- org.javlo.service.syncro.AbstractSynchroContext
-
- org.javlo.service.syncro.BaseSynchroContext
-
public class BaseSynchroContext extends AbstractSynchroContext
Javlo implementation of theAbstractSynchroContext
.- Author:
- bdumont
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.javlo.service.syncro.AbstractSynchroContext
AbstractSynchroContext.SynchroAction, AbstractSynchroContext.SynchroSide, AbstractSynchroContext.SynchroState
-
-
Field Summary
-
Fields inherited from class org.javlo.service.syncro.AbstractSynchroContext
actions, changeOccured, errorOccured, report, reportBuffer
-
-
Constructor Summary
Constructors Constructor Description BaseSynchroContext(BaseSynchroService parentService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(String path, AbstractSynchroContext.SynchroSide side1, AbstractSynchroContext.SynchroSide side2)
String
getChecksum(AbstractSynchroContext.SynchroSide side, String path)
List<FileInfo>
getDistantDirectoryToDelete()
FileInfo
getInfo(AbstractSynchroContext.SynchroSide side, String path)
List<FileInfo>
getLocalDirectoryToDelete()
Map<String,FileInfo>
getOutState()
BaseSynchroService
getParentService()
List<String>
getPathList(AbstractSynchroContext.SynchroSide side)
AbstractSynchroContext.SynchroState
getState(AbstractSynchroContext.SynchroSide side, String path)
void
initialize(Object previousState)
protected Map<String,FileInfo>
loadDistantInfo()
protected Map<String,FileInfo>
loadLocalInfo()
protected Map<String,FileInfo>
loadPreviousInfo(Object previousState)
FileInfo
updateOutState(String path, File localFile, FileInfo fileInfo)
-
Methods inherited from class org.javlo.service.syncro.AbstractSynchroContext
getAction, getPathList, getPathsWithAction, getPathsWithAction, getReport, getReportWriter, isChangeOccured, isErrorOccured, onChange, onError, onError, setAction, shutdown
-
-
-
-
Constructor Detail
-
BaseSynchroContext
public BaseSynchroContext(BaseSynchroService parentService)
-
-
Method Detail
-
initialize
public void initialize(Object previousState) throws SynchroFatalException
- Overrides:
initialize
in classAbstractSynchroContext
- Throws:
SynchroFatalException
-
loadDistantInfo
protected Map<String,FileInfo> loadDistantInfo() throws SynchroFatalException
- Throws:
SynchroFatalException
-
loadLocalInfo
protected Map<String,FileInfo> loadLocalInfo() throws SynchroFatalException
- Throws:
SynchroFatalException
-
getParentService
public BaseSynchroService getParentService()
- Overrides:
getParentService
in classAbstractSynchroContext
-
getPathList
public List<String> getPathList(AbstractSynchroContext.SynchroSide side) throws SynchroFatalException
- Specified by:
getPathList
in classAbstractSynchroContext
- Throws:
SynchroFatalException
-
getState
public AbstractSynchroContext.SynchroState getState(AbstractSynchroContext.SynchroSide side, String path) throws SynchroNonFatalException, SynchroFatalException
- Specified by:
getState
in classAbstractSynchroContext
- Throws:
SynchroNonFatalException
SynchroFatalException
-
equals
public boolean equals(String path, AbstractSynchroContext.SynchroSide side1, AbstractSynchroContext.SynchroSide side2) throws SynchroNonFatalException, SynchroFatalException
- Specified by:
equals
in classAbstractSynchroContext
- Throws:
SynchroNonFatalException
SynchroFatalException
-
getInfo
public FileInfo getInfo(AbstractSynchroContext.SynchroSide side, String path)
-
getChecksum
public String getChecksum(AbstractSynchroContext.SynchroSide side, String path)
-
getOutState
public Map<String,FileInfo> getOutState()
- Specified by:
getOutState
in classAbstractSynchroContext
-
-