Interface SyncServer

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
SyncServerImpl

public interface SyncServer extends Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes and cleans up all resources used by this sync server.
    int
    Returns the port this server listens on, or 0 if the server was not yet started.
    Gets some statistics from the sync server.
    Returns the URL this server is listening on, including the bound port (see getPort()).
    boolean
    Returns if the server is up and running.
    void
    void
    Starts the server (e.g.
    void
    Stops the server.
  • Method Details

    • getUrl

      String getUrl()
      Returns the URL this server is listening on, including the bound port (see getPort()).
    • getPort

      int getPort()
      Returns the port this server listens on, or 0 if the server was not yet started.

      This is especially useful if the port was assigned arbitrarily (a "0" port was used in the URL when building the server).

    • isRunning

      boolean isRunning()
      Returns if the server is up and running.
    • getStatsString

      String getStatsString()
      Gets some statistics from the sync server.
    • setSyncChangeListener

      void setSyncChangeListener(@Nullable SyncChangeListener listener)
      Sets a SyncChangeListener. Replaces a previously set listener. Set to null to 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:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable