Skip to content

Commit baec971

Browse files
Sync docs: add params of client, clarify server auth method param
1 parent 02876aa commit baec971

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
/**
2525
* <a href="https://objectbox.io/sync/">ObjectBox Sync</a> makes data available on other devices.
26-
* Start building a sync client using Sync.{@link #client(BoxStore, String, SyncCredentials)}
27-
* or an embedded server using Sync.{@link #server(BoxStore, String, SyncCredentials)}.
26+
* <p>
27+
* Use the static methods to build a Sync client or embedded server.
2828
*/
2929
@SuppressWarnings({"unused", "WeakerAccess"})
3030
public final class Sync {
@@ -51,8 +51,13 @@ public static boolean isHybridAvailable() {
5151
}
5252

5353
/**
54-
* Start building a sync client. Requires the BoxStore that should be synced with the server,
55-
* the URL and port of the server to connect to and credentials to authenticate against the server.
54+
* Starts building a {@link SyncClient}. Once done, complete with {@link SyncBuilder#build() build()}.
55+
*
56+
* @param boxStore The {@link BoxStore} the client 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://127.0.0.1:9999}.
60+
* @param credentials {@link SyncCredentials} to authenticate with the server.
5661
*/
5762
public static SyncBuilder client(BoxStore boxStore, String url, SyncCredentials credentials) {
5863
return new SyncBuilder(boxStore, url, credentials);
@@ -67,8 +72,8 @@ public static SyncBuilder client(BoxStore boxStore, String url, SyncCredentials
6772
* @param url The URL of the Sync server on which the Sync protocol is exposed. This is typically a WebSockets URL
6873
* starting with {@code ws://} or {@code wss://} (for encrypted connections), for example
6974
* {@code ws://0.0.0.0:9999}.
70-
* @param authenticatorCredentials A list of enabled authentication methods available to Sync clients. Additional
71-
* authenticator credentials can be supplied using the builder. For the embedded server, currently only
75+
* @param authenticatorCredentials An authentication method available to Sync clients and peers. Additional
76+
* authenticator credentials can be supplied using the returned builder. For the embedded server, currently only
7277
* {@link SyncCredentials#sharedSecret} and {@link SyncCredentials#none} are supported.
7378
*/
7479
public static SyncServerBuilder server(BoxStore boxStore, String url, SyncCredentials authenticatorCredentials) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public SyncServerBuilder certificatePath(String certificatePath) {
8989
}
9090

9191
/**
92-
* Adds additional authenticator credentials to authenticate clients with.
92+
* Adds additional authenticator credentials to authenticate clients or peers with.
9393
* <p>
9494
* For the embedded server, currently only {@link SyncCredentials#sharedSecret} and {@link SyncCredentials#none}
9595
* are supported.

0 commit comments

Comments
 (0)