Class MessageEditsMixin
-
Constructor Summary
ConstructorsConstructorDescriptionMessageEditsMixin(String basePath, ClientOptions clientOptions, ChannelOptions channelOptions, Auth auth) -
Method Summary
Modifier and TypeMethodDescriptionappendMessage(Http http, Message message, MessageOperation operation) Appends message text to the end of the message.voidappendMessageAsync(Http http, Message message, MessageOperation operation, Callback<UpdateDeleteResult> callback) Asynchronously appends message text to the end of the message.deleteMessage(Http http, Message message, MessageOperation operation) Marks a message as deleted.voiddeleteMessageAsync(Http http, Message message, MessageOperation operation, Callback<UpdateDeleteResult> callback) Asynchronously marks a message as deleted.getMessage(Http http, String serial) Retrieves the latest version of a specific message by its serial identifier.voidgetMessageAsync(Http http, String serial, Callback<Message> callback) Asynchronously retrieves the latest version of a specific message by its serial identifier.getMessageVersions(Http http, String serial, Param[] params) Retrieves all historical versions of a specific message.voidgetMessageVersionsAsync(Http http, String serial, Param[] params, Callback<AsyncPaginatedResult<Message>> callback) Asynchronously retrieves all historical versions of a specific message.updateMessage(Http http, Message message, MessageOperation operation) Updates an existing message using patch semantics.voidupdateMessageAsync(Http http, Message message, MessageOperation operation, Callback<UpdateDeleteResult> callback) Asynchronously updates an existing message.
-
Constructor Details
-
MessageEditsMixin
public MessageEditsMixin(String basePath, ClientOptions clientOptions, ChannelOptions channelOptions, Auth auth)
-
-
Method Details
-
getMessage
Retrieves the latest version of a specific message by its serial identifier.This method allows you to fetch the current state of a message, including any updates or deletions that have been applied since its creation.
- Parameters:
-
serial- The unique serial identifier of the message to retrieve. - Returns:
- A
Messageobject representing the latest version of the message. - Throws:
-
AblyException- If the message cannot be retrieved or does not exist.
-
getMessageAsync
Asynchronously retrieves the latest version of a specific message by its serial identifier.- Parameters:
-
serial- The unique serial identifier of the message to retrieve. -
callback- A callback to handle the result asynchronously.This callback is invoked on a background thread.
-
updateMessage
@Blocking public UpdateDeleteResult updateMessage(Http http, Message message, MessageOperation operation) throws AblyException Updates an existing message using patch semantics.Non-null fields in the provided message (name, data, extras) will replace the corresponding fields in the existing message, while null fields will be left unchanged.
- Parameters:
-
message- AMessageobject containing the fields to update and the serial identifier. Only non-null fields will be applied to the existing message. - Returns:
- A
UpdateDeleteResultcontaining the updated message version serial. - Throws:
-
AblyException- If the update operation fails.
-
updateMessageAsync
@NonBlocking public void updateMessageAsync(Http http, Message message, MessageOperation operation, Callback<UpdateDeleteResult> callback) Asynchronously updates an existing message.- Parameters:
-
message- AMessageobject containing the fields to update and the serial identifier. -
callback- A listener to be notified of the outcome of this operation.This listener is invoked on a background thread.
-
deleteMessage
@Blocking public UpdateDeleteResult deleteMessage(Http http, Message message, MessageOperation operation) throws AblyException Marks a message as deleted.This operation does not remove the message from history; it marks it as deleted while preserving the full message history. The deleted message can still be retrieved and will have its action set to MESSAGE_DELETE.
- Parameters:
-
message- AMessagemessage containing the serial identifier. - Returns:
- A
UpdateDeleteResultcontaining the deleted message version serial. - Throws:
-
AblyException- If the delete operation fails.
-
deleteMessageAsync
@NonBlocking public void deleteMessageAsync(Http http, Message message, MessageOperation operation, Callback<UpdateDeleteResult> callback) Asynchronously marks a message as deleted.- Parameters:
-
message- AMessageobject containing the serial identifier and operation metadata. -
callback- A listener to be notified of the outcome of this operation.This listener is invoked on a background thread.
-
appendMessage
@Blocking public UpdateDeleteResult appendMessage(Http http, Message message, MessageOperation operation) throws AblyException Appends message text to the end of the message.- Parameters:
-
message- AMessageobject containing the serial identifier and data to append. -
operation- operation details such as clientId, description, or metadata - Returns:
- A
UpdateDeleteResultcontaining the updated message version serial. - Throws:
AblyException
-
appendMessageAsync
@NonBlocking public void appendMessageAsync(Http http, Message message, MessageOperation operation, Callback<UpdateDeleteResult> callback) Asynchronously appends message text to the end of the message.- Parameters:
-
message- AMessageobject containing the serial identifier and data to append. -
operation- operation details such as clientId, description, or metadata -
callback- A listener to be notified of the outcome of this operation.This listener is invoked on a background thread.
-
getMessageVersions
@Blocking public PaginatedResult<Message> getMessageVersions(Http http, String serial, Param[] params) throws AblyException Retrieves all historical versions of a specific message.This method returns a paginated result containing all versions of the message, ordered chronologically. Each version includes metadata about when and by whom the message was modified.
- Parameters:
-
serial- The unique serial identifier of the message. -
params- Query parameters for filtering or pagination (e.g., limit, start, end). - Returns:
- A
PaginatedResultcontaining an array ofMessageobjects representing all versions of the message. - Throws:
-
AblyException- If the versions cannot be retrieved.
-
getMessageVersionsAsync
@NonBlocking public void getMessageVersionsAsync(Http http, String serial, Param[] params, Callback<AsyncPaginatedResult<Message>> callback) throws AblyException Asynchronously retrieves all historical versions of a specific message.- Parameters:
-
serial- The unique serial identifier of the message. -
params- Query parameters for filtering or pagination. -
callback- A callback to handle the result asynchronously. - Throws:
AblyException
-