Package io.ably.lib.types
Class PresenceMessage
- java.lang.Object
-
- io.ably.lib.types.BaseMessage
-
- io.ably.lib.types.PresenceMessage
-
- All Implemented Interfaces:
java.lang.Cloneable
public class PresenceMessage extends BaseMessage implements java.lang.Cloneable
A class representing an individual presence update to be sent or received via the Ably Realtime service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPresenceMessage.ActionPresence Action: the event signified by a PresenceMessagestatic classPresenceMessage.ActionSerializerstatic classPresenceMessage.Serializer
-
Field Summary
Fields Modifier and Type Field Description PresenceMessage.Actionaction-
Fields inherited from class io.ably.lib.types.BaseMessage
clientId, connectionId, data, encoding, id, timestamp
-
-
Constructor Summary
Constructors Constructor Description PresenceMessage()Default constructorPresenceMessage(PresenceMessage.Action action, java.lang.String clientId)Construct a PresenceMessage from an Action and clientIdPresenceMessage(PresenceMessage.Action action, java.lang.String clientId, java.lang.Object data)Generic constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()static PresenceMessagefromEncoded(com.google.gson.JsonObject messageJsonObject, ChannelOptions channelOptions)Refer Spec TP4
An alternative constructor that take an PresenceMessage-JSON object and a channelOptions (optional), and return a PresenceMessagestatic PresenceMessagefromEncoded(java.lang.String messageJson, ChannelOptions channelOptions)Refer Spec TP4
An alternative constructor that takes a Stringified PresenceMessage-JSON and a channelOptions (optional), and return a PresenceMessagestatic PresenceMessage[]fromEncodedArray(com.google.gson.JsonArray presenceMsgArray, ChannelOptions channelOptions)Refer Spec TP4
An alternative constructor that takes a PresenceMessage JsonArray and a channelOptions (optional), and return array of PresenceMessages.static PresenceMessage[]fromEncodedArray(java.lang.String presenceMsgArray, ChannelOptions channelOptions)Refer Spec TP4
An alternative constructor that takes a Stringified PresenceMessages Array and a channelOptions (optional), and return array of PresenceMessages.java.lang.StringmemberKey()Get the member key for the PresenceMessage.java.lang.StringtoString()Generate a String summary of this PresenceMessage-
Methods inherited from class io.ably.lib.types.BaseMessage
countFields, decode, encode, getDetails
-
-
-
-
Field Detail
-
action
public PresenceMessage.Action action
-
-
Constructor Detail
-
PresenceMessage
public PresenceMessage()
Default constructor
-
PresenceMessage
public PresenceMessage(PresenceMessage.Action action, java.lang.String clientId)
Construct a PresenceMessage from an Action and clientId- Parameters:
action-clientId-
-
PresenceMessage
public PresenceMessage(PresenceMessage.Action action, java.lang.String clientId, java.lang.Object data)
Generic constructor- Parameters:
action-clientId-data-
-
-
Method Detail
-
toString
public java.lang.String toString()
Generate a String summary of this PresenceMessage- Overrides:
toStringin classjava.lang.Object- Returns:
- string
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
fromEncoded
public static PresenceMessage fromEncoded(com.google.gson.JsonObject messageJsonObject, ChannelOptions channelOptions) throws MessageDecodeException
Refer Spec TP4
An alternative constructor that take an PresenceMessage-JSON object and a channelOptions (optional), and return a PresenceMessage- Parameters:
messageJsonObject-channelOptions-- Returns:
- Throws:
MessageDecodeException
-
fromEncoded
public static PresenceMessage fromEncoded(java.lang.String messageJson, ChannelOptions channelOptions) throws MessageDecodeException
Refer Spec TP4
An alternative constructor that takes a Stringified PresenceMessage-JSON and a channelOptions (optional), and return a PresenceMessage- Parameters:
messageJson-channelOptions-- Returns:
- Throws:
MessageDecodeException
-
fromEncodedArray
public static PresenceMessage[] fromEncodedArray(com.google.gson.JsonArray presenceMsgArray, ChannelOptions channelOptions) throws MessageDecodeException
Refer Spec TP4
An alternative constructor that takes a PresenceMessage JsonArray and a channelOptions (optional), and return array of PresenceMessages.- Parameters:
presenceMsgArray-channelOptions-- Returns:
- Throws:
MessageDecodeException
-
fromEncodedArray
public static PresenceMessage[] fromEncodedArray(java.lang.String presenceMsgArray, ChannelOptions channelOptions) throws MessageDecodeException
Refer Spec TP4
An alternative constructor that takes a Stringified PresenceMessages Array and a channelOptions (optional), and return array of PresenceMessages.- Parameters:
presenceMsgArray-channelOptions-- Returns:
- Throws:
MessageDecodeException
-
memberKey
public java.lang.String memberKey()
Get the member key for the PresenceMessage.- Returns:
-
-