Package org.javlo.service.syncro
Class ServerSynchroService
- java.lang.Object
-
- org.javlo.service.syncro.AbstractSynchroService<BaseSynchroContext>
-
- org.javlo.service.syncro.BaseSynchroService
-
- org.javlo.service.syncro.ServerSynchroService
-
public class ServerSynchroService extends BaseSynchroService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.javlo.service.syncro.BaseSynchroService
BaseSynchroService.FileInfoPathComparator
-
-
Field Summary
-
Fields inherited from class org.javlo.service.syncro.BaseSynchroService
logger, SERVLET_RELATIVE_PATH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyAction(BaseSynchroContext context, String path, AbstractSynchroContext.SynchroAction action)
Apply the action required for the path.String
buildURL(String url)
protected AbstractSynchroContext.SynchroAction
defineAction(BaseSynchroContext context, String path)
Called to define the required action for the specified path.protected void
deleteDistantDirectories(BaseSynchroContext context)
protected void
deleteLocalDirectories(BaseSynchroContext context)
static ServerSynchroService
getInstance(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String dataFolder)
static ServerSynchroService
getInstanceForMailing(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String mailingFolder)
static ServerSynchroService
getInstanceForMailingHistory(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String mailingHistoryFolder)
static ServerSynchroService
getInstanceForShareFiles(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String shareFolder)
static ServerSynchroService
getInstanceForTemplate(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String templateFolder)
String
getLocalName()
Get the name of the local side.protected static HttpClientService
newHttpClientService(String serverURL, String synchroCode, String proxyHost, int proxyPort)
protected void
onShutdown(BaseSynchroContext context)
Called every time a synchro run is finished even if aSynchroFatalException
is thrown.-
Methods inherited from class org.javlo.service.syncro.BaseSynchroService
applyActions, buildConflictPath, buildLocalFile, buildLocalFile, copyDistantToLocal, copyLocalToDistant, copyLocalToDistant, deleteDistantFile, deleteLocalFile, getBaseFolderFile, getDistantName, getHttpClientService, initializeContext, isManageDeletedFiles, isRefreshAll, isSplitBigFiles, moveLocalFile, newSynchroContext, onActionsApplied, onFatalException, onNonFatalException, onUncaughtException, pushContext, sendCommand, sendRefresh, setManageDeletedFiles, setRefreshAll, setSplitBigFiles
-
Methods inherited from class org.javlo.service.syncro.AbstractSynchroService
defineActions, onActionsDefined, synchronize
-
-
-
-
Method Detail
-
getInstance
public static ServerSynchroService getInstance(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String dataFolder)
-
getInstanceForMailing
public static ServerSynchroService getInstanceForMailing(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String mailingFolder)
-
getInstanceForMailingHistory
public static ServerSynchroService getInstanceForMailingHistory(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String mailingHistoryFolder)
-
getInstanceForTemplate
public static ServerSynchroService getInstanceForTemplate(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String templateFolder)
-
getInstanceForShareFiles
public static ServerSynchroService getInstanceForShareFiles(String localName, String serverURL, String proxyHost, int proxyPort, String synchroCode, String shareFolder)
-
newHttpClientService
protected static HttpClientService newHttpClientService(String serverURL, String synchroCode, String proxyHost, int proxyPort)
-
getLocalName
public String getLocalName()
Description copied from class:AbstractSynchroService
Get the name of the local side. Can be used in conflict file name.- Specified by:
getLocalName
in classAbstractSynchroService<BaseSynchroContext>
- Returns:
- the local name
-
defineAction
protected AbstractSynchroContext.SynchroAction defineAction(BaseSynchroContext context, String path) throws SynchroNonFatalException, SynchroFatalException
Description copied from class:AbstractSynchroService
Called to define the required action for the specified path.- Overrides:
defineAction
in classAbstractSynchroService<BaseSynchroContext>
- Parameters:
context
- the currentAbstractSynchroContext
- Returns:
- the required action.
- Throws:
SynchroNonFatalException
SynchroFatalException
-
applyAction
protected void applyAction(BaseSynchroContext context, String path, AbstractSynchroContext.SynchroAction action) throws SynchroNonFatalException
Description copied from class:AbstractSynchroService
Apply the action required for the path.- Overrides:
applyAction
in classBaseSynchroService
- Parameters:
context
- the currentAbstractSynchroContext
- Throws:
SynchroNonFatalException
-
buildURL
public String buildURL(String url)
- Overrides:
buildURL
in classBaseSynchroService
-
onShutdown
protected void onShutdown(BaseSynchroContext context)
Description copied from class:AbstractSynchroService
Called every time a synchro run is finished even if aSynchroFatalException
is thrown. SeeAbstractSynchroContext.isErrorOccured()
.
Not called theAbstractSynchroService.newSynchroContext()
failed.- Overrides:
onShutdown
in classAbstractSynchroService<BaseSynchroContext>
- Parameters:
context
- the currentAbstractSynchroContext
-
deleteDistantDirectories
protected void deleteDistantDirectories(BaseSynchroContext context)
- Overrides:
deleteDistantDirectories
in classBaseSynchroService
-
deleteLocalDirectories
protected void deleteLocalDirectories(BaseSynchroContext context)
- Overrides:
deleteLocalDirectories
in classBaseSynchroService
-
-