Package io.ably.lib.liveobjects.message
Interface ObjectMessage
public interface ObjectMessage
The user-facing representation of an inbound object message that carried an operation.
It is delivered to subscription listeners (see
PathObjectSubscriptionEvent and
InstanceSubscriptionEvent) so that user code can
inspect the metadata of the message that triggered an object change.
An ObjectMessage always carries an operation; object
messages without an operation (e.g. sync state messages) are never surfaced to users.
This type is the entry point of the io.ably.lib.object.message package;
all sibling types are reached by walking its properties:
ObjectMessage
└── getOperation() → ObjectOperation
├── getAction() → ObjectOperationAction (enum)
├── getMapCreate() → MapCreate → ObjectsMapSemantics, Map<String, ObjectsMapEntry> → ObjectData
├── getMapSet() → MapSet → ObjectData
├── getMapRemove() → MapRemove
├── getCounterCreate() → CounterCreate
├── getCounterInc() → CounterInc
├── getObjectDelete() → ObjectDelete (empty)
└── getMapClear() → MapClear (empty)
Spec: PAOM1, PAOM2
-
Method Summary
Modifier and TypeMethodDescription@NotNull StringReturns the name of the channel on which the source object message was received.@Nullable StringReturns the client id of the client that published the source object message.@Nullable StringReturns the connection id of the connection from which the source object message was published.@Nullable com.google.gson.JsonObjectReturns the extras of the source object message - a JSON-encodable object containing arbitrary message metadata and/or ancillary payloads.@Nullable StringgetId()Returns the unique id of the source object message.@NotNull ObjectOperationReturns the operation carried by the source object message.@Nullable StringReturns the serial of the source object message - an opaque string that uniquely identifies the operation.@Nullable LongReturns the timestamp derived from theserialof the source object message, as milliseconds since the epoch.@Nullable StringReturns the site code of the source object message - an opaque string used as a key to update the map of serial values on an object.@Nullable LongReturns the timestamp of the source object message, as milliseconds since the epoch.
-
Method Details
-
getId
Returns the unique id of the source object message.Spec: PAOM2a / OM2a
- Returns:
- the message id, or
nullif unavailable
-
getClientId
Returns the client id of the client that published the source object message.Spec: PAOM2b / OM2b
- Returns:
- the client id, or
nullif unavailable
-
getConnectionId
Returns the connection id of the connection from which the source object message was published.Spec: PAOM2c / OM2c
- Returns:
- the connection id, or
nullif unavailable
-
getTimestamp
Returns the timestamp of the source object message, as milliseconds since the epoch.Spec: PAOM2d / OM2e
- Returns:
- the timestamp in milliseconds since the epoch, or
nullif unavailable
-
getChannel
Returns the name of the channel on which the source object message was received.Spec: PAOM2e
- Returns:
- the channel name
-
getOperation
Returns the operation carried by the source object message.Spec: PAOM2f
- Returns:
- the operation that was applied
-
getSerial
Returns the serial of the source object message - an opaque string that uniquely identifies the operation.Spec: PAOM2g / OM2h
- Returns:
- the serial, or
nullif unavailable
-
getSerialTimestamp
Returns the timestamp derived from theserialof the source object message, as milliseconds since the epoch.Spec: PAOM2h / OM2j
- Returns:
- the serial timestamp in milliseconds since the epoch, or
nullif unavailable
-
getSiteCode
Returns the site code of the source object message - an opaque string used as a key to update the map of serial values on an object.Spec: PAOM2i / OM2i
- Returns:
- the site code, or
nullif unavailable
-
getExtras
@Nullable @Nullable com.google.gson.JsonObject getExtras()Returns the extras of the source object message - a JSON-encodable object containing arbitrary message metadata and/or ancillary payloads. The client library treats this field opaquely.Spec: PAOM2j / OM2d
- Returns:
- the extras, or
nullif unavailable
-