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 Type
    Method
    Description
    @NotNull String
    Returns the name of the channel on which the source object message was received.
    @Nullable String
    Returns the client id of the client that published the source object message.
    @Nullable String
    Returns the connection id of the connection from which the source object message was published.
    @Nullable com.google.gson.JsonObject
    Returns the extras of the source object message - a JSON-encodable object containing arbitrary message metadata and/or ancillary payloads.
    @Nullable String
    Returns the unique id of the source object message.
    Returns the operation carried by the source object message.
    @Nullable String
    Returns the serial of the source object message - an opaque string that uniquely identifies the operation.
    @Nullable Long
    Returns the timestamp derived from the serial of the source object message, as milliseconds since the epoch.
    @Nullable String
    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.
    @Nullable Long
    Returns the timestamp of the source object message, as milliseconds since the epoch.
  • Method Details

    • getId

      @Nullable @Nullable String getId()
      Returns the unique id of the source object message.

      Spec: PAOM2a / OM2a

      Returns:
      the message id, or null if unavailable
    • getClientId

      @Nullable @Nullable String getClientId()
      Returns the client id of the client that published the source object message.

      Spec: PAOM2b / OM2b

      Returns:
      the client id, or null if unavailable
    • getConnectionId

      @Nullable @Nullable String getConnectionId()
      Returns the connection id of the connection from which the source object message was published.

      Spec: PAOM2c / OM2c

      Returns:
      the connection id, or null if unavailable
    • getTimestamp

      @Nullable @Nullable Long 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 null if unavailable
    • getChannel

      @NotNull @NotNull String getChannel()
      Returns the name of the channel on which the source object message was received.

      Spec: PAOM2e

      Returns:
      the channel name
    • getOperation

      @NotNull @NotNull ObjectOperation getOperation()
      Returns the operation carried by the source object message.

      Spec: PAOM2f

      Returns:
      the operation that was applied
    • getSerial

      @Nullable @Nullable String getSerial()
      Returns the serial of the source object message - an opaque string that uniquely identifies the operation.

      Spec: PAOM2g / OM2h

      Returns:
      the serial, or null if unavailable
    • getSerialTimestamp

      @Nullable @Nullable Long getSerialTimestamp()
      Returns the timestamp derived from the serial of the source object message, as milliseconds since the epoch.

      Spec: PAOM2h / OM2j

      Returns:
      the serial timestamp in milliseconds since the epoch, or null if unavailable
    • getSiteCode

      @Nullable @Nullable String 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 null if 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 null if unavailable