Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Enum SyncSession.State

On this page

  • io.realm.mongodb.sync
  • Enum Constant Summary
  • Method Summary
  • Inherited Methods
  • Enum Constant Detail
  • ACTIVE
  • DYING
  • INACTIVE
  • WAITING_FOR_ACCESS_TOKEN
  • Method Detail
  • valueOf
  • values
java.lang.Object
io.realm.mongodb.sync.SyncSession.State

Enclosing class:

SyncSession

Enum describing the states a SyncSession can be in. The initial state is State.INACTIVE .

A Realm will automatically synchronize data with the server if the session is either State.ACTIVE or State.DYING and isConnected() returns true .

Enum Constant and Description

ACTIVE

The Realm is open and data will be synchronized between the device and the server if the underlying connection is ConnectionState.CONNECTED .

DYING

The Realm was closed, but still contains data that needs to be synchronized to the server.

INACTIVE

This is the initial state.

WAITING_FOR_ACCESS_TOKEN

The user is attempting to synchronize data but needs a valid access token to do so.

Modifier and Type
Method and Description
public static SyncSession.State
public static SyncSession.State
  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

  • Methods inherited from class java.lang.Enum : name , ordinal , toString , equals , hashCode , clone , compareTo , getDeclaringClass , valueOf , finalize

public static final SyncSession.State

The Realm is open and data will be synchronized between the device and the server if the underlying connection is ConnectionState.CONNECTED .

The session will remain in this state until the Realm is closed. In which case it will become DYING .

public static final SyncSession.State

The Realm was closed, but still contains data that needs to be synchronized to the server. The session will attempt to upload all local data before going INACTIVE .

public static final SyncSession.State

This is the initial state. The session is closed. No data is being synchronized. The session will automatically transition to ACTIVE when a Realm is opened.

public static final SyncSession.State

The user is attempting to synchronize data but needs a valid access token to do so. Realm will either use a cached token or automatically try to acquire one based on the current users login. This requires a network connection.Data cannot be synchronized in this state.

Once a valid token is acquired, the session will transition to ACTIVE .

public static SyncSession.State valueOf (
String name
)
public static SyncSession.State values ()

Back

SyncSession.ErrorHandler