Class DittoPresenceGraph
java.lang.Object
com.ditto.java.DittoPresenceGraph
Represents the Ditto mesh network of peers and their connections between each other.
The
localPeer is the entrypoint,
all others are remote peers known by the local peer (either directly or via other remote peers).-
Method Details
-
getLocalPeer
Returns the local peer in this presence graph.
The local peer is usually the peer represented by the currently running Ditto instance. It serves as the entrypoint to the presence graph. All other peers in the graph are remote peers known by the local peer, either through direct connections or via other remote peers.
- Returns:
- the local
DittoPeer.
-
getRemotePeers
Returns all remote peers known by the local peer.
This includes peers that are directly connected to the local peer as well as peers that are reachable through other remote peers in the mesh network.
- Returns:
- a list of remote
DittoPeerinstances.
-
serializeToJson
Serializes the presence graph to a JSON string.
The JSON representation includes the local peer, all remote peers, and their connections, providing a complete snapshot of the mesh network topology.
- Returns:
- a JSON string representation of the presence graph.
- Throws:
DittoException- if serialization fails.
-
hashCode
-
equals
-
toString
-