Package io.objectbox.sync.server
Interface SyncServer
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
SyncServerImpl
ObjectBox sync server. Build a server with
Sync.server(io.objectbox.BoxStore, java.lang.String, io.objectbox.sync.SyncCredentials).-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes and cleans up all resources used by this sync server.intgetPort()Gets the port the server has bound to.Gets some statistics from the sync server.getUrl()Gets the URL the server is running at.booleanReturns if the server is up and running.voidsetSyncChangeListener(SyncChangeListener listener) Sets aSyncChangeListener.voidstart()Starts the server (e.g.voidstop()Stops the server.
-
Method Details
-
getUrl
String getUrl()Gets the URL the server is running at. -
getPort
int getPort()Gets the port the server has bound to. -
isRunning
boolean isRunning()Returns if the server is up and running. -
getStatsString
String getStatsString()Gets some statistics from the sync server. -
setSyncChangeListener
Sets aSyncChangeListener. Replaces a previously set listener. Set tonullto remove the listener. -
start
void start()Starts the server (e.g. bind to port) and gets everything operational. -
stop
void stop()Stops the server. -
close
void close()Closes and cleans up all resources used by this sync server. It can no longer be used afterwards, build a new sync server instead. Does nothing if this sync server has already been closed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-