public class SyncTokenService extends AbstractServiceWithBackgroundCheck implements ClusterSyncService
Constructor and Description |
---|
SyncTokenService() |
Modifier and Type | Method and Description |
---|---|
void |
cancelSync() |
ClusterSyncHistory |
getClusterSyncHistory() |
void |
setConsistencyHistory(ClusterSyncHistory consistencyHistory) |
void |
sync(BaseTopologyView view,
java.lang.Runnable callback)
Starts the synchronization process and calls the provided
callback upon completion.
|
static SyncTokenService |
testConstructor(DiscoveryLiteConfig commonsConfig,
ResourceResolverFactory resourceResolverFactory,
SlingSettingsService settingsService) |
static SyncTokenService |
testConstructorAndActivate(DiscoveryLiteConfig commonsConfig,
ResourceResolverFactory resourceResolverFactory,
SlingSettingsService settingsService) |
public static SyncTokenService testConstructorAndActivate(DiscoveryLiteConfig commonsConfig, ResourceResolverFactory resourceResolverFactory, SlingSettingsService settingsService)
public static SyncTokenService testConstructor(DiscoveryLiteConfig commonsConfig, ResourceResolverFactory resourceResolverFactory, SlingSettingsService settingsService)
public void setConsistencyHistory(ClusterSyncHistory consistencyHistory)
public ClusterSyncHistory getClusterSyncHistory()
public void cancelSync()
cancelSync
in interface ClusterSyncService
public void sync(BaseTopologyView view, java.lang.Runnable callback)
ClusterSyncService
sync() is not thread-safe and should not be invoked concurrently.
If sync() gets called before a previous invocation finished, that previous invocation will be discarded, ie the callback of the previous invocation will no longer be called.
The synchronization process consists of making sure that the repository has processed any potential backlog of instances that are no longer part of the provided, new view. Plus it writes a 'sync-token' to a well-defined location, with all peers doing the same, and upon seeing all other sync-tokens declares successful completion - at which point it calls the callback.run().
sync
in interface ClusterSyncService
view
- the view which all instances in the local cluster
should agree on having seencallback
- the runnable which should be called after
successful syncingCopyright © 2010 - 2020 Adobe. All Rights Reserved