summaryrefslogtreecommitdiff
path: root/libs/org.eclipse.paho.client.mqttv3/org/eclipse/paho/client/mqttv3/MqttClient.html
blob: 3a14a1a0ff208e5cab9e503cfcca9a9cfa7fc57b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2) on Tue Oct 02 23:24:48 BST 2012 -->
<TITLE>
MqttClient (MQTT v3 Client API)
</TITLE>

<META NAME="keywords" CONTENT="org.eclipse.paho.client.mqttv3.MqttClient class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="MqttClient (MQTT v3 Client API)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<A HREF="#main"><FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MqttClient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html" title="class in org.eclipse.paho.client.mqttv3"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MqttClient.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<A NAME="main"></A>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.eclipse.paho.client.mqttv3</FONT>
<BR>
Class MqttClient</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>org.eclipse.paho.client.mqttv3.MqttClient</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>org.eclipse.paho.client.mqttv3.internal.DestinationProvider</DD>
</DL>
<HR>
<DL>
<DT>public class <B>MqttClient</B><DT>extends java.lang.Object<DT>implements org.eclipse.paho.client.mqttv3.internal.DestinationProvider</DL>

<P>
Lightweight client for talking to a server via the MQTT version 3 
 protocol.  The client allows an application to use publish/subscribe 
 messaging.
<P>

<P>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#MqttClient(java.lang.String, java.lang.String)">MqttClient</A></B>(java.lang.String&nbsp;serverURI,
           java.lang.String&nbsp;clientId)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an MqttClient to connect to the specified address, using the
 specified client identifier.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#MqttClient(java.lang.String, java.lang.String, org.eclipse.paho.client.mqttv3.MqttClientPersistence)">MqttClient</A></B>(java.lang.String&nbsp;serverURI,
           java.lang.String&nbsp;clientId,
           <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClientPersistence.html" title="interface in org.eclipse.paho.client.mqttv3">MqttClientPersistence</A>&nbsp;persistence)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an MqttClient to connect to the specified address, using the
 specified client identifer and persistence implementation.  </TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#connect()">connect</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connects to a server using the default options.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#connect(org.eclipse.paho.client.mqttv3.MqttConnectOptions)">connect</A></B>(<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html" title="class in org.eclipse.paho.client.mqttv3">MqttConnectOptions</A>&nbsp;options)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connects to a server using the specified options.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#disconnect()">disconnect</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Disconnects from the server, which quiesces for up to a
 maximum of thirty seconds, to allow the client to finish any work it 
 currently has.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#disconnect(long)">disconnect</A></B>(long&nbsp;quiesceTimeout)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Disconnects from the server.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#generateClientId()">generateClientId</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a randomly generated client identifier based on the current user's login
 name and the system time.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#getClientId()">getClientId</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the client ID used by this client.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttDeliveryToken.html" title="interface in org.eclipse.paho.client.mqttv3">MqttDeliveryToken</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#getPendingDeliveryTokens()">getPendingDeliveryTokens</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the delivery tokens for any outstanding publish operations.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#getServerURI()">getServerURI</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the address of the server used by this client, as a URI.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttTopic.html" title="class in org.eclipse.paho.client.mqttv3">MqttTopic</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#getTopic(java.lang.String)">getTopic</A></B>(java.lang.String&nbsp;topic)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a topic object which can be used to publish messages.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#isConnected()">isConnected</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if this client is currently connected to the
 server.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)">setCallback</A></B>(<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttCallback.html" title="interface in org.eclipse.paho.client.mqttv3">MqttCallback</A>&nbsp;callback)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the callback listener to use for asynchronously received
 messages.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String)">subscribe</A></B>(java.lang.String&nbsp;topicFilter)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subscribes to a topic, which may include wildcards, using the default
 options.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String[])">subscribe</A></B>(java.lang.String[]&nbsp;topicFilters)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subscribes to multiple topics, each of which may include wildcards, 
 using the default options.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String[], int[])">subscribe</A></B>(java.lang.String[]&nbsp;topicFilters,
          int[]&nbsp;qos)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subscribes to multiple topics, each of which may include wildcards, 
 using the specified options.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String, int)">subscribe</A></B>(java.lang.String&nbsp;topicFilter,
          int&nbsp;qos)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subscribes to a topic, which may include wildcards, using the specified
 options.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#unsubscribe(java.lang.String)">unsubscribe</A></B>(java.lang.String&nbsp;topicFilter)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unsubscribes from a topic.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#unsubscribe(java.lang.String[])">unsubscribe</A></B>(java.lang.String[]&nbsp;topicFilters)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unsubscribes from multiple topics.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="MqttClient(java.lang.String, java.lang.String)"><!-- --></A><H3>
MqttClient</H3>
<PRE>
public <B>MqttClient</B>(java.lang.String&nbsp;serverURI,
                  java.lang.String&nbsp;clientId)
           throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Creates an MqttClient to connect to the specified address, using the
 specified client identifier.  The address
 should be a URI, using a scheme of either "tcp://" for a TCP connection
 or "ssl://" for a TCP connection secured by SSL/TLS. For example:
 <ul>
 	<li><code>tcp://localhost:1883</code></li>
 	<li><code>ssl://localhost:8883</code></li>
 </ul>
 <p>
 If the port is not specified, it will
 default to 1883 for "tcp://" URIs, and 8883 for "ssl://" URIs.
 </p>
 <p>
 The client identifier should be unique across all clients connecting to the same
 server. A convenience method is provided to generate a random client id that
 should satisfy this criteria - <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#generateClientId()"><CODE>generateClientId()</CODE></A>. As the client identifier
 is used by the server to identify a client when it reconnects, the client must use the
 same identifier between connections if durable subscriptions are to be used.
 </p>
 <p>
 In Java SE, SSL can be configured in one of several ways, which the 
 client will use in the following order:
 </p>
 <ul>
 	<li><strong>Supplying an <code>SSLSocketFactory</code></strong> - applications can
 use <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html#setSocketFactory(javax.net.SocketFactory)"><CODE>MqttConnectOptions.setSocketFactory(SocketFactory)</CODE></A> to supply 
 a factory with the appropriate SSL settings.</li>
 	<li><strong>SSL Properties</strong> - applications can supply SSL settings as a 
 simple Java Properties using <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html#setSSLProperties(java.util.Properties)"><CODE>MqttConnectOptions.setSSLProperties(Properties)</CODE></A>.</li>
 	<li><strong>Use JVM settings</strong> - There are a number of standard 
 Java system properties that can be used to configure key and trust stores.</li>
 </ul>
 
 <p>In Java ME, the platform settings are used for SSL connections.</p>
  
 <p>A default instance of <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html" title="class in org.eclipse.paho.client.mqttv3"><CODE>MqttDefaultFilePersistence</CODE></A> is used by
 the client. To specify a different persistence implementation, or to turn
 off persistence, use the <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#MqttClient(java.lang.String, java.lang.String, org.eclipse.paho.client.mqttv3.MqttClientPersistence)"><CODE>MqttClient(String, String, MqttClientPersistence)</CODE></A> constructor.
<P>
<DT><B>Parameters:</B><DD><CODE>serverURI</CODE> - the address to connect to, specified as a URI<DD><CODE>clientId</CODE> - the client ID to use
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the URI does not start with
 "tcp://", "ssl://" or "local://".
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the clientId is null or is greater than 23 characters in length
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE> - if any other problem was encountered</DL>
<HR>

<A NAME="MqttClient(java.lang.String, java.lang.String, org.eclipse.paho.client.mqttv3.MqttClientPersistence)"><!-- --></A><H3>
MqttClient</H3>
<PRE>
public <B>MqttClient</B>(java.lang.String&nbsp;serverURI,
                  java.lang.String&nbsp;clientId,
                  <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClientPersistence.html" title="interface in org.eclipse.paho.client.mqttv3">MqttClientPersistence</A>&nbsp;persistence)
           throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Creates an MqttClient to connect to the specified address, using the
 specified client identifer and persistence implementation.  The address
 should be a URI, using a scheme of either "tcp://" for a TCP connection
 or "ssl://" for a TCP connection secured by SSL/TLS. For example:
 <ul>
 	<li><code>tcp://localhost:1883</code></li>
 	<li><code>ssl://localhost:8883</code></li>
 	<li><code>local://FirstBroker</code></li>
 </ul>
 <p>
 If the port is not specified, it will
 default to 1883 for "tcp://" URIs, and 8883 for "ssl://" URIs.
 </p>
 <p>
 The client identifier should be unique across all clients connecting to the same
 server. A convenience method is provided to generate a random client id that
 should satisfy this criteria - <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#generateClientId()"><CODE>generateClientId()</CODE></A>. As the client identifier
 is used by the server to identify a client when it reconnects, the client must use the
 same identifier between connections if durable subscriptions are to be used.
 </p>
 <p>
 In Java SE, SSL can be configured in one of several ways, which the 
 client will use in the following order:
 </p>
 <ul>
 	<li><strong>Supplying an <code>SSLSocketFactory</code></strong> - applications can
 use <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html#setSocketFactory(javax.net.SocketFactory)"><CODE>MqttConnectOptions.setSocketFactory(SocketFactory)</CODE></A> to supply 
 a factory with the appropriate SSL settings.</li>
 	<li><strong>SSL Properties</strong> - applications can supply SSL settings as a 
 simple Java Properties using <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html#setSSLProperties(java.util.Properties)"><CODE>MqttConnectOptions.setSSLProperties(Properties)</CODE></A>.</li>
 	<li><strong>Use JVM settings</strong> - There are a number of standard 
 Java system properties that can be used to configure key and trust stores.</li>
 </ul>
 
 <p>In Java ME, the platform settings are used for SSL connections.</p>
  
 The persistence mechanism is used to enable reliable messaging.
 For qualities of server (QoS) 1 or 2 to work, messages must be persisted
 to disk by both the client and the server.  If this is not done, then
 a failure in the client or server will result in lost messages.   It
 is the application's responsibility to provide an implementation of the
 <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClientPersistence.html" title="interface in org.eclipse.paho.client.mqttv3"><CODE>MqttClientPersistence</CODE></A> interface, which the client can use to
 persist messages.  If the application is only sending QoS 0 messages, 
 then this is not needed.
 
 <p>An implementation of file-based persistence is provided in the 
 class <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttDefaultFilePersistence.html" title="class in org.eclipse.paho.client.mqttv3"><CODE>MqttDefaultFilePersistence</CODE></A>.
 If no persistence is needed, it can be explicitly set to <code>null</code>.</p>
<P>
<DT><B>Parameters:</B><DD><CODE>serverURI</CODE> - the address to connect to, specified as a URI<DD><CODE>clientId</CODE> - the client ID to use<DD><CODE>persistence</CODE> - the persistence mechanism to use.
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the URI does not start with
 "tcp://", "ssl://" or "local://".
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the clientId is null or is greater than 23 characters in length
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE> - if any other problem was encountered</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="connect()"><!-- --></A><H3>
connect</H3>
<PRE>
public void <B>connect</B>()
             throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A>,
                    <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Connects to a server using the default options.
 It is recommended to call <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><CODE>setCallback(MqttCallback)</CODE></A> prior to
 connecting.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></CODE>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="connect(org.eclipse.paho.client.mqttv3.MqttConnectOptions)"><!-- --></A><H3>
connect</H3>
<PRE>
public void <B>connect</B>(<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html" title="class in org.eclipse.paho.client.mqttv3">MqttConnectOptions</A>&nbsp;options)
             throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A>,
                    <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Connects to a server using the specified options.
 It is recommended to call <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><CODE>setCallback(MqttCallback)</CODE></A> prior to
 connecting.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></CODE>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="disconnect()"><!-- --></A><H3>
disconnect</H3>
<PRE>
public void <B>disconnect</B>()
                throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Disconnects from the server, which quiesces for up to a
 maximum of thirty seconds, to allow the client to finish any work it 
 currently has.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#disconnect(long)"><CODE>disconnect(long)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="disconnect(long)"><!-- --></A><H3>
disconnect</H3>
<PRE>
public void <B>disconnect</B>(long&nbsp;quiesceTimeout)
                throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Disconnects from the server.
 This method must not be called from inside <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttCallback.html" title="interface in org.eclipse.paho.client.mqttv3"><CODE>MqttCallback</CODE></A> methods.
 <p>
 Firstly, the client will wait for all <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttCallback.html" title="interface in org.eclipse.paho.client.mqttv3"><CODE>MqttCallback</CODE></A> methods to 
 complete.  It will then quiesce for the specified time, to allow for
 work which has already been accepted to complete - for example, it will
 wait for the QoS 2 flows from earlier publications to complete.  After
 the quiesce timeout, the client will disconnect from the server.  When
 the client is next connected, any QoS 1 or 2 messages which have not 
 completed will be retried.</p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>quiesceTimeout</CODE> - the amount of time in milliseconds to allow for existing work to finish
 before disconnecting.  A value of zero or less means the client will
 not quiesce.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="isConnected()"><!-- --></A><H3>
isConnected</H3>
<PRE>
public boolean <B>isConnected</B>()</PRE>
<DL>
<DD>Determines if this client is currently connected to the
 server.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if connected, <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>

<A NAME="getClientId()"><!-- --></A><H3>
getClientId</H3>
<PRE>
public java.lang.String <B>getClientId</B>()</PRE>
<DL>
<DD>Returns the client ID used by this client.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the client ID used by this client.</DL>
</DD>
</DL>
<HR>

<A NAME="getServerURI()"><!-- --></A><H3>
getServerURI</H3>
<PRE>
public java.lang.String <B>getServerURI</B>()</PRE>
<DL>
<DD>Returns the address of the server used by this client, as a URI.
 The format is the same as specified on the constructor.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the server's address, as a URI String.<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#MqttClient(java.lang.String, java.lang.String)"><CODE>MqttClient(String, String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getTopic(java.lang.String)"><!-- --></A><H3>
getTopic</H3>
<PRE>
public <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttTopic.html" title="class in org.eclipse.paho.client.mqttv3">MqttTopic</A> <B>getTopic</B>(java.lang.String&nbsp;topic)</PRE>
<DL>
<DD>Gets a topic object which can be used to publish messages.
 <p>When you build an application,
 the design of the topic tree should take into account the following principles
 of topic name syntax and semantics:</p>
 
 <ul>
 	<li>A topic must be at least one character long.</li>
 	<li>Topic names are case sensitive.  For example, <em>ACCOUNTS</em> and <em>Accounts</em> are
 	two different topics.</li>
 	<li>Topic names can include the space character.  For example, <em>Accounts
 	payable</em> is a valid topic.</li>
 	<li>A leading "/" creates a distinct topic.  For example, <em>/finance</em> is
 	different from <em>finance</em>. <em>/finance</em> matches "+/+" and "/+", but
 	not "+".</li>
 	<li>Do not include the null character (Unicode<samp class="codeph"> \x0000</samp>) in
 	any topic.</li>
 </ul>
 
 <p>The following principles apply to the construction and content of a topic
 tree:</p>
 
 <ul>
 	<li>The length is limited to 64k but within that there are no limits to the
 	number of levels in a topic tree.</li>
 	<li>There can be any number of root nodes; that is, there can be any number
 	of topic trees.</li>
 	</ul>
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getTopic</CODE> in interface <CODE>org.eclipse.paho.client.mqttv3.internal.DestinationProvider</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>topic</CODE> - the topic to use, for example "finance/stock/ibm".
<DT><B>Returns:</B><DD>an MqttTopic object, which can be used to publish messages to 
 the topic.
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the topic contains a '+' or '#' 
 wildcard character.</DL>
</DD>
</DL>
<HR>

<A NAME="subscribe(java.lang.String)"><!-- --></A><H3>
subscribe</H3>
<PRE>
public void <B>subscribe</B>(java.lang.String&nbsp;topicFilter)
               throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A>,
                      <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></PRE>
<DL>
<DD>Subscribes to a topic, which may include wildcards, using the default
 options.  The <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><CODE>setCallback(MqttCallback)</CODE></A> method should be called
 before this method, otherwise any received messages will be discarded.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String[], int[])"><CODE>subscribe(String[], int[])</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="subscribe(java.lang.String[])"><!-- --></A><H3>
subscribe</H3>
<PRE>
public void <B>subscribe</B>(java.lang.String[]&nbsp;topicFilters)
               throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A>,
                      <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></PRE>
<DL>
<DD>Subscribes to multiple topics, each of which may include wildcards, 
 using the default options.  The <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><CODE>setCallback(MqttCallback)</CODE></A> method should be called
 before this method, otherwise any received messages will be discarded.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String[], int[])"><CODE>subscribe(String[], int[])</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="subscribe(java.lang.String, int)"><!-- --></A><H3>
subscribe</H3>
<PRE>
public void <B>subscribe</B>(java.lang.String&nbsp;topicFilter,
                      int&nbsp;qos)
               throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A>,
                      <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></PRE>
<DL>
<DD>Subscribes to a topic, which may include wildcards, using the specified
 options.  The <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><CODE>setCallback(MqttCallback)</CODE></A> method should be called
 before this method, otherwise any received messages will be discarded.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>topicFilter</CODE> - the topic to subscribe to, which can include wildcards.<DD><CODE>qos</CODE> - the quality of service at which to subscribe.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#subscribe(java.lang.String[], int[])"><CODE>subscribe(String[], int[])</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="subscribe(java.lang.String[], int[])"><!-- --></A><H3>
subscribe</H3>
<PRE>
public void <B>subscribe</B>(java.lang.String[]&nbsp;topicFilters,
                      int[]&nbsp;qos)
               throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A>,
                      <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></PRE>
<DL>
<DD>Subscribes to multiple topics, each of which may include wildcards, 
 using the specified options.  The <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttClient.html#setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><CODE>setCallback(MqttCallback)</CODE></A> method should be called
 before this method, otherwise any received messages will be discarded.
 
 <p>The "topic filter" string used when subscribing
 may contain special characters, which allow you to subscribe to multiple topics
 at once.</p>
 <p>The topic level separator is used to introduce structure into the topic, and
 can therefore be specified within the topic for that purpose.  The multi-level
 wildcard and single-level wildcard can be used for subscriptions, but they
 cannot be used within a topic by the publisher of a message.
 <dl>
 	<dt>Topic level separator</dt>
 	<dd>The forward slash (/) is used to separate each level within
 	a topic tree and provide a hierarchical structure to the topic space. The
 	use of the topic level separator is significant when the two wildcard characters
 	are encountered in topics specified by subscribers.</dd>
 
 	<dt>Multi-level wildcard</dt>
 	<dd><p>The number sign (#) is a wildcard character that matches
 	any number of levels within a topic. For example, if you subscribe to <span><span class="filepath">finance/stock/ibm/#</span></span>, you receive
 	messages on these topics:<pre>   finance/stock/ibm<br />   finance/stock/ibm/closingprice<br />   finance/stock/ibm/currentprice</pre>
 </p>
 <p>The multi-level wildcard
 can represent zero or more levels. Therefore, <em>finance/#</em> can also match
 	the singular <em>finance</em>, where <em>#</em> represents zero levels. The topic
 	level separator is meaningless in this context, because there are no levels
 	to separate.</p>
 
 	<p>The <span>multi-level</span> wildcard can
 	be specified only on its own or next to the topic level separator character.
 	Therefore, <em>#</em> and <em>finance/#</em> are both valid, but <em>finance#</em> is
 	not valid. <span>The multi-level wildcard must be the last character
  used within the topic tree. For example, <em>finance/#</em> is valid but <em>finance/#/closingprice</em> is
 	not valid.</span></p></dd>
 
 	<dt>Single-level wildcard</dt>
 	<dd><p>The plus sign (+) is a wildcard character that matches only one topic
 	level. For example, <em>finance/stock/+</em> matches <em>finance/stock/ibm</em> and <em>finance/stock/xyz</em>,
 	but not <em>finance/stock/ibm/closingprice</em>. Also, because the single-level
 	wildcard matches only a single level, <em>finance/+</em> does not match <em>finance</em>.</p>
 	
 	<p>Use
 	the single-level wildcard at any level in the topic tree, and in conjunction
 	with the multilevel wildcard. Specify the single-level wildcard next to the
 	topic level separator, except when it is specified on its own. Therefore, <em>+</em> and <em>finance/+</em> are
 	both valid, but <em>finance+</em> is not valid. <span>The single-level
 	wildcard can be used at the end of the topic tree or within the topic tree.
 	For example, <em>finance/+</em> and <em>finance/+/ibm</em> are both valid.</span></p>
 	</dd>
 </dl>
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>topicFilters</CODE> - the topics to subscribe to, which can include wildcards.<DD><CODE>qos</CODE> - the qualities of service levels at which to subscribe.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE> - if there was an error registering the subscription.
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the two supplied arrays are not the same size.
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3">MqttSecurityException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="unsubscribe(java.lang.String)"><!-- --></A><H3>
unsubscribe</H3>
<PRE>
public void <B>unsubscribe</B>(java.lang.String&nbsp;topicFilter)
                 throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Unsubscribes from a topic.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>topicFilter</CODE> - the topic to unsubscribe from.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="unsubscribe(java.lang.String[])"><!-- --></A><H3>
unsubscribe</H3>
<PRE>
public void <B>unsubscribe</B>(java.lang.String[]&nbsp;topicFilters)
                 throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Unsubscribes from multiple topics.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>topicFilters</CODE> - the topics to unsubscribe from.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="setCallback(org.eclipse.paho.client.mqttv3.MqttCallback)"><!-- --></A><H3>
setCallback</H3>
<PRE>
public void <B>setCallback</B>(<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttCallback.html" title="interface in org.eclipse.paho.client.mqttv3">MqttCallback</A>&nbsp;callback)
                 throws <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></PRE>
<DL>
<DD>Sets the callback listener to use for asynchronously received
 messages.
 The 
 <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttCallback.html#messageArrived(org.eclipse.paho.client.mqttv3.MqttTopic, org.eclipse.paho.client.mqttv3.MqttMessage)"><CODE>MqttCallback.messageArrived(MqttTopic, MqttMessage)</CODE></A>
 method will be called back whenever a message arrives.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>callback</CODE> - the class to callback when a message arrives.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="generateClientId()"><!-- --></A><H3>
generateClientId</H3>
<PRE>
public static java.lang.String <B>generateClientId</B>()</PRE>
<DL>
<DD>Returns a randomly generated client identifier based on the current user's login
 name and the system time.
 <p>When cleanSession is set to false, an application should ensure it uses the 
 same client identifier when it reconnects to the server to resume state and maintain
  assured message delivery.</p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>a generated client identifier<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html#setCleanSession(boolean)"><CODE>MqttConnectOptions.setCleanSession(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getPendingDeliveryTokens()"><!-- --></A><H3>
getPendingDeliveryTokens</H3>
<PRE>
public <A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttDeliveryToken.html" title="interface in org.eclipse.paho.client.mqttv3">MqttDeliveryToken</A>[] <B>getPendingDeliveryTokens</B>()</PRE>
<DL>
<DD>Returns the delivery tokens for any outstanding publish operations.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<A HREF="#main"><FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MqttClient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../../org/eclipse/paho/client/mqttv3/MqttConnectOptions.html" title="class in org.eclipse.paho.client.mqttv3"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MqttClient.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>