@Experimental
public class SyncBuilder
extends java.lang.Object
SyncClient; the builder itself should be created via
Sync.client(BoxStore, String, SyncCredentials).| Modifier and Type | Class and Description |
|---|---|
static class |
SyncBuilder.RequestUpdatesMode |
| Constructor and Description |
|---|
SyncBuilder(BoxStore boxStore,
java.lang.String url,
SyncCredentials credentials) |
| Modifier and Type | Method and Description |
|---|---|
SyncClient |
build()
Builds and returns a Sync client ready to
SyncClient.start(). |
SyncClient |
buildAndStart()
Builds,
starts and returns a Sync client. |
SyncBuilder |
changeListener(SyncChangeListener changeListener)
Sets a listener to observe fine granular changes happening during sync.
|
SyncBuilder |
completedListener(SyncCompletedListener completedListener)
Sets a listener to only observe Sync completed events.
|
SyncBuilder |
connectionListener(SyncConnectionListener connectionListener)
Sets a listener to only observe Sync connection events.
|
SyncBuilder |
listener(SyncListener listener)
Sets a listener to observe all Sync events like login or sync completion.
|
SyncBuilder |
loginListener(SyncLoginListener loginListener)
Sets a listener to only observe Sync login events.
|
SyncBuilder |
requestUpdatesMode(SyncBuilder.RequestUpdatesMode requestUpdatesMode)
Configure automatic sync updates from the server.
|
SyncBuilder |
trustedCertificates(java.lang.String[] paths)
Configures a custom set of directory or file paths to search for trusted certificates in.
|
SyncBuilder |
uncommittedAcks()
Turns on sending of uncommitted acks.
|
public SyncBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials credentials)
public SyncBuilder trustedCertificates(java.lang.String[] paths)
Using this option is not recommended in most cases, as by default the sync client uses the certificate authorities trusted by the host platform.
public SyncBuilder requestUpdatesMode(SyncBuilder.RequestUpdatesMode requestUpdatesMode)
public SyncBuilder uncommittedAcks()
public SyncBuilder loginListener(SyncLoginListener loginListener)
This listener can also be set or removed
on the Sync client directly.
public SyncBuilder completedListener(SyncCompletedListener completedListener)
This listener can also be set or removed
on the Sync client directly.
public SyncBuilder changeListener(SyncChangeListener changeListener)
This listener can also be set or removed
on the Sync client directly.
public SyncBuilder connectionListener(SyncConnectionListener connectionListener)
This listener can also be set or removed
on the Sync client directly.
public SyncBuilder listener(SyncListener listener)
Note: this will replace any login, completed or connection listener.
This listener can also be set or removed
on the Sync client directly.
public SyncClient build()
SyncClient.start().public SyncClient buildAndStart()
starts and returns a Sync client.