Class DittoConnectionRequest

java.lang.Object
com.ditto.java.DittoConnectionRequest

public final class DittoConnectionRequest extends Object
Contains information about a remote peer that has requested a connection.
  • Method Details

    • getPeerKeyString

      public @NonNull String getPeerKeyString()
      The unique peer key of the remote peer.
      See Also:
    • getPeerMetadata

      public @NonNull Map<@NonNull String,@Nullable ?> getPeerMetadata()

      Returns metadata associated with the remote peer.

      Returns an empty dictionary if the remote peer has not set any metadata.

      Set peer metadata for the local peer using DittoPresence.setPeerMetadata(DittoJsonSerializable.ObjectValue) or DittoPresence.setPeerMetadataJsonString(String).

      This is a convenience method that wraps getPeerMetadataJson().

      Returns:
      an unmodifiable map of peer metadata.
    • getPeerMetadataJson

      public @NonNull String getPeerMetadataJson()

      Returns a JSON string of metadata associated with the remote peer.

      Returns a JSON string representing an empty dictionary if the remote peer has not set any metadata.

      Set peer metadata for the local peer using DittoPresence.setPeerMetadata(DittoJsonSerializable.ObjectValue) or DittoPresence.setPeerMetadataJsonString(String).

      Returns:
      the peer metadata as a JSON string.
    • getIdentityServiceMetadata

      public @NonNull Map<@NonNull String,@Nullable ?> getIdentityServiceMetadata()

      Returns metadata for the remote peer provided 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.

      This is a convenience method that wraps getIdentityServiceMetadataJson().

      Returns:
      an unmodifiable map of identity service metadata.
    • getIdentityServiceMetadataJson

      public @NonNull String getIdentityServiceMetadataJson()

      Returns a JSON string of metadata for the remote peer provided 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:
      the identity service metadata as a JSON string.
    • getConnectionType

      public @NonNull DittoConnectionType getConnectionType()

      Returns the connection type used to establish this particular connection.

      Use this to allow or deny only specific types of connections.

      Returns:
      the DittoConnectionType for this connection.
    • hashCode

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

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