@ Override public void changed ( ChangeEvent event ) { // forget cached IDs (Should be executed in workExecutor) final long lastSeqPushed = ( isPull ( ) || replicationInternal . lastSequence == null ) ? - 1L : Long . valueOf ( replicationInternal . lastSequence ) ; if ( lastSeqPushed >= 0 && lastSeqPushed != _lastSequencePushed ) { db . runAsync ( new AsyncTask ( ) { @ Override public void run ( Database database ) { synchronized ( _lockPendingDocIDs ) { _lastSequencePushed = lastSeqPushed ; _pendingDocIDs = null ; } } } ) ; } for ( ChangeListener changeListener : changeListeners ) { try { changeListener . changed ( event ) ; } catch ( Exception e ) { Log . e ( Log . TAG_SYNC , "Exception calling changeListener.changed" , e ) ; } } }
This is called back for changes from the ReplicationInternal . Simply propagate the events back to all listeners .