Package io.objectbox.sync
Class SyncBuilder
- java.lang.Object
-
- io.objectbox.sync.SyncBuilder
-
public final class SyncBuilder extends java.lang.ObjectA builder to create aSyncClient; the builder itself should be created viaSync.client(BoxStore, String, SyncCredentials).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSyncBuilder.RequestUpdatesMode
-
Field Summary
Fields Modifier and Type Field Description (package private) BoxStoreboxStore(package private) SyncChangeListenerchangeListener(package private) SyncCompletedListenercompletedListener(package private) SyncConnectionListenerconnectionListener(package private) java.util.List<SyncCredentials>credentials(package private) SyncListenerlistener(package private) SyncLoginListenerloginListener(package private) Platformplatform(package private) SyncBuilder.RequestUpdatesModerequestUpdatesMode(package private) SyncTimeListenertimeListener(package private) java.lang.String[]trustedCertPaths(package private) booleanuncommittedAcks(package private) java.lang.Stringurl
-
Constructor Summary
Constructors Constructor Description SyncBuilder(BoxStore boxStore, SyncCredentials credentials)SyncBuilder(BoxStore boxStore, SyncCredentials[] multipleCredentials)SyncBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials credentials)SyncBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials[] multipleCredentials)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SyncClientbuild()Builds and returns a Sync client ready toSyncClient.start().SyncClientbuildAndStart()Builds,startsand returns a Sync client.SyncBuilderchangeListener(SyncChangeListener changeListener)Sets a listener to observe fine granular changes happening during sync.private voidcheckNotNull(java.lang.Object object, java.lang.String message)private static voidcheckSyncFeatureAvailable()SyncBuildercompletedListener(SyncCompletedListener completedListener)Sets a listener to only observe Sync completed events.SyncBuilderconnectionListener(SyncConnectionListener connectionListener)Sets a listener to only observe Sync connection events.SyncBuilderlistener(SyncListener listener)Sets a listener to observe all Sync events like login or sync completion.SyncBuilderloginListener(SyncLoginListener loginListener)Sets a listener to only observe Sync login events.SyncBuilderrequestUpdatesMode(SyncBuilder.RequestUpdatesMode requestUpdatesMode)Configure automatic sync updates from the server.(package private) SyncBuilderserverUrl(java.lang.String url)Allows internal code to set the Sync server URL after creating this builder.SyncBuildertimeListener(SyncTimeListener timeListener)Sets a listener to only observe Sync time events.SyncBuildertrustedCertificates(java.lang.String[] paths)Configures a custom set of directory or file paths to search for trusted certificates in.SyncBuilderuncommittedAcks()Turns on sending of uncommitted acks.
-
-
-
Field Detail
-
platform
final Platform platform
-
boxStore
final BoxStore boxStore
-
url
java.lang.String url
-
credentials
final java.util.List<SyncCredentials> credentials
-
loginListener
@Nullable SyncLoginListener loginListener
-
completedListener
@Nullable SyncCompletedListener completedListener
-
changeListener
@Nullable SyncChangeListener changeListener
-
connectionListener
@Nullable SyncConnectionListener connectionListener
-
timeListener
@Nullable SyncTimeListener timeListener
-
listener
@Nullable SyncListener listener
-
trustedCertPaths
@Nullable java.lang.String[] trustedCertPaths
-
uncommittedAcks
boolean uncommittedAcks
-
requestUpdatesMode
SyncBuilder.RequestUpdatesMode requestUpdatesMode
-
-
Constructor Detail
-
SyncBuilder
@Internal public SyncBuilder(BoxStore boxStore, SyncCredentials credentials)
-
SyncBuilder
@Internal public SyncBuilder(BoxStore boxStore, SyncCredentials[] multipleCredentials)
-
SyncBuilder
@Internal public SyncBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials credentials)
-
SyncBuilder
@Internal public SyncBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials[] multipleCredentials)
-
-
Method Detail
-
checkSyncFeatureAvailable
private static void checkSyncFeatureAvailable()
-
serverUrl
@Internal SyncBuilder serverUrl(java.lang.String url)
Allows internal code to set the Sync server URL after creating this builder.
-
trustedCertificates
public SyncBuilder trustedCertificates(java.lang.String[] paths)
Configures a custom set of directory or file paths to search for trusted certificates in. The first path that exists will be used.Using this option is not recommended in most cases, as by default the sync client uses the certificate authorities trusted by the host platform.
-
requestUpdatesMode
public SyncBuilder requestUpdatesMode(SyncBuilder.RequestUpdatesMode requestUpdatesMode)
Configure automatic sync updates from the server. If automatic sync updates are turned off, they will need to be requested using the sync client.
-
uncommittedAcks
public SyncBuilder uncommittedAcks()
Turns on sending of uncommitted acks.
-
loginListener
public SyncBuilder loginListener(SyncLoginListener loginListener)
Sets a listener to only observe Sync login events.This listener can also be
set or removedon the Sync client directly.
-
completedListener
public SyncBuilder completedListener(SyncCompletedListener completedListener)
Sets a listener to only observe Sync completed events.This listener can also be
set or removedon the Sync client directly.
-
changeListener
public SyncBuilder changeListener(SyncChangeListener changeListener)
Sets a listener to observe fine granular changes happening during sync.This listener can also be
set or removedon the Sync client directly.
-
timeListener
public SyncBuilder timeListener(SyncTimeListener timeListener)
Sets a listener to only observe Sync time events.This listener can also be
set or removedon the Sync client directly.
-
connectionListener
public SyncBuilder connectionListener(SyncConnectionListener connectionListener)
Sets a listener to only observe Sync connection events.This listener can also be
set or removedon the Sync client directly.
-
listener
public SyncBuilder listener(SyncListener listener)
Sets a listener to observe all Sync events like login or sync completion.Note: this will replace any login, completed or connection listener.
This listener can also be
set or removedon the Sync client directly.
-
build
public SyncClient build()
Builds and returns a Sync client ready toSyncClient.start().
-
buildAndStart
public SyncClient buildAndStart()
Builds,startsand returns a Sync client.
-
checkNotNull
private void checkNotNull(java.lang.Object object, java.lang.String message)
-
-