public class Message extends BaseMessage
| Modifier and Type | Class and Description |
|---|---|
static class |
Message.Batch
Sets the channel names and message contents to
AblyBase.publishBatch(io.ably.lib.types.Message.Batch[], io.ably.lib.types.ChannelOptions). |
static class |
Message.Serializer |
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
connectionKey
Key needed only in case one client is publishing this message on behalf of another client.
|
MessageExtras |
extras
A MessageExtras object of arbitrary key-value pairs that may contain metadata, and/or ancillary payloads.
|
java.lang.String |
name
The event name.
|
clientId, connectionId, data, encoding, id, timestamp| Constructor and Description |
|---|
Message()
Default constructor
|
Message(java.lang.String name,
java.lang.Object data)
Construct a Message object with an event name and payload.
|
Message(java.lang.String name,
java.lang.Object data,
MessageExtras extras)
Construct a Message object with an event name, payload, and a extras.
|
Message(java.lang.String name,
java.lang.Object data,
java.lang.String clientId)
Construct a Message object with an event name, payload, and a unique client ID.
|
Message(java.lang.String name,
java.lang.Object data,
java.lang.String clientId,
MessageExtras extras)
Construct a Message object with an event name, payload, extras, and a unique client ID.
|
| Modifier and Type | Method and Description |
|---|---|
static Message |
fromEncoded(com.google.gson.JsonObject messageJson,
ChannelOptions channelOptions)
A static factory method to create a Message object from a deserialized Message-like object encoded using Ably's wire protocol.
|
static Message |
fromEncoded(java.lang.String messageJson,
ChannelOptions channelOptions)
A static factory method to create a Message object from a deserialized Message-like object encoded using Ably's wire protocol.
|
static Message[] |
fromEncodedArray(com.google.gson.JsonArray messageArray,
ChannelOptions channelOptions)
A static factory method to create an array of Message objects from an array of deserialized
Message-like object encoded using Ably's wire protocol.
|
static Message[] |
fromEncodedArray(java.lang.String messagesArray,
ChannelOptions channelOptions)
A static factory method to create an array of Message objects from an array of deserialized
Message-like object encoded using Ably's wire protocol.
|
protected void |
read(com.google.gson.JsonObject map)
Populate fields from JSON.
|
java.lang.String |
toString()
Generate a String summary of this Message
|
countFields, decode, decode, encode, getDetails, readLong, readString, toJsonObjectpublic java.lang.String name
Spec: TM2g
public MessageExtras extras
DeltaExtras, JsonObject.
Spec: TM2i
public java.lang.String connectionKey
Spec: TM2h
public Message()
public Message(java.lang.String name,
java.lang.Object data)
Spec: TM2
name - The event name.data - The message payload.public Message(java.lang.String name,
java.lang.Object data,
java.lang.String clientId)
Spec: TM2
name - The event name.data - The message payload.clientId - The client ID of the publisher of this message.public Message(java.lang.String name,
java.lang.Object data,
MessageExtras extras)
Spec: TM2
name - The event name.data - The message payload.extras - Extra information to be sent with this message.public Message(java.lang.String name,
java.lang.Object data,
java.lang.String clientId,
MessageExtras extras)
Spec: TM2
name - The event name.data - The message payload.clientId - The client ID of the publisher of this message.extras - Extra information to be sent with this message.public java.lang.String toString()
toString in class java.lang.Objectpublic static Message fromEncoded(com.google.gson.JsonObject messageJson, ChannelOptions channelOptions) throws MessageDecodeException
Spec: TM3
messageJson - A Message-like deserialized object.channelOptions - A ChannelOptions object.
If you have an encrypted channel, use this to allow the library to decrypt the data.MessageDecodeExceptionpublic static Message fromEncoded(java.lang.String messageJson, ChannelOptions channelOptions) throws MessageDecodeException
Spec: TM3
messageJson - A Message-like deserialized object.channelOptions - A ChannelOptions object.
If you have an encrypted channel, use this to allow the library to decrypt the data.MessageDecodeExceptionpublic static Message[] fromEncodedArray(com.google.gson.JsonArray messageArray, ChannelOptions channelOptions) throws MessageDecodeException
Spec: TM3
messageArray - An array of Message-like deserialized objects.channelOptions - A ChannelOptions object.
If you have an encrypted channel, use this to allow the library to decrypt the data.Message objects.MessageDecodeExceptionpublic static Message[] fromEncodedArray(java.lang.String messagesArray, ChannelOptions channelOptions) throws MessageDecodeException
Spec: TM3
messagesArray - An array of Message-like deserialized objects.channelOptions - A ChannelOptions object.
If you have an encrypted channel, use this to allow the library to decrypt the data.Message objects.MessageDecodeExceptionprotected void read(com.google.gson.JsonObject map)
throws MessageDecodeException
BaseMessageread in class BaseMessageMessageDecodeException