Class SyncFrequency
- java.lang.Object
-
- com.mongodb.stitch.core.services.mongodb.remote.sync.internal.SyncFrequency
-
public abstract class SyncFrequency extends Object
Base representation of the frequency a user may choose for sync. Configurations should be done using the static initializers for the frequency type of choice, e.g.:sync.configure(SyncFrequency.newScheduledConfiguration( 1, TimeUnit.HOURS, true ));
-
-
Constructor Summary
Constructors Constructor Description SyncFrequency()
-
Method Summary
Modifier and Type Method Description static SyncFrequency
onDemand()
A configuration to enforce that the collection will only sync changes when specified by the application.static SyncFrequency
reactive()
A configuration to enforce that when a change is made locally or a change from a remote collection is received, the Stitch application will react to the event immediately.static SyncFrequency
scheduled(long timeInterval, TimeUnit timeUnit, boolean isConnected)
A configuration to enforce that local/remote events will be queued on the device for a specified amount of time (configurable) before they are applied.
-
-
-
Method Detail
-
reactive
public static SyncFrequency reactive()
A configuration to enforce that when a change is made locally or a change from a remote collection is received, the Stitch application will react to the event immediately. If offline and the change was local, the application will queue the event to be synchronized when back online.- Returns:
- a reactive configuration
-
scheduled
public static SyncFrequency scheduled(long timeInterval, @Nonnull TimeUnit timeUnit, boolean isConnected)
A configuration to enforce that local/remote events will be queued on the device for a specified amount of time (configurable) before they are applied.
-
onDemand
public static SyncFrequency onDemand()
A configuration to enforce that the collection will only sync changes when specified by the application.- Returns:
- an on-demand configuration
-
-