Class DittoTransportSnapshot

java.lang.Object
com.ditto.java.DittoTransportSnapshot

public final class DittoTransportSnapshot extends Object

Represents a snapshot of a specific transport's current state.

This class captures the connection type and peer connection states for a single transport at a specific point in time. Peers are categorized by their connection state: connecting, connected, disconnecting, or disconnected.

See Also:
  • Method Details

    • getConnectionType

      public @NonNull String getConnectionType()
      Returns the type of this transport connection.
      Returns:
      a string identifying the connection type (e.g., "Bluetooth", "TCP", "WebSocket").
    • getConnecting

      public long @NonNull [] getConnecting()

      Returns the site IDs of peers that are currently establishing a connection.

      These are peers in the process of connecting but not yet fully connected.

      Returns:
      an array of site IDs for connecting peers.
    • getConnected

      public long @NonNull [] getConnected()

      Returns the site IDs of peers that are currently connected.

      These peers have fully established connections and can exchange data.

      Returns:
      an array of site IDs for connected peers.
    • getDisconnecting

      public long @NonNull [] getDisconnecting()

      Returns the site IDs of peers that are currently disconnecting.

      These are peers in the process of terminating their connection.

      Returns:
      an array of site IDs for disconnecting peers.
    • getDisconnected

      public long @NonNull [] getDisconnected()

      Returns the site IDs of peers that were previously connected but are now disconnected.

      These peers are no longer reachable through this transport.

      Returns:
      an array of site IDs for disconnected peers.
    • hashCode

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

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