Package io.objectbox.sync.listener
Class AbstractSyncListener
java.lang.Object
io.objectbox.sync.listener.AbstractSyncListener
- All Implemented Interfaces:
SyncChangeListener,SyncCompletedListener,SyncConnectionListener,SyncListener,SyncLoginListener,SyncTimeListener
A
SyncListener with empty implementations of all interface methods.
This is helpful if you only want to override some methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the client is disconnected from the sync server, e.g.voidCalled on a successful login.voidonLoginFailed(long syncLoginCode) Called on a login failure.voidonServerTimeUpdate(long serverTimeNanos) Called when server time information is received on the client.voidonSyncChanges(SyncChange[] syncChanges) Called each time when data from sync was applied locally.voidCalled each time a sync was "completed", in the sense that the client caught up with the current server state.
-
Constructor Details
-
AbstractSyncListener
public AbstractSyncListener()
-
-
Method Details
-
onLoggedIn
public void onLoggedIn()Description copied from interface:SyncLoginListenerCalled on a successful login.At this point the connection to the sync destination was established and entered an operational state, in which data can be sent both ways.
- Specified by:
onLoggedInin interfaceSyncLoginListener
-
onLoginFailed
public void onLoginFailed(long syncLoginCode) Description copied from interface:SyncLoginListenerCalled on a login failure. One ofSyncLoginCodes, but neverSyncLoginCodes.OK.- Specified by:
onLoginFailedin interfaceSyncLoginListener
-
onUpdatesCompleted
public void onUpdatesCompleted()Description copied from interface:SyncCompletedListenerCalled each time a sync was "completed", in the sense that the client caught up with the current server state. The client is "up-to-date".- Specified by:
onUpdatesCompletedin interfaceSyncCompletedListener
-
onSyncChanges
Description copied from interface:SyncChangeListenerCalled each time when data from sync was applied locally.- Specified by:
onSyncChangesin interfaceSyncChangeListener- Parameters:
syncChanges- This contains the entity type (schema) ID, the removed IDs and the put IDs for that entity.
-
onServerTimeUpdate
public void onServerTimeUpdate(long serverTimeNanos) Description copied from interface:SyncTimeListenerCalled when server time information is received on the client.- Specified by:
onServerTimeUpdatein interfaceSyncTimeListener
-
onDisconnected
public void onDisconnected()Description copied from interface:SyncConnectionListenerCalled when the client is disconnected from the sync server, e.g. due to a network error.Depending on the configuration, the sync client typically tries to reconnect automatically, triggering a
SyncLoginListeneragain.- Specified by:
onDisconnectedin interfaceSyncConnectionListener
-