Class DittoTransportConfig

java.lang.Object
com.ditto.java.transports.DittoTransportConfig

public final class DittoTransportConfig extends Object
A configuration object specifying which network transports Ditto should use to sync data. A Ditto object comes with a default transport configuration where all available peer-to-peer transports are enabled. You can customize this by initializing a DittoTransportConfig, adjusting its properties, and supplying it to setTransportConfig() on Ditto. When you initialize a DittoTransportConfig yourself it starts with all transports disabled. You must enable each one directly. Peer-to-peer transports will automatically discover peers in the vicinity and create connections without any configuration. These are configured inside the peerToPeer property. To turn each one on, set its enabled property to true. To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the connect configuration. These are either "host:port" strings for raw TCP sync, or a "wss://…" URL for websockets. The listen configurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of listen can result in insecure configurations.
  • Method Details

    • getPeerToPeer

      public @NonNull DittoPeerToPeer getPeerToPeer()
      Returns the peer-to-peer transport configuration.
      Returns:
      the DittoPeerToPeer configuration for local network transports.
    • getConnect

      public @NonNull DittoConnect getConnect()
      Returns the connect configuration for connecting to remote peers.
      Returns:
      the DittoConnect configuration for TCP and WebSocket connections.
    • getListen

      public @NonNull DittoListen getListen()
      Returns the listen configuration for accepting incoming connections.
      Returns:
      the DittoListen configuration for server-like transport modes.
    • getGlobal

      public @NonNull DittoGlobalConfig getGlobal()
      Returns the global transport configuration.
      Returns:
      the DittoGlobalConfig with settings that apply to all transports.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object