Class DittoPeer
java.lang.Object
com.ditto.java.DittoPeer
-
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull DittoAddressReturns the unique network identifier of the peer.@NonNull List<? extends @NonNull DittoConnection> Returns the connections that are currently active with the current peer.@NonNull StringReturns the human-readable device name of the peer.@Nullable StringReturns the Ditto SDK version the peer is running with.Returns metadata associated with the peer by the identity service.@Nullable StringgetOs()Returns the operating system of the peer, if known.@NonNull StringReturns the peer key, a unique identifier for this peer.@NonNull DittoJsonSerializable.ObjectValueReturns metadata associated with the peer, empty dictionary by default.inthashCode()@Nullable BooleanIndicates whether the peer is compatible with the current peer.booleanIndicates whether the peer is connected to the Ditto Cloud (big peer).toString()
-
Method Details
-
getAddress
Returns the unique network identifier of the peer.- Returns:
- the
DittoAddressof this peer.
-
getConnections
Returns the connections that are currently active with the current peer.- Returns:
- a list of
DittoConnectioninstances representing active connections.
-
getDeviceName
Returns the human-readable device name of the peer. This defaults to the hostname but can be manually set by the application developer of the other peer. It is not necessarily unique.- Returns:
- the device name string.
-
getDittoSdkVersion
Returns the Ditto SDK version the peer is running with.- Returns:
- the SDK version string, or null if unknown.
-
getIdentityServiceMetadata
Returns metadata associated with the peer by the identity service. Use an authentication webhook to set this value. See Ditto's online documentation for more information on how to configure an authentication webhook.- Returns:
- a map of identity service metadata.
-
isCompatible
Indicates whether the peer is compatible with the current peer.- Returns:
- true if compatible, false if incompatible, or null if compatibility is unknown.
-
isConnectedToDittoCloud
public boolean isConnectedToDittoCloud()Indicates whether the peer is connected to the Ditto Cloud (big peer).- Returns:
- true if connected to Ditto Cloud, false otherwise.
-
getOs
Returns the operating system of the peer, if known. This detail is learned gradually and may not be known immediately.- Returns:
- the OS string, or null if unknown.
-
getPeerKey
Returns the peer key, a unique identifier for this peer. The peer key is equal to or derived from the cryptographic public key used to authenticate it.- Returns:
- the peer key string.
- Implementation Note:
- This will be empty when a peer is not updated to the latest version of the SDK.
-
getPeerMetadata
Returns metadata associated with the peer, empty dictionary by default. UseDittoPresence.setPeerMetadata(DittoJsonSerializable.ObjectValue)orDittoPresence.setPeerMetadataJsonString(String)to set this value. Peer metadata is dynamic and may change over the lifecycle of theDittoPresenceGraph. It may be empty when a remote peer initially appears in the presence graph and will be updated once the peer has synced its metadata with the local peer.- Returns:
- a
DittoJsonSerializable.ObjectValuecontaining the peer metadata. - See Also:
-
hashCode
-
equals
-
toString
-