Skip to content

Commit 172aa7e

Browse files
Sync: add isServerAvailable.
1 parent f77d83a commit 172aa7e

File tree

2 files changed

+8
-1
lines changed
  • objectbox-java/src/main/java/io/objectbox/sync
  • tests/objectbox-java-test/src/test/java/io/objectbox/sync

2 files changed

+8
-1
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ public static boolean isAvailable() {
1919
return BoxStore.isSyncAvailable();
2020
}
2121

22+
/**
23+
* Returns true if the included native (JNI) ObjectBox library supports Sync server.
24+
*/
25+
public static boolean isServerAvailable() {
26+
return BoxStore.isSyncServerAvailable();
27+
}
28+
2229
/**
2330
* Start building a sync client. Requires the BoxStore that should be synced with the server,
2431
* the URL and port of the server to connect to and credentials to authenticate against the server.

tests/objectbox-java-test/src/test/java/io/objectbox/sync/SyncTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void clientIsNotAvailable() {
2929
*/
3030
@Test
3131
public void serverIsNotAvailable() {
32-
assertFalse(BoxStore.isSyncServerAvailable());
32+
assertFalse(Sync.isServerAvailable());
3333
}
3434

3535
@Test

0 commit comments

Comments
 (0)