public class PresenceMessage extends BaseMessage implements java.lang.Cloneable
| Modifier and Type | Class and Description |
|---|---|
static class |
PresenceMessage.Action
Describes the possible actions members in the presence set can emit.
|
static class |
PresenceMessage.ActionSerializer |
static class |
PresenceMessage.Serializer |
| Modifier and Type | Field and Description |
|---|---|
PresenceMessage.Action |
action
The type of
PresenceMessage.Action the PresenceMessage is for. |
clientId, connectionId, data, encoding, id, timestamp| Constructor and Description |
|---|
PresenceMessage()
Default constructor
|
PresenceMessage(PresenceMessage.Action action,
java.lang.String clientId)
Construct a PresenceMessage from an Action and clientId
|
PresenceMessage(PresenceMessage.Action action,
java.lang.String clientId,
java.lang.Object data)
Generic constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
static PresenceMessage |
fromEncoded(com.google.gson.JsonObject messageJsonObject,
ChannelOptions channelOptions)
Decodes and decrypts a deserialized PresenceMessage-like object using the cipher in
ChannelOptions. |
static PresenceMessage |
fromEncoded(java.lang.String messageJson,
ChannelOptions channelOptions)
Decodes and decrypts a deserialized PresenceMessage-like object using the cipher in
ChannelOptions. |
static PresenceMessage[] |
fromEncodedArray(com.google.gson.JsonArray presenceMsgArray,
ChannelOptions channelOptions)
Decodes and decrypts an array of deserialized PresenceMessage-like object using the cipher in
ChannelOptions. |
static PresenceMessage[] |
fromEncodedArray(java.lang.String presenceMsgArray,
ChannelOptions channelOptions)
Decodes and decrypts an array of deserialized PresenceMessage-like object using the cipher in
ChannelOptions. |
java.lang.String |
memberKey()
Combines clientId and connectionId to ensure that multiple connected clients with an identical clientId are uniquely identifiable.
|
java.lang.String |
toString()
Generate a String summary of this PresenceMessage
|
countFields, decode, decode, encode, getDetails, read, readLong, readString, toJsonObjectpublic PresenceMessage.Action action
PresenceMessage.Action the PresenceMessage is for.
Spec: TP3b
public PresenceMessage()
public PresenceMessage(PresenceMessage.Action action, java.lang.String clientId)
action - clientId - public PresenceMessage(PresenceMessage.Action action, java.lang.String clientId, java.lang.Object data)
action - clientId - data - public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic static PresenceMessage fromEncoded(com.google.gson.JsonObject messageJsonObject, ChannelOptions channelOptions) throws MessageDecodeException
ChannelOptions.
Any residual transforms that cannot be decoded or decrypted will be in the encoding property.
Intended for users receiving messages from a source other than a REST or Realtime channel (for example a queue)
to avoid having to parse the encoding string.
Spec: TP4
messageJsonObject - The deserialized PresenceMessage-like object to decode and decrypt.channelOptions - A ChannelOptions object containing the cipher.MessageDecodeExceptionpublic static PresenceMessage fromEncoded(java.lang.String messageJson, ChannelOptions channelOptions) throws MessageDecodeException
ChannelOptions.
Any residual transforms that cannot be decoded or decrypted will be in the encoding property.
Intended for users receiving messages from a source other than a REST or Realtime channel (for example a queue)
to avoid having to parse the encoding string.
Spec: TP4
messageJson - The deserialized PresenceMessage-like object to decode and decrypt.channelOptions - A ChannelOptions object containing the cipher.MessageDecodeExceptionpublic static PresenceMessage[] fromEncodedArray(com.google.gson.JsonArray presenceMsgArray, ChannelOptions channelOptions) throws MessageDecodeException
ChannelOptions.
Any residual transforms that cannot be decoded or decrypted will be in the encoding property.
Intended for users receiving messages from a source other than a REST or Realtime channel (for example a queue)
to avoid having to parse the encoding string.
Spec: TP4
presenceMsgArray - An array of deserialized PresenceMessage-like objects to decode and decrypt.channelOptions - A ChannelOptions object containing the cipher.MessageDecodeExceptionpublic static PresenceMessage[] fromEncodedArray(java.lang.String presenceMsgArray, ChannelOptions channelOptions) throws MessageDecodeException
ChannelOptions.
Any residual transforms that cannot be decoded or decrypted will be in the encoding property.
Intended for users receiving messages from a source other than a REST or Realtime channel (for example a queue)
to avoid having to parse the encoding string.
Spec: TP4
presenceMsgArray - An array of deserialized PresenceMessage-like objects to decode and decrypt.channelOptions - A ChannelOptions object containing the cipher.MessageDecodeExceptionpublic java.lang.String memberKey()
Spec: TP3h