Package io.objectbox.sync.server
Class SyncServerBuilder
- java.lang.Object
-
- io.objectbox.sync.server.SyncServerBuilder
-
@Experimental public class SyncServerBuilder extends java.lang.Object
Creates aSyncServer
and allows to set additional configuration.
-
-
Constructor Summary
Constructors Constructor Description SyncServerBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials authenticatorCredentials)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SyncServerBuilder
authenticatorCredentials(SyncCredentials authenticatorCredentials)
Adds additional authenticator credentials to authenticate clients with.SyncServer
build()
Builds and returns a Sync server ready toSyncServer.start()
.SyncServer
buildAndStart()
Builds,starts
and returns a Sync server.SyncServerBuilder
certificatePath(java.lang.String certificatePath)
SyncServerBuilder
changeListener(SyncChangeListener changeListener)
Sets a listener to observe fine granular changes happening during sync.SyncServerBuilder
peer(java.lang.String url)
Adds a server peer, to which this server should connect to as a client usingSyncCredentials.none()
.SyncServerBuilder
peer(java.lang.String url, SyncCredentials credentials)
Adds a server peer, to which this server should connect to as a client using the given credentials.
-
-
-
Constructor Detail
-
SyncServerBuilder
public SyncServerBuilder(BoxStore boxStore, java.lang.String url, SyncCredentials authenticatorCredentials)
-
-
Method Detail
-
certificatePath
public SyncServerBuilder certificatePath(java.lang.String certificatePath)
-
authenticatorCredentials
public SyncServerBuilder authenticatorCredentials(SyncCredentials authenticatorCredentials)
Adds additional authenticator credentials to authenticate clients with.
-
changeListener
public SyncServerBuilder changeListener(SyncChangeListener changeListener)
Sets a listener to observe fine granular changes happening during sync.This listener can also be
set or removed
on the Sync server directly.
-
peer
public SyncServerBuilder peer(java.lang.String url)
Adds a server peer, to which this server should connect to as a client usingSyncCredentials.none()
.
-
peer
public SyncServerBuilder peer(java.lang.String url, SyncCredentials credentials)
Adds a server peer, to which this server should connect to as a client using the given credentials.
-
build
public SyncServer build()
Builds and returns a Sync server ready toSyncServer.start()
.Note: this clears all previously set authenticator credentials.
-
buildAndStart
public SyncServer buildAndStart()
Builds,starts
and returns a Sync server.
-
-