public abstract class BaseSynchroService extends AbstractSynchroService<BaseSynchroContext>
AbstractSynchroService.| Modifier and Type | Class and Description |
|---|---|
class |
BaseSynchroService.FileInfoPathComparator |
| Modifier and Type | Field and Description |
|---|---|
static Logger |
logger |
static String |
SERVLET_RELATIVE_PATH |
| Constructor and Description |
|---|
BaseSynchroService(HttpClientService httpClientService,
File baseFolderFile) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyAction(BaseSynchroContext context,
String path,
AbstractSynchroContext.SynchroAction action)
Apply the action required for the path.
|
protected void |
applyActions(BaseSynchroContext context)
Call
#applyAction(AbstractSynchroContext, String, SynchroAction) for each path with a required action. |
protected String |
buildConflictPath(String path) |
File |
buildLocalFile(FileInfo fileInfo) |
File |
buildLocalFile(String relativePath) |
String |
buildURL(String url) |
protected boolean |
copyDistantToLocal(BaseSynchroContext context,
FileInfo distantInfo) |
protected boolean |
copyLocalToDistant(BaseSynchroContext context,
FileInfo localInfo) |
protected boolean |
copyLocalToDistant(BaseSynchroContext context,
FileInfo localInfo,
int retry) |
protected void |
deleteDistantDirectories(BaseSynchroContext context) |
protected boolean |
deleteDistantFile(BaseSynchroContext context,
FileInfo distantInfo) |
protected void |
deleteLocalDirectories(BaseSynchroContext context) |
protected boolean |
deleteLocalFile(BaseSynchroContext context,
FileInfo localInfo) |
File |
getBaseFolderFile() |
String |
getDistantName()
Get the name of the distant side.
|
HttpClientService |
getHttpClientService() |
protected void |
initializeContext(BaseSynchroContext context,
Object previousState)
Initialize the context.
|
boolean |
isManageDeletedFiles() |
boolean |
isRefreshAll() |
boolean |
isSplitBigFiles() |
protected FileInfo |
moveLocalFile(BaseSynchroContext context,
FileInfo localInfo,
String newPath) |
BaseSynchroContext |
newSynchroContext()
Instanciate a context for ONE synchro run.
|
protected void |
onActionsApplied(BaseSynchroContext context)
Called when all actions are applied.
|
protected void |
onFatalException(BaseSynchroContext context,
SynchroFatalException ex)
Called when an
SynchroFatalException is thrown during the synchro process. |
protected void |
onNonFatalException(BaseSynchroContext context,
SynchroNonFatalException ex,
String currentFilePath)
Called when an
SynchroNonFatalException is thrown during the synchro process. |
protected void |
onUncaughtException(BaseSynchroContext context,
Throwable ex)
Called when an exception is thrown during the synchro process.
|
void |
pushContext(String context) |
boolean |
sendCommand(String paramName,
String paramValue) |
void |
sendRefresh() |
void |
setManageDeletedFiles(boolean manageDeletedFiles) |
void |
setRefreshAll(boolean refreshAll) |
void |
setSplitBigFiles(boolean splitBigFiles) |
defineAction, defineActions, getLocalName, onActionsDefined, onShutdown, synchronizepublic static Logger logger
public static final String SERVLET_RELATIVE_PATH
public BaseSynchroService(HttpClientService httpClientService, File baseFolderFile)
public boolean isManageDeletedFiles()
public void setManageDeletedFiles(boolean manageDeletedFiles)
public boolean isSplitBigFiles()
public void setSplitBigFiles(boolean splitBigFiles)
public File getBaseFolderFile()
public String getDistantName()
AbstractSynchroServicegetDistantName in class AbstractSynchroService<BaseSynchroContext>public HttpClientService getHttpClientService()
public BaseSynchroContext newSynchroContext()
AbstractSynchroServicenewSynchroContext in class AbstractSynchroService<BaseSynchroContext>AbstractSynchroContext specialized for the current AbstractSynchroService implementation.protected void initializeContext(BaseSynchroContext context, Object previousState) throws SynchroFatalException
AbstractSynchroServiceinitializeContext in class AbstractSynchroService<BaseSynchroContext>SynchroFatalExceptionprotected void applyActions(BaseSynchroContext context)
AbstractSynchroService#applyAction(AbstractSynchroContext, String, SynchroAction) for each path with a required action.applyActions in class AbstractSynchroService<BaseSynchroContext>context - the current AbstractSynchroContextprotected void applyAction(BaseSynchroContext context, String path, AbstractSynchroContext.SynchroAction action) throws SynchroNonFatalException
AbstractSynchroServiceapplyAction in class AbstractSynchroService<BaseSynchroContext>context - the current AbstractSynchroContextSynchroNonFatalExceptionprotected boolean copyLocalToDistant(BaseSynchroContext context, FileInfo localInfo) throws SynchroNonFatalException
SynchroNonFatalExceptionprotected boolean copyLocalToDistant(BaseSynchroContext context, FileInfo localInfo, int retry) throws SynchroNonFatalException
SynchroNonFatalExceptionprotected boolean copyDistantToLocal(BaseSynchroContext context, FileInfo distantInfo) throws SynchroNonFatalException
SynchroNonFatalExceptionprotected boolean deleteLocalFile(BaseSynchroContext context, FileInfo localInfo)
protected void deleteLocalDirectories(BaseSynchroContext context)
protected boolean deleteDistantFile(BaseSynchroContext context, FileInfo distantInfo)
protected void deleteDistantDirectories(BaseSynchroContext context)
protected FileInfo moveLocalFile(BaseSynchroContext context, FileInfo localInfo, String newPath)
public void pushContext(String context)
public void sendRefresh()
protected void onActionsApplied(BaseSynchroContext context)
AbstractSynchroServiceonActionsApplied in class AbstractSynchroService<BaseSynchroContext>context - the current AbstractSynchroContextprotected void onNonFatalException(BaseSynchroContext context, SynchroNonFatalException ex, String currentFilePath)
AbstractSynchroServiceSynchroNonFatalException is thrown during the synchro process. Only the current file will be skipped.onNonFatalException in class AbstractSynchroService<BaseSynchroContext>context - the current AbstractSynchroContextprotected void onFatalException(BaseSynchroContext context, SynchroFatalException ex)
AbstractSynchroServiceSynchroFatalException is thrown during the synchro process. This is fatal for ONE run.onFatalException in class AbstractSynchroService<BaseSynchroContext>context - the current AbstractSynchroContextprotected void onUncaughtException(BaseSynchroContext context, Throwable ex)
AbstractSynchroServiceonUncaughtException in class AbstractSynchroService<BaseSynchroContext>context - the current AbstractSynchroContext. Can be null if the exception is thrown during the call of AbstractSynchroService.newSynchroContext().public boolean isRefreshAll()
public void setRefreshAll(boolean refreshAll)
Copyright © 2012-2018. All Rights Reserved.