public abstract class AbstractReplicator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractReplicator.ActivityLevel
Activity level of a replicator.
|
static class |
AbstractReplicator.Progress
Progress of a replicator.
|
static class |
AbstractReplicator.Status
Combined activity level and progress of a replicator.
|
Constructor and Description |
---|
AbstractReplicator(ReplicatorConfiguration config)
Initializes a replicator with the given configuration.
|
Modifier and Type | Method and Description |
---|---|
ListenerToken |
addChangeListener(Executor executor,
ReplicatorChangeListener listener)
Set the given ReplicatorChangeListener for this replicator, delivering events on the passed executor
|
ListenerToken |
addChangeListener(ReplicatorChangeListener listener)
Set the given ReplicatorChangeListener for this replicator, delivering events on the default executor
|
ListenerToken |
addDocumentReplicationListener(DocumentReplicationListener listener)
Set the given DocumentReplicationListener to the this replicator.
|
ListenerToken |
addDocumentReplicationListener(Executor executor,
DocumentReplicationListener listener)
Set the given DocumentReplicationListener to the this replicator.
|
ReplicatorConfiguration |
getConfig()
The replicator's configuration.
|
AbstractReplicator.Status |
getStatus()
The replicator's current status: its activity level and progress.
|
void |
removeChangeListener(ListenerToken token)
Remove the given ReplicatorChangeListener or DocumentReplicationListener from the this replicator.
|
void |
resetCheckpoint()
Reset the replicator's local checkpoint: read all changes since the beginning of time
from the remote database.
|
void |
start()
Starts the replicator.
|
void |
stop()
Stops a running replicator.
|
String |
toString() |
public AbstractReplicator(ReplicatorConfiguration config)
config
- replicator configurationpublic void start()
public void stop()
public ReplicatorConfiguration getConfig()
public AbstractReplicator.Status getStatus()
public ListenerToken addChangeListener(ReplicatorChangeListener listener)
listener
- callbackpublic ListenerToken addChangeListener(Executor executor, ReplicatorChangeListener listener)
executor
- executor on which events will be deliveredlistener
- callbackpublic void removeChangeListener(ListenerToken token)
token
- returned by a previous call to addChangeListener or addDocumentListener.public ListenerToken addDocumentReplicationListener(DocumentReplicationListener listener)
listener
- callbackpublic ListenerToken addDocumentReplicationListener(Executor executor, DocumentReplicationListener listener)
executor
- executor on which events will be deliveredlistener
- callbackpublic void resetCheckpoint()