Class AbstractSyncListener

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onDisconnected()
      Called when the client is disconnected from the sync server, e.g.
      void onLoggedIn()
      Called on a successful login.
      void onLoginFailed​(long syncLoginCode)
      Called on a login failure.
      void onServerTimeUpdate​(long serverTimeNanos)
      Called when server time information is received on the client.
      void onSyncChanges​(SyncChange[] syncChanges)
      Called each time when data from sync was applied locally.
      void onUpdatesCompleted()
      Called each time a sync was "completed", in the sense that the client caught up with the current server state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractSyncListener

        public AbstractSyncListener()
    • Method Detail

      • onLoggedIn

        public void onLoggedIn()
        Description copied from interface: SyncLoginListener
        Called 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:
        onLoggedIn in interface SyncLoginListener
      • onUpdatesCompleted

        public void onUpdatesCompleted()
        Description copied from interface: SyncCompletedListener
        Called 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:
        onUpdatesCompleted in interface SyncCompletedListener
      • onSyncChanges

        public void onSyncChanges​(SyncChange[] syncChanges)
        Description copied from interface: SyncChangeListener
        Called each time when data from sync was applied locally.
        Specified by:
        onSyncChanges in interface SyncChangeListener
        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: SyncTimeListener
        Called when server time information is received on the client.
        Specified by:
        onServerTimeUpdate in interface SyncTimeListener
      • onDisconnected

        public void onDisconnected()
        Description copied from interface: SyncConnectionListener
        Called 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 SyncLoginListener again.

        Specified by:
        onDisconnected in interface SyncConnectionListener