Package io.realm.mongodb.sync
Class ClientResetRequiredError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.realm.mongodb.AppException
-
- io.realm.mongodb.sync.ClientResetRequiredError
-
- All Implemented Interfaces:
Serializable
public class ClientResetRequiredError extends AppException
Class encapsulating information needed for handling a Client Reset event.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
executeClientReset()
Calling this method will execute the Client Reset manually instead of waiting until next app restart.File
getBackupFile()
Returns the location of the backed up Realm file.RealmConfiguration
getBackupRealmConfiguration()
The configuration that can be used to open the backup Realm offline.File
getOriginalFile()
Returns the location of the original Realm file.-
Methods inherited from class io.realm.mongodb.AppException
getCategory, getErrorCode, getErrorIntValue, getErrorMessage, getErrorType, getException, toString
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Method Detail
-
executeClientReset
public void executeClientReset()
Calling this method will execute the Client Reset manually instead of waiting until next app restart. This will only be possible if all instances of that Realm have been closed, otherwise aIllegalStateException
will be thrown.After this method returns, the backup file can be found in the location returned by
getBackupFile()
. The file atgetOriginalFile()
have been deleted, but will be recreated from scratch next time a Realm instance is opened.- Throws:
IllegalStateException
- if not all instances have been closed.
-
getBackupFile
public File getBackupFile()
Returns the location of the backed up Realm file. The file will not be present until the Client Reset has been fully executed.- Returns:
- a reference to the location of the backup file once Client Reset has been executed.
Use
file.exists()
to check if the file exists or not.
-
getBackupRealmConfiguration
public RealmConfiguration getBackupRealmConfiguration()
The configuration that can be used to open the backup Realm offline. This configuration can only be used in combination with aDynamicRealm
.- Returns:
- the configuration that can be used to open the backup Realm offline.
-
getOriginalFile
public File getOriginalFile()
Returns the location of the original Realm file. After the Client Reset has completed, the file at this location will be deleted.- Returns:
- a reference to the location of the original Realm file. After Client Reset has been executed this file
will no longer exists. Use
file.exists()
to check this.
-
-