2424 * <p>
2525 * It provides applications a simple programming interface to all features of the MQTT version 3.1
2626 * specification including:
27+ * </p>
2728 * <ul>
2829 * <li>connect
2930 * <li>publish
3031 * <li>subscribe
3132 * <li>unsubscribe
3233 * <li>disconnect
3334 * </ul>
34- * </p>
3535 * <p>
36- * There are two styles of MQTT client, this one and {@link IMqttClient}.
36+ * There are two styles of MQTT client, this one and {@link IMqttClient}.</p>
3737 * <ul>
3838 * <li>IMqttAsyncClient provides a set of non-blocking methods that return control to the
3939 * invoking application after initial validation of parameters and state. The main processing is
5151 * versions of the MQTT client. In most circumstances it is recommended to use IMqttAsyncClient
5252 * based clients which allow an application to mix both non-blocking and blocking calls. </li>
5353 * </ul>
54- * </p>
5554 * <p>
5655 * An application is not restricted to using one style if an IMqttAsyncClient based client is used
5756 * as both blocking and non-blocking methods can be used in the same application. If an IMqttClient
6160 * <p>There are two forms of non-blocking method:
6261 * <ol>
6362 * <li>
64- * <code>< pre>
63+ * <pre>
6564 * IMqttToken token = asyncClient.method(parms)
66- * </pre></code>
65+ * </pre>
6766 * <p>In this form the method returns a token that can be used to track the
6867 * progress of the action (method). The method provides a waitForCompletion()
6968 * method that once invoked will block until the action completes. Once
7069 * completed there are method on the token that can be used to check if the
7170 * action completed successfully or not. For example
72- * to wait until a connect completes:
73- * <code>< pre>
71+ * to wait until a connect completes:</p>
72+ * <pre>
7473 * IMqttToken conToken;
7574 * conToken = asyncClient.client.connect(conToken);
7675 * ... do some work...
7776 * conToken.waitForCompletion();
78- * </pre></code>
79- * </p>
80- * <p>To turn a method into a blocking invocation the following form can be used:
81- * <code><pre>
77+ * </pre>
78+ * <p>To turn a method into a blocking invocation the following form can be used:</p>
79+ * <pre>
8280 * IMqttToken token;
8381 * token = asyncClient.method(parms).waitForCompletion();
84- * </pre></code>
85-
82+ * </pre>
8683 * </li>
8784 *
8885 * <li>
89- * <code>< pre>
86+ * <pre>
9087 * IMqttToken token method(parms, Object userContext, IMqttActionListener callback)
91- * </pre></code>
88+ * </pre>
9289 * <p>In this form a callback is registered with the method. The callback will be
9390 * notified when the action succeeds or fails. The callback is invoked on the thread
9491 * managed by the MQTT client so it is important that processing is minimised in the
9592 * callback. If not the operation of the MQTT client will be inhibited. For example
96- * to be notified (called back) when a connect completes:
97- * <code>< pre>
93+ * to be notified (called back) when a connect completes:</p>
94+ * <pre>
9895 * IMqttToken conToken;
9996 * conToken = asyncClient.connect("some context",new new MqttAsyncActionListener() {
10097 * public void onSuccess(IMqttToken asyncActionToken) {
105102 * log ("connect failed" +exception);
106103 * }
107104 * });
108- * </pre></code>
109- * An optional context object can be passed into the method which will then be made
105+ * </pre>
106+ * <p> An optional context object can be passed into the method which will then be made
110107 * available in the callback. The context is stored by the MQTT client) in the token
111108 * which is then returned to the invoker. The token is provided to the callback methods
112109 * where the context can then be accessed.
@@ -174,11 +171,11 @@ public interface IMqttAsyncClient {
174171 * </p>
175172 * <p>The method returns control before the connect completes. Completion can
176173 * be tracked by:
174+ * </p>
177175 * <ul>
178176 * <li>Waiting on the returned token {@link IMqttToken#waitForCompletion()} or</li>
179177 * <li>Passing in a callback {@link IMqttActionListener}</li>
180178 * </ul>
181- * </p>
182179 *
183180 * @param options a set of connection parameters that override the defaults.
184181 * @param userContext optional object for used to pass context to the callback. Use
@@ -259,11 +256,11 @@ public interface IMqttAsyncClient {
259256 * <p>This method must not be called from inside {@link MqttCallback} methods.</p>
260257 * <p>The method returns control before the disconnect completes. Completion can
261258 * be tracked by:
259+ * </p>
262260 * <ul>
263261 * <li>Waiting on the returned token {@link IMqttToken#waitForCompletion()} or</li>
264262 * <li>Passing in a callback {@link IMqttActionListener}</li>
265263 * </ul>
266- * </p>
267264 *
268265 * @param quiesceTimeout the amount of time in milliseconds to allow for
269266 * existing work to finish before disconnecting. A value of zero or less
@@ -419,6 +416,7 @@ public IMqttDeliveryToken publish(String topic, byte[] payload, int qos,
419416 * client and will be delivered on a background thread.
420417 * In the event the connection fails or the client stops. Messages will be delivered to the
421418 * requested quality of service once the connection is re-established to the server on condition that:
419+ * </p>
422420 * <ul>
423421 * <li>The connection is re-established with the same clientID
424422 * <li>The original connection was made with (@link MqttConnectOptions#setCleanSession(boolean)}
@@ -427,7 +425,6 @@ public IMqttDeliveryToken publish(String topic, byte[] payload, int qos,
427425 * set to false
428426 * <li>Depending when the failure occurs QoS 0 messages may not be delivered.
429427 * </ul>
430- * </p>
431428 *
432429 * <p>When building an application,
433430 * the design of the topic tree should take into account the following principles
@@ -442,30 +439,29 @@ public IMqttDeliveryToken publish(String topic, byte[] payload, int qos,
442439 * <li>A leading "/" creates a distinct topic. For example, <em>/finance</em> is
443440 * different from <em>finance</em>. <em>/finance</em> matches "+/+" and "/+", but
444441 * not "+".</li>
445- * <li>Do not include the null character (Unicode <samp class="codeph" >\x0000</samp >) in
442+ * <li>Do not include the null character (Unicode <pre >\x0000</pre >) in
446443 * any topic.</li>
447444 * </ul>
448445 *
449446 * <p>The following principles apply to the construction and content of a topic
450447 * tree:</p>
451- *
452448 * <ul>
453449 * <li>The length is limited to 64k but within that there are no limits to the
454450 * number of levels in a topic tree.</li>
455451 * <li>There can be any number of root nodes; that is, there can be any number
456452 * of topic trees.</li>
457453 * </ul>
458- * </p>
454+ *
459455 * <p>The method returns control before the publish completes. Completion can
460456 * be tracked by:
457+ * </p>
461458 * <ul>
462459 * <li>Setting an {@link IMqttAsyncClient#setCallback(MqttCallback)} where the
463460 * {@link MqttCallback#deliveryComplete(IMqttDeliveryToken)}
464461 * method will be called.</li>
465462 * <li>Waiting on the returned token {@link MqttToken#waitForCompletion()} or</li>
466463 * <li>Passing in a callback {@link IMqttActionListener} to this method</li>
467464 * </ul>
468- * </p>
469465 *
470466 * @param topic to deliver the message to, for example "finance/stock/ibm".
471467 * @param message to deliver to the server
@@ -551,23 +547,25 @@ public IMqttToken subscribe(String topicFilter, int qos, Object userContext, IMq
551547 * <p>
552548 * If (@link MqttConnectOptions#setCleanSession(boolean)} was set to true
553549 * when when connecting to the server then the subscription remains in place
554- * until either:
550+ * until either:</p>
551+ *
555552 * <ul>
556553 * <li>The client disconnects</li>
557554 * <li>An unsubscribe method is called to un-subscribe the topic</li>
558- * </li >
559- * </p>
555+ * </ul >
556+ *
560557 * <p>
561558 * If (@link MqttConnectOptions#setCleanSession(boolean)} was set to false
562559 * when connecting to the server then the subscription remains in place
563- * until either:
560+ * until either:</p>
564561 * <ul>
565562 * <li>An unsubscribe method is called to unsubscribe the topic</li>
566- * <li>The next time the client connects with cleanSession set to true</ul>
567- * </li>
563+ * <li>The next time the client connects with cleanSession set to true</li>
564+ * </ul>
565+ * <p>
568566 * With cleanSession set to false the MQTT server will store messages on
569567 * behalf of the client when the client is not connected. The next time the
570- * client connects with the <bold >same client ID</bold > the server will
568+ * client connects with the <b >same client ID</b > the server will
571569 * deliver the stored messages to the client.
572570 * </p>
573571 *
@@ -589,9 +587,12 @@ public IMqttToken subscribe(String topicFilter, int qos, Object userContext, IMq
589587 * <dd><p>The number sign (#) is a wildcard character that matches
590588 * any number of levels within a topic. For example, if you subscribe to
591589 * <span><span class="filepath">finance/stock/ibm/#</span></span>, you receive
592- * messages on these topics:
593- * <pre> finance/stock/ibm<br /> finance/stock/ibm/closingprice<br /> finance/stock/ibm/currentprice</pre>
594- * </p>
590+ * messages on these topics:</p>
591+ * <ul>
592+ * <li>finance/stock/ibm</li>
593+ * <li>finance/stock/ibm/closingprice</li>
594+ * <li>finance/stock/ibm/currentprice</li>
595+ * </ul>
595596 * <p>The multi-level wildcard
596597 * can represent zero or more levels. Therefore, <em>finance/#</em> can also match
597598 * the singular <em>finance</em>, where <em>#</em> represents zero levels. The topic
@@ -622,14 +623,12 @@ public IMqttToken subscribe(String topicFilter, int qos, Object userContext, IMq
622623 * For example, <em>finance/+</em> and <em>finance/+/ibm</em> are both valid.</span></p>
623624 * </dd>
624625 * </dl>
625- * </p>
626626 * <p>The method returns control before the subscribe completes. Completion can
627- * be tracked by:
627+ * be tracked by:</p>
628628 * <ul>
629629 * <li>Waiting on the supplied token {@link MqttToken#waitForCompletion()} or</li>
630630 * <li>Passing in a callback {@link IMqttActionListener} to this method</li>
631631 * </ul>
632- * </p>
633632 *
634633 * @param topicFilters one or more topics to subscribe to, which can include wildcards
635634 * @param qos the maximum quality of service to subscribe each topic at.Messages
@@ -790,11 +789,12 @@ public IMqttToken unsubscribe(String topicFilter, Object userContext, IMqttActio
790789 * </p>
791790 * <p>The method returns control before the unsubscribe completes. Completion can
792791 * be tracked by:
792+ * </p>
793+ *
793794 * <ul>
794795 * <li>Waiting on the returned token {@link MqttToken#waitForCompletion()} or</li>
795796 * <li>Passing in a callback {@link IMqttActionListener} to this method</li>
796797 * </ul>
797- * </p>
798798 *
799799 * @param topicFilters one or more topics to unsubscribe from. Each topicFilter
800800 * must match one specified on an earlier subscribe.
@@ -814,12 +814,12 @@ public IMqttToken unsubscribe(String[] topicFilters, Object userContext, IMqttAc
814814 * Sets a callback listener to use for events that happen asynchronously.
815815 * <p>There are a number of events that the listener will be notified about.
816816 * These include:
817+ * </p>
817818 * <ul>
818819 * <li>A new message has arrived and is ready to be processed</li>
819820 * <li>The connection to the server has been lost</li>
820821 * <li>Delivery of a message to the server has completed</li>
821822 * </ul>
822- * </p>
823823 * <p>Other events that track the progress of an individual operation such
824824 * as connect and subscribe can be tracked using the {@link MqttToken} returned from
825825 * each non-blocking method or using setting a {@link IMqttActionListener} on the
@@ -852,7 +852,7 @@ public IMqttToken unsubscribe(String[] topicFilters, Object userContext, IMqttAc
852852 * sent. The default behaviour, when manualAcks is false, is to send the MQTT
853853 * acknowledgements automatically at the successful completion of the messageArrived
854854 * callback method.
855- * @param manualAcks
855+ * @param manualAcks if set to true MQTT acknowledgements are not sent
856856 */
857857 public void setManualAcks (boolean manualAcks );
858858
@@ -861,7 +861,7 @@ public IMqttToken unsubscribe(String[] topicFilters, Object userContext, IMqttAc
861861 * This will cause the MQTT acknowledgement to be sent to the server.
862862 * @param messageId the MQTT message id to be acknowledged
863863 * @param qos the MQTT QoS of the message to be acknowledged
864- * @throws MqttException
864+ * @throws MqttException if there was a problem sending the acknowledgement
865865 */
866866 public void messageArrivedComplete (int messageId , int qos ) throws MqttException ;
867867
0 commit comments