Class DittoConnection
java.lang.Object
com.ditto.java.DittoConnection
Represents a connection between two peers in a Ditto mesh network.
-
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull DittoConnectionTypeReturns the type of transport enabling this connection.@NonNull StringgetId()Returns the connection ID.@NonNull StringReturns the peer key of the peer at one end of the connection.@NonNull StringReturns the peer key of the peer at the other end of the connection.inthashCode()toString()
-
Method Details
-
getId
Returns the connection ID. This ID is deterministic for any two peers and a given connection type.- Returns:
- the connection ID string.
-
getPeer1Key
Returns the peer key of the peer at one end of the connection. The assignment togetPeer1Key()andgetPeer2Key()is deterministic and stable for any two peers.- Returns:
- the peer key string.
-
getPeer2Key
Returns the peer key of the peer at the other end of the connection. The assignment togetPeer1Key()andgetPeer2Key()is deterministic and stable for any two peers.- Returns:
- the peer key string.
-
getConnectionType
Returns the type of transport enabling this connection.- Returns:
- the
DittoConnectionTypefor this connection.
-
hashCode
-
equals
-
toString
-