public final class SyncHandle
extends java.lang.Object
Represents a handle for the replication operation.
Replicator
Modifier and Type | Method and Description |
---|---|
void |
cancelSync()
Cancels current replication thread.
|
boolean |
isCancelled()
Indicates whether the replicator thread is currently canceled.
|
boolean |
isPaused()
Indicates if the replication is paused or not.
|
boolean |
isStopped()
Indicates whether the replicator is stopped.
|
void |
pauseSync()
Pauses the replicator.
|
void |
resetLocalWithRemote(int offset,
int size)
Resets local collection with the remote collection.
|
void |
resetRemoteWithLocal(int offset,
int size)
Resets remote collection with the local collection.
|
void |
resumeSync()
Resumes a paused replicator.
|
void |
startSync()
Starts replication in a background thread.
|
void |
stopSync()
Stops current replicator.
|
public void startSync()
Starts replication in a background thread. This background thread will run after every fixed amount of time (sync delay).
This operations will notify all SyncEventListener
instances with event type EventType.STARTED .
|
public void pauseSync()
Pauses the replicator. If any replicator thread is currently
running, it will not be paused but the next iteration will be paused
until it has been resumed by resumeSync()
call.
public void resumeSync()
Resumes a paused replicator.
public void resetLocalWithRemote(int offset, int size)
Resets local collection with the remote collection.
Data can be fetched from remote in pages using offset
and size
parameters.
offset
- the pagination offsetsize
- the pagination sizepublic void resetRemoteWithLocal(int offset, int size)
Resets remote collection with the local collection.
Data can be fetched from local in pages using offset
and size
parameters.
offset
- the pagination offsetsize
- the pagination sizepublic void cancelSync()
Cancels current replication thread.
This operations will notify all SyncEventListener
instances with event type EventType.CANCELED .
|
public boolean isCancelled()
Indicates whether the replicator thread is currently canceled.
true
if cancelled; false
otherwise.public void stopSync()
Stops current replicator.
public boolean isStopped()
Indicates whether the replicator is stopped.
true
if stopped; false
otherwise.@Generated(value="lombok") public boolean isPaused()
Indicates if the replication is paused or not.