1919import io .ably .lib .types .PresenceSerializer ;
2020import io .ably .lib .types .UpdateDeleteResult ;
2121import io .ably .lib .util .Crypto ;
22+ import org .jetbrains .annotations .Blocking ;
23+ import org .jetbrains .annotations .NonBlocking ;
2224
2325/**
2426 * A class representing a Channel in the Ably REST API.
@@ -327,6 +329,7 @@ private BasePaginatedQuery.ResultRequest<PresenceMessage> historyImpl(Http http,
327329 * @return A {@link Message} object representing the latest version of the message.
328330 * @throws AblyException If the message cannot be retrieved or does not exist.
329331 */
332+ @ Blocking
330333 public Message getMessage (String serial ) throws AblyException {
331334 return messageEditsMixin .getMessage (ably .http , serial );
332335 }
@@ -339,6 +342,7 @@ public Message getMessage(String serial) throws AblyException {
339342 * <p>
340343 * This callback is invoked on a background thread.
341344 */
345+ @ NonBlocking
342346 public void getMessageAsync (String serial , Callback <Message > callback ) {
343347 messageEditsMixin .getMessageAsync (ably .http , serial , callback );
344348 }
@@ -355,6 +359,7 @@ public void getMessageAsync(String serial, Callback<Message> callback) {
355359 * @throws AblyException If the update operation fails.
356360 * @return A {@link UpdateDeleteResult} containing the updated message version serial.
357361 */
362+ @ Blocking
358363 public UpdateDeleteResult updateMessage (Message message , MessageOperation operation ) throws AblyException {
359364 return messageEditsMixin .updateMessage (ably .http , message , operation );
360365 }
@@ -370,6 +375,7 @@ public UpdateDeleteResult updateMessage(Message message, MessageOperation operat
370375 * @throws AblyException If the update operation fails.
371376 * @return A {@link UpdateDeleteResult} containing the updated message version serial.
372377 */
378+ @ Blocking
373379 public UpdateDeleteResult updateMessage (Message message ) throws AblyException {
374380 return updateMessage (message , null );
375381 }
@@ -383,6 +389,7 @@ public UpdateDeleteResult updateMessage(Message message) throws AblyException {
383389 * <p>
384390 * This callback is invoked on a background thread.
385391 */
392+ @ NonBlocking
386393 public void updateMessageAsync (Message message , MessageOperation operation , Callback <UpdateDeleteResult > callback ) {
387394 messageEditsMixin .updateMessageAsync (ably .http , message , operation , callback );
388395 }
@@ -395,6 +402,7 @@ public void updateMessageAsync(Message message, MessageOperation operation, Call
395402 * <p>
396403 * This callback is invoked on a background thread.
397404 */
405+ @ NonBlocking
398406 public void updateMessageAsync (Message message , Callback <UpdateDeleteResult > callback ) {
399407 updateMessageAsync (message , null , callback );
400408 }
@@ -411,6 +419,7 @@ public void updateMessageAsync(Message message, Callback<UpdateDeleteResult> cal
411419 * @throws AblyException If the delete operation fails.
412420 * @return A {@link UpdateDeleteResult} containing the deleted message version serial.
413421 */
422+ @ Blocking
414423 public UpdateDeleteResult deleteMessage (Message message , MessageOperation operation ) throws AblyException {
415424 return messageEditsMixin .deleteMessage (ably .http , message , operation );
416425 }
@@ -426,6 +435,7 @@ public UpdateDeleteResult deleteMessage(Message message, MessageOperation operat
426435 * @throws AblyException If the delete operation fails.
427436 * @return A {@link UpdateDeleteResult} containing the deleted message version serial.
428437 */
438+ @ Blocking
429439 public UpdateDeleteResult deleteMessage (Message message ) throws AblyException {
430440 return deleteMessage (message , null );
431441 }
@@ -439,6 +449,7 @@ public UpdateDeleteResult deleteMessage(Message message) throws AblyException {
439449 * <p>
440450 * This callback is invoked on a background thread.
441451 */
452+ @ NonBlocking
442453 public void deleteMessageAsync (Message message , MessageOperation operation , Callback <UpdateDeleteResult > callback ) {
443454 messageEditsMixin .deleteMessageAsync (ably .http , message , operation , callback );
444455 }
@@ -451,6 +462,7 @@ public void deleteMessageAsync(Message message, MessageOperation operation, Call
451462 * <p>
452463 * This callback is invoked on a background thread.
453464 */
465+ @ NonBlocking
454466 public void deleteMessageAsync (Message message , Callback <UpdateDeleteResult > callback ) {
455467 deleteMessageAsync (message , null , callback );
456468 }
@@ -463,6 +475,7 @@ public void deleteMessageAsync(Message message, Callback<UpdateDeleteResult> cal
463475 * @return A {@link UpdateDeleteResult} containing the updated message version serial.
464476 * @throws AblyException If the append operation fails.
465477 */
478+ @ Blocking
466479 public UpdateDeleteResult appendMessage (Message message , MessageOperation operation ) throws AblyException {
467480 return messageEditsMixin .appendMessage (ably .http , message , operation );
468481 }
@@ -474,6 +487,7 @@ public UpdateDeleteResult appendMessage(Message message, MessageOperation operat
474487 * @return A {@link UpdateDeleteResult} containing the updated message version serial.
475488 * @throws AblyException If the append operation fails.
476489 */
490+ @ Blocking
477491 public UpdateDeleteResult appendMessage (Message message ) throws AblyException {
478492 return appendMessage (message , null );
479493 }
@@ -487,6 +501,7 @@ public UpdateDeleteResult appendMessage(Message message) throws AblyException {
487501 * <p>
488502 * This callback is invoked on a background thread.
489503 */
504+ @ NonBlocking
490505 public void appendMessageAsync (Message message , MessageOperation operation , Callback <UpdateDeleteResult > callback ) {
491506 messageEditsMixin .appendMessageAsync (ably .http , message , operation , callback );
492507 }
@@ -499,6 +514,7 @@ public void appendMessageAsync(Message message, MessageOperation operation, Call
499514 * <p>
500515 * This callback is invoked on a background thread.
501516 */
517+ @ NonBlocking
502518 public void appendMessageAsync (Message message , Callback <UpdateDeleteResult > callback ) {
503519 appendMessageAsync (message , null , callback );
504520 }
@@ -516,6 +532,7 @@ public void appendMessageAsync(Message message, Callback<UpdateDeleteResult> cal
516532 * representing all versions of the message.
517533 * @throws AblyException If the versions cannot be retrieved.
518534 */
535+ @ Blocking
519536 public PaginatedResult <Message > getMessageVersions (String serial , Param [] params ) throws AblyException {
520537 return messageEditsMixin .getMessageVersions (ably .http , serial , params );
521538 }
@@ -527,6 +544,7 @@ public PaginatedResult<Message> getMessageVersions(String serial, Param[] params
527544 * @param params Query parameters for filtering or pagination.
528545 * @param callback A callback to handle the result asynchronously.
529546 */
547+ @ NonBlocking
530548 public void getMessageVersionsAsync (String serial , Param [] params , Callback <AsyncPaginatedResult <Message >> callback ) throws AblyException {
531549 messageEditsMixin .getMessageVersionsAsync (ably .http , serial , params , callback );
532550 }
0 commit comments