public class SyncSession extends Object
SyncConfiguration
.
A Session is created by opening a Realm instance using that configuration. Once a session has been created,
it will continue to exist until the app is closed or all threads using this SyncConfiguration
closes their respective Realm
s.
A session is fully controlled by Realm, but can provide additional information in case of errors.
It is passed along in all SyncSession.ErrorHandler
s.
This object is thread safe.
Modifier and Type | Class and Description |
---|---|
static interface |
SyncSession.ErrorHandler
Interface used to report any session errors.
|
Modifier and Type | Method and Description |
---|---|
void |
downloadAllServerChanges()
Calling this method will block until all known remote changes have been downloaded and applied to the Realm.
|
SyncConfiguration |
getConfiguration()
Returns the
SyncConfiguration that is responsible for controlling the session. |
URI |
getServerUrl()
Returns the
URI describing the remote Realm which this session connects to and synchronizes changes with. |
SyncUser |
getUser()
Returns the
SyncUser defined by the SyncConfiguration that is used to connect to the
Realm Object Server. |
public SyncConfiguration getConfiguration()
SyncConfiguration
that is responsible for controlling the session.public SyncUser getUser()
SyncUser
defined by the SyncConfiguration
that is used to connect to the
Realm Object Server.SyncUser
used to authenticate the session on the Realm Object Server.public URI getServerUrl()
URI
describing the remote Realm which this session connects to and synchronizes changes with.URI
describing the remote Realm.public void downloadAllServerChanges() throws InterruptedException
If the device is offline, this method might never return.
This method cannot be called before the session has been started.
IllegalStateException
- if called on the Android main thread.InterruptedException
- if the thread was interrupted while downloading was in progress.