Skip to content

Commit 1d7a676

Browse files
authored
Updating Javadoc to be compatible with the new Java 8 JRE (#285)
* Testing Travis issue with OfflineBufferingTest.testManyMessageBufferAndDeliver Signed-off-by: James Sutton <james.sutton@uk.ibm.com> * Removing accidential test log entry Signed-off-by: James Sutton <james.sutton@uk.ibm.com> * Fixing Javadoc to be Java 8 compliant Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
1 parent 07f3be5 commit 1d7a676

47 files changed

Lines changed: 541 additions & 306 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

org.eclipse.paho.client.mqttv3/pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<packaging>eclipse-plugin</packaging>
1212

1313
<profiles>
14+
<!--
1415
<profile>
1516
<id>doclint-java8-disable</id>
1617
<activation>
@@ -20,6 +21,7 @@
2021
<javadoc.opts>-Xdoclint:none</javadoc.opts>
2122
</properties>
2223
</profile>
24+
-->
2325
</profiles>
2426

2527
<build>
@@ -77,7 +79,7 @@
7779
<target>${mqttclient.java.version}</target>
7880
</configuration>
7981
</plugin>
80-
<!-- <plugin>
82+
<plugin>
8183
<groupId>org.apache.maven.plugins</groupId>
8284
<artifactId>maven-javadoc-plugin</artifactId>
8385
<version>2.10.3</version>
@@ -93,7 +95,7 @@
9395
</execution>
9496
</executions>
9597
</plugin>
96-
<plugin>
98+
<!-- <plugin>
9799
<groupId>org.eclipse.tycho.extras</groupId>
98100
<artifactId>tycho-document-bundle-plugin</artifactId>
99101
<executions>

org.eclipse.paho.client.mqttv3/src/main/java-templates/org/eclipse/paho/client/mqttv3/internal/ClientComms.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public class ClientComms {
8484
/**
8585
* Creates a new ClientComms object, using the specified module to handle
8686
* the network calls.
87+
* @param client The {@link IMqttAsyncClient}
88+
* @param persistence the {@link MqttClientPersistence} layer.
89+
* @param pingSender the {@link MqttPingSender}
90+
* @throws MqttException if an exception occurs whilst communicating with the server
8791
*/
8892
public ClientComms(IMqttAsyncClient client, MqttClientPersistence persistence, MqttPingSender pingSender) throws MqttException {
8993
this.conState = DISCONNECTED;
@@ -141,6 +145,9 @@ void internalSend(MqttWireMessage message, MqttToken token) throws MqttException
141145
/**
142146
* Sends a message to the broker if in connected state, but only waits for the message to be
143147
* stored, before returning.
148+
* @param message The {@link MqttWireMessage} to send
149+
* @param token The {@link MqttToken} to send.
150+
* @throws MqttException if an error occurs sending the message
144151
*/
145152
public void sendNoWait(MqttWireMessage message, MqttToken token) throws MqttException {
146153
final String methodName = "sendNoWait";
@@ -218,6 +225,9 @@ public void close() throws MqttException {
218225
* Sends a connect message and waits for an ACK or NACK.
219226
* Connecting is a special case which will also start up the
220227
* network connection, receive thread, and keep alive thread.
228+
* @param options The {@link MqttConnectOptions} for the connection
229+
* @param token The {@link MqttToken} to track the connection
230+
* @throws MqttException if an error occurs when connecting
221231
*/
222232
public void connect(MqttConnectOptions options, MqttToken token) throws MqttException {
223233
final String methodName = "connect";
@@ -288,6 +298,8 @@ public void connectComplete( MqttConnack cack, MqttException mex) throws MqttExc
288298
* an abnormal disconnection. The method may be invoked multiple times
289299
* in parallel as each thread when it receives an error uses this method
290300
* to ensure that shutdown completes successfully.
301+
* @param token the {@link MqttToken} To track closing the connection
302+
* @param reason the {@link MqttException} thrown requiring the connection to be shut down.
291303
*/
292304
public void shutdownConnection(MqttToken token, MqttException reason) {
293305
final String methodName = "shutdownConnection";
@@ -478,6 +490,10 @@ public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout) thro
478490

479491
/**
480492
* Disconnect the connection and reset all the states.
493+
* @param quiesceTimeout How long to wait whilst quiesing before messages are deleted.
494+
* @param disconnectTimeout How long to wait whilst disconnecting
495+
* @param sendDisconnectPacket If true, will send a disconnect packet
496+
* @throws MqttException if an error occurs whilst disconnecting
481497
*/
482498
public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout, boolean sendDisconnectPacket) throws MqttException {
483499
// Allow current inbound and outbound work to complete
@@ -765,7 +781,7 @@ private void handleRunException(Exception ex) {
765781
/**
766782
* When Automatic reconnect is enabled, we want ClientComs to enter the
767783
* 'resting' state if disconnected. This will allow us to publish messages
768-
* @param resting
784+
* @param resting if true, resting is enabled
769785
*/
770786
public void setRestingState(boolean resting) {
771787
this.resting = resting;
@@ -792,7 +808,6 @@ public void deleteBufferedMessage(int bufferIndex){
792808
/**
793809
* When the client automatically reconnects, we want to send all messages from the
794810
* buffer first before allowing the user to send any messages
795-
* @throws MqttException
796811
*/
797812
public void notifyReconnect() {
798813
final String methodName = "notifyReconnect";

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/IMqttActionListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public interface IMqttActionListener {
2424
* are in the process of being delivered will be delivered to the requested
2525
* quality of service next time the client connects.
2626
* @param asyncActionToken associated with the action that has failed
27+
* @param exception thrown by the action that has failed
2728
*/
2829
public void onFailure(IMqttToken asyncActionToken, Throwable exception);
2930
}

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/IMqttAsyncClient.java

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
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
@@ -51,7 +51,6 @@
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
@@ -61,40 +60,38 @@
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) {
@@ -105,8 +102,8 @@
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

Comments
 (0)