Interface RecoverOrDiscardUnsyncedChangesStrategy

    • Method Detail

      • onBeforeReset

        void onBeforeReset​(Realm realm)
        Callback that indicates a Client Reset is about to happen. It provides a handle to the local realm before the reset.
        Specified by:
        onBeforeReset in interface AutomaticClientResetStrategy
        Parameters:
        realm - frozen Realm in its state before the reset.
      • onAfterRecovery

        void onAfterRecovery​(Realm before,
                             Realm after)
        Callback invoked once the Client Reset has recovered the unsynced changes successfully. It provides two Realm instances, a frozen one displaying the state before the reset and a regular Realm with the current state.
        Parameters:
        before - Realm frozen Realm in the state before the reset.
        after - Realm Realm after the reset.
      • onAfterDiscard

        void onAfterDiscard​(Realm before,
                            Realm after)
        Callback invoked before the Client Reset discards any unsynced changes because the recovery failed. It provides two Realm instances, a frozen one displaying the state before the reset and a regular Realm displaying the current state that can be used to recover objects from the reset.
        Parameters:
        before - Realm frozen Realm in the state before the reset.
        after - Realm Realm after the reset.