public enum ClientResyncMode extends Enum<ClientResyncMode>
A Client Resync is triggered if the device and server cannot agree on a common shared history for the Realm file, thus making it impossible for the device to upload or receive any changes. This can happen if the server is rolled back or restored from backup.
IMPORTANT: Just having the device offline will not trigger a Client Resync.
Enum Constant and Description |
---|
DISCARD_LOCAL_REALM
The local Realm will be discarded and replaced with the server side Realm.
|
MANUAL
A manual Client Resync is also known as a Client Reset.
|
RECOVER_LOCAL_REALM
Realm will compare the local Realm with the Realm on the server and automatically transfer
any changes from the local Realm that makes sense to the Realm provided by the server.
|
Modifier and Type | Method and Description |
---|---|
byte |
getNativeValue() |
static ClientResyncMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClientResyncMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClientResyncMode RECOVER_LOCAL_REALM
This is the default mode for fully synchronized Realms. It is not yet supported by Query-based Realms.
public static final ClientResyncMode DISCARD_LOCAL_REALM
This mode is not yet supported by Query-based Realms.
public static final ClientResyncMode MANUAL
A ClientResetRequiredError
will be sent to
SyncSession.ErrorHandler.onError(SyncSession, ObjectServerError)
, triggering
a Client Reset. Doing this provides a handle to both the old and new Realm file, enabling
full control of which changes to move, if any.
This is the only supported mode for Query-based Realms.
public static ClientResyncMode[] values()
for (ClientResyncMode c : ClientResyncMode.values()) System.out.println(c);
public static ClientResyncMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic byte getNativeValue()