@@ -40,13 +40,10 @@ public PublishPacket getPublishPacket() {
4040 }
4141
4242 /**
43- * Acquires manual control over the publish acknowledgement (PUBACK) for this PUBLISH message,
43+ * Acquires manual control over the publish acknowledgement for this PUBLISH message,
4444 * preventing the client from automatically sending an acknowledgement. The returned handle can be
4545 * passed to {@link Mqtt5Client#invokePublishAcknowledgement(Mqtt5PublishAcknowledgementControlHandle)}
46- * at a later time to send the PUBACK to the broker.
47- *
48- * <p>The PUBACK control is eagerly acquired by the native layer as soon as the publish is received,
49- * before this callback is invoked. Calling this method retrieves the pre-acquired control handle.</p>
46+ * at a later time to send the publish acknowledgement to the broker.
5047 *
5148 * <p><b>Important:</b> This method must be called within the
5249 * {@link Mqtt5ClientOptions.PublishEvents#onMessageReceived} callback. Calling it after the
@@ -55,8 +52,8 @@ public PublishPacket getPublishPacket() {
5552 * <p>This method may only be called once per received PUBLISH. Subsequent calls will throw
5653 * an {@link IllegalStateException}.</p>
5754 *
58- * <p>If this method is not called, the client will automatically send a PUBACK for QoS 1
59- * messages when the callback returns.</p>
55+ * <p>If this method is not called, the client will automatically send a publish acknowledgment
56+ * for QoS 1 messages when the callback returns.</p>
6057 *
6158 * @return A {@link Mqtt5PublishAcknowledgementControlHandle} that can be used to manually send the acknowledgement.
6259 * @throws IllegalStateException if called outside the onMessageReceived callback, called more than once,
@@ -85,7 +82,7 @@ public synchronized Mqtt5PublishAcknowledgementControlHandle acquirePublishAckno
8582 *
8683 * @return {@code true} if the user acquired manual control of the PUBACK, {@code false} otherwise.
8784 */
88- boolean wasControlAcquired () {
85+ private boolean wasControlAcquired () {
8986 return controlAcquired ;
9087 }
9188
@@ -97,7 +94,7 @@ boolean wasControlAcquired() {
9794 * <p>Zeroes out {@code controlId} so that any saved reference to this {@code PublishReturn}
9895 * cannot call {@code acquirePublishAcknowledgementControl()} after the callback has returned.</p>
9996 */
100- synchronized void invalidateAfterCallback () {
97+ private synchronized void invalidateAfterCallback () {
10198 controlId = 0 ;
10299 }
103100
0 commit comments