Skip to content

Commit 126d341

Browse files
SyncServerBuilder: document existing parameters
1 parent 70377ef commit 126d341

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

objectbox-java/src/main/java/io/objectbox/sync/Sync.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package io.objectbox.sync;
1818

1919
import io.objectbox.BoxStore;
20+
import io.objectbox.sync.server.SyncServer;
2021
import io.objectbox.sync.server.SyncServerBuilder;
2122

2223
/**
@@ -50,12 +51,15 @@ public static SyncBuilder client(BoxStore boxStore, String url, SyncCredentials
5051
}
5152

5253
/**
53-
* Start building a sync server. Requires the BoxStore the server should use,
54-
* the URL and port the server should bind to and authenticator credentials to authenticate clients.
55-
* Additional authenticator credentials can be supplied using the builder.
56-
* <p>
57-
* For the embedded server, currently only {@link SyncCredentials#sharedSecret} and {@link SyncCredentials#none}
58-
* are supported.
54+
* Starts building a {@link SyncServer}. Once done, complete with {@link SyncServerBuilder#build() build()}.
55+
*
56+
* @param boxStore The {@link BoxStore} the server should use.
57+
* @param url The URL of the Sync server on which the Sync protocol is exposed. This is typically a WebSockets URL
58+
* starting with {@code ws://} or {@code wss://} (for encrypted connections), for example
59+
* {@code ws://0.0.0.0:9999}.
60+
* @param authenticatorCredentials A list of enabled authentication methods available to Sync clients. Additional
61+
* authenticator credentials can be supplied using the builder. For the embedded server, currently only
62+
* {@link SyncCredentials#sharedSecret} and {@link SyncCredentials#none} are supported.
5963
*/
6064
public static SyncServerBuilder server(BoxStore boxStore, String url, SyncCredentials authenticatorCredentials) {
6165
return new SyncServerBuilder(boxStore, url, authenticatorCredentials);

objectbox-java/src/main/java/io/objectbox/sync/server/SyncServerBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.objectbox.annotation.apihint.Experimental;
2626
import io.objectbox.flatbuffers.FlatBufferBuilder;
2727
import io.objectbox.sync.Credentials;
28+
import io.objectbox.sync.Sync;
2829
import io.objectbox.sync.SyncCredentials;
2930
import io.objectbox.sync.SyncCredentialsToken;
3031
import io.objectbox.sync.listener.SyncChangeListener;
@@ -46,6 +47,9 @@ public class SyncServerBuilder {
4647
private final List<ClusterPeerInfo> clusterPeers = new ArrayList<>();
4748
private int clusterFlags;
4849

50+
/**
51+
* Use {@link Sync#server(BoxStore, String, SyncCredentials)} instead.
52+
*/
4953
public SyncServerBuilder(BoxStore boxStore, String url, SyncCredentials authenticatorCredentials) {
5054
checkNotNull(boxStore, "BoxStore is required.");
5155
checkNotNull(url, "Sync server URL is required.");

0 commit comments

Comments
 (0)