@@ -387,25 +387,107 @@ interface MessageConsumer extends AutoCloseable {
387
387
388
388
MessageConsumer pullAsync (String subscription , MessageProcessor callback , PullOption ... options );
389
389
390
+ /**
391
+ * Acknowledges the given messages for the provided subscription. Ack ids identify the messages to
392
+ * acknowledge, as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and
393
+ * {@link #pullAsync(String, int)}.
394
+ *
395
+ * @param subscription the subscription whose messages must be acknowledged
396
+ * @param ackId the ack id of the first message to acknowledge
397
+ * @param ackIds other ack ids of messages to acknowledge
398
+ * @throws PubSubException upon failure, or if the subscription was not found
399
+ */
390
400
void ack (String subscription , String ackId , String ... ackIds );
391
401
402
+ /**
403
+ * Sends a request to acknowledge the given messages for the provided subscription. Ack ids
404
+ * identify the messages to acknowledge, as returned in {@link ReceivedMessage#ackId()} by
405
+ * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. The method returns a
406
+ * {@code Future} object that can be used to wait for the acknowledge operation to be completed.
407
+ *
408
+ * @param subscription the subscription whose messages must be acknowledged
409
+ * @param ackId the ack id of the first message to acknowledge
410
+ * @param ackIds other ack ids of messages to acknowledge
411
+ */
392
412
Future <Void > ackAsync (String subscription , String ackId , String ... ackIds );
393
413
414
+ /**
415
+ * Acknowledges the given messages for the provided subscription. Ack ids identify the messages to
416
+ * acknowledge, as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and
417
+ * {@link #pullAsync(String, int)}.
418
+ *
419
+ * @param subscription the subscription whose messages must be acknowledged
420
+ * @param ackIds the ack ids of messages to acknowledge
421
+ * @throws PubSubException upon failure, or if the subscription was not found
422
+ */
394
423
void ack (String subscription , Iterable <String > ackIds );
395
424
425
+ /**
426
+ * Sends a request to acknowledge the given messages for the provided subscription. Ack ids
427
+ * identify the messages to acknowledge, as returned in {@link ReceivedMessage#ackId()} by
428
+ * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. The method returns a
429
+ * {@code Future} object that can be used to wait for the acknowledge operation to be completed.
430
+ *
431
+ * @param subscription the subscription whose messages must be acknowledged
432
+ * @param ackIds the ack ids of messages to acknowledge
433
+ */
396
434
Future <Void > ackAsync (String subscription , Iterable <String > ackIds );
397
435
436
+ /**
437
+ * "Nacks" the given messages for the provided subscription. Ack ids identify the messages to
438
+ * "nack", as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and
439
+ * {@link #pullAsync(String, int)}. This method corresponds to calling
440
+ * {@link #modifyAckDeadline(String, int, TimeUnit, String, String...)} with a deadline of 0.
441
+ *
442
+ * @param subscription the subscription whose messages must be "nacked"
443
+ * @param ackId the ack id of the first message to "nack"
444
+ * @param ackIds other ack ids of messages to "nack"
445
+ * @throws PubSubException upon failure, or if the subscription was not found
446
+ */
398
447
void nack (String subscription , String ackId , String ... ackIds );
399
448
449
+ /**
450
+ * Sends a request to "nack" the given messages for the provided subscription. Ack ids identify
451
+ * the messages to "nack", as returned in {@link ReceivedMessage#ackId()} by
452
+ * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. This method corresponds to
453
+ * calling {@link #modifyAckDeadlineAsync(String, int, TimeUnit, String, String...)} with a
454
+ * deadline of 0. The method returns a {@code Future} object that can be used to wait for the
455
+ * "nack" operation to be completed.
456
+ *
457
+ * @param subscription the subscription whose messages must be "nacked"
458
+ * @param ackId the ack id of the first message to "nack"
459
+ * @param ackIds other ack ids of messages to "nack"
460
+ */
400
461
Future <Void > nackAsync (String subscription , String ackId , String ... ackIds );
401
462
463
+ /**
464
+ * "Nacks" the given messages for the provided subscription. Ack ids identify the messages to
465
+ * "nack", as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and
466
+ * {@link #pullAsync(String, int)}. This method corresponds to calling
467
+ * {@link #modifyAckDeadline(String, int, TimeUnit, Iterable)} with a deadline of 0.
468
+ *
469
+ * @param subscription the subscription whose messages must be "nacked"
470
+ * @param ackIds the ack ids of messages to "nack"
471
+ * @throws PubSubException upon failure, or if the subscription was not found
472
+ */
402
473
void nack (String subscription , Iterable <String > ackIds );
403
474
475
+ /**
476
+ * Sends a request to "nack" the given messages for the provided subscription. Ack ids identify
477
+ * the messages to "nack", as returned in {@link ReceivedMessage#ackId()} by
478
+ * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. This method corresponds to
479
+ * calling {@link #modifyAckDeadlineAsync(String, int, TimeUnit, Iterable)} with a deadline of 0.
480
+ * The method returns a {@code Future} object that can be used to wait for the "nack" operation to
481
+ * be completed.
482
+ *
483
+ * @param subscription the subscription whose messages must be "nacked"
484
+ * @param ackIds the ack ids of messages to "nack"
485
+ */
404
486
Future <Void > nackAsync (String subscription , Iterable <String > ackIds );
405
487
406
488
/**
407
- * Modifies the acknowledge deadline of the given messages. {@code deadline} must be > = 0 and is
408
- * the new deadline with respect to the time the modify request was received by the Pub/Sub
489
+ * Modifies the acknowledge deadline of the given messages. {@code deadline} must be > = 0 and
490
+ * is the new deadline with respect to the time the modify request was received by the Pub/Sub
409
491
* service. For example, if {@code deadline} is 10 and {@code unit} is {@link TimeUnit#SECONDS},
410
492
* the new ack deadline will expire 10 seconds after the modify request was received by the
411
493
* service. Specifying 0 may be used to make the message available for another pull request
@@ -425,8 +507,8 @@ void modifyAckDeadline(String subscription, int deadline, TimeUnit unit, String
425
507
426
508
/**
427
509
* Sends a request to modify the acknowledge deadline of the given messages. {@code deadline}
428
- * must be > = 0 and is the new deadline with respect to the time the modify request was received
429
- * by the Pub/Sub service. For example, if {@code deadline} is 10 and {@code unit} is
510
+ * must be > = 0 and is the new deadline with respect to the time the modify request was
511
+ * received by the Pub/Sub service. For example, if {@code deadline} is 10 and {@code unit} is
430
512
* {@link TimeUnit#SECONDS}, the new ack deadline will expire 10 seconds after the modify request
431
513
* was received by the service. Specifying 0 may be used to make the message available for another
432
514
* pull request (corresponds to calling {@link #nackAsync(String, Iterable)}). The method returns
@@ -444,8 +526,8 @@ Future<Void> modifyAckDeadlineAsync(String subscription, int deadline, TimeUnit
444
526
String ackId , String ... ackIds );
445
527
446
528
/**
447
- * Modifies the acknowledge deadline of the given messages. {@code deadline} must be > = 0 and is
448
- * the new deadline with respect to the time the modify request was received by the Pub/Sub
529
+ * Modifies the acknowledge deadline of the given messages. {@code deadline} must be > = 0 and
530
+ * is the new deadline with respect to the time the modify request was received by the Pub/Sub
449
531
* service. For example, if {@code deadline} is 10 and {@code unit} is {@link TimeUnit#SECONDS},
450
532
* the new ack deadline will expire 10 seconds after the modify request was received by the
451
533
* service. Specifying 0 may be used to make the message available for another pull request
@@ -462,8 +544,8 @@ Future<Void> modifyAckDeadlineAsync(String subscription, int deadline, TimeUnit
462
544
463
545
/**
464
546
* Sends a request to modify the acknowledge deadline of the given messages. {@code deadline}
465
- * must be > = 0 and is the new deadline with respect to the time the modify request was received
466
- * by the Pub/Sub service. For example, if {@code deadline} is 10 and {@code unit} is
547
+ * must be > = 0 and is the new deadline with respect to the time the modify request was
548
+ * received by the Pub/Sub service. For example, if {@code deadline} is 10 and {@code unit} is
467
549
* {@link TimeUnit#SECONDS}, the new ack deadline will expire 10 seconds after the modify request
468
550
* was received by the service. Specifying 0 may be used to make the message available for another
469
551
* pull request (corresponds to calling {@link #nackAsync(String, Iterable)}). The method returns
0 commit comments