blob: 130d7d4dd0abd0fea7b917f99a4f3b2237d1f3a1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_101) on Thu Sep 01 13:59:14 BST 2016 -->
<title>MqttToken</title>
<meta name="date" content="2016-09-01">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="MqttToken";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/MqttToken.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttTopic.html" title="class in org.eclipse.paho.client.mqttv3"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/eclipse/paho/client/mqttv3/MqttToken.html" target="_top">Frames</a></li>
<li><a href="MqttToken.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.eclipse.paho.client.mqttv3</div>
<h2 title="Class MqttToken" class="title">Class MqttToken</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.eclipse.paho.client.mqttv3.MqttToken</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttDeliveryToken.html" title="class in org.eclipse.paho.client.mqttv3">MqttDeliveryToken</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">MqttToken</span>
extends java.lang.Object
implements <a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></pre>
<div class="block">Provides a mechanism for tracking the completion of an asynchronous action.
<p>
A token that implements the ImqttToken interface is returned from all non-blocking
method with the exception of publish.
</p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3"><code>IMqttToken</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/eclipse/paho/client/mqttv3/internal/Token.html" title="class in org.eclipse.paho.client.mqttv3.internal">Token</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#internalTok">internalTok</a></span></code>
<div class="block">A reference to the the class that provides most of the implementation of the
MqttToken.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#MqttToken--">MqttToken</a></span>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#MqttToken-java.lang.String-">MqttToken</a></span>(java.lang.String&nbsp;logContext)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttActionListener.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttActionListener</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getActionCallback--">getActionCallback</a></span>()</code>
<div class="block">Return the async listener for this token.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttAsyncClient.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttAsyncClient</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getClient--">getClient</a></span>()</code>
<div class="block">Returns the MQTT client that is responsible for processing the asynchronous
action</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getException--">getException</a></span>()</code>
<div class="block">Returns an exception providing more detail if an operation failed.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getGrantedQos--">getGrantedQos</a></span>()</code>
<div class="block">Returns the granted QoS list from a suback</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getMessageId--">getMessageId</a></span>()</code>
<div class="block">Returns the message ID of the message that is associated with the token.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/eclipse/paho/client/mqttv3/internal/wire/MqttWireMessage.html" title="class in org.eclipse.paho.client.mqttv3.internal.wire">MqttWireMessage</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getResponse--">getResponse</a></span>()</code>
<div class="block">Returns the response wire message</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getSessionPresent--">getSessionPresent</a></span>()</code>
<div class="block">Returns the session present flag from a connack</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getTopics--">getTopics</a></span>()</code>
<div class="block">Returns the topic string(s) for the action being tracked by this
token.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#getUserContext--">getUserContext</a></span>()</code>
<div class="block">Retrieve the context associated with an action.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#isComplete--">isComplete</a></span>()</code>
<div class="block">Returns whether or not the action has finished.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#setActionCallback-org.eclipse.paho.client.mqttv3.IMqttActionListener-">setActionCallback</a></span>(<a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttActionListener.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttActionListener</a>&nbsp;listener)</code>
<div class="block">Register a listener to be notified when an action completes.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#setUserContext-java.lang.Object-">setUserContext</a></span>(java.lang.Object&nbsp;userContext)</code>
<div class="block">Store some context associated with an action.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#waitForCompletion--">waitForCompletion</a></span>()</code>
<div class="block">Blocks the current thread until the action this token is associated with has
completed.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttToken.html#waitForCompletion-long-">waitForCompletion</a></span>(long&nbsp;timeout)</code>
<div class="block">Blocks the current thread until the action this token is associated with has
completed.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="internalTok">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>internalTok</h4>
<pre>public&nbsp;<a href="../../../../../org/eclipse/paho/client/mqttv3/internal/Token.html" title="class in org.eclipse.paho.client.mqttv3.internal">Token</a> internalTok</pre>
<div class="block">A reference to the the class that provides most of the implementation of the
MqttToken. MQTT application programs must not use the internal class.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="MqttToken--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MqttToken</h4>
<pre>public&nbsp;MqttToken()</pre>
</li>
</ul>
<a name="MqttToken-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>MqttToken</h4>
<pre>public&nbsp;MqttToken(java.lang.String&nbsp;logContext)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getException--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getException</h4>
<pre>public&nbsp;<a href="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</a>&nbsp;getException()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getException--">IMqttToken</a></code></span></div>
<div class="block">Returns an exception providing more detail if an operation failed.
<p>While an action in in progress and when an action completes successfully
null will be returned. Certain errors like timeout or shutting down will not
set the exception as the action has not failed or completed at that time
</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getException--">getException</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>exception may return an exception if the operation failed. Null will be
returned while action is in progress and if action completes successfully.</dd>
</dl>
</li>
</ul>
<a name="isComplete--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isComplete</h4>
<pre>public&nbsp;boolean&nbsp;isComplete()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#isComplete--">IMqttToken</a></code></span></div>
<div class="block">Returns whether or not the action has finished.
<p>True will be returned both in the case where the action finished successfully
and in the case where it failed. If the action failed <a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getException--"><code>IMqttToken.getException()</code></a> will
be non null.
</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#isComplete--">isComplete</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
</dl>
</li>
</ul>
<a name="setActionCallback-org.eclipse.paho.client.mqttv3.IMqttActionListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setActionCallback</h4>
<pre>public&nbsp;void&nbsp;setActionCallback(<a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttActionListener.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttActionListener</a>&nbsp;listener)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#setActionCallback-org.eclipse.paho.client.mqttv3.IMqttActionListener-">IMqttToken</a></code></span></div>
<div class="block">Register a listener to be notified when an action completes.
<p>Once a listener is registered it will be invoked when the action the token
is associated with either succeeds or fails.
</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#setActionCallback-org.eclipse.paho.client.mqttv3.IMqttActionListener-">setActionCallback</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - to be invoked once the action completes</dd>
</dl>
</li>
</ul>
<a name="getActionCallback--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getActionCallback</h4>
<pre>public&nbsp;<a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttActionListener.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttActionListener</a>&nbsp;getActionCallback()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getActionCallback--">IMqttToken</a></code></span></div>
<div class="block">Return the async listener for this token.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getActionCallback--">getActionCallback</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>listener that is set on the token or null if a listener is not registered.</dd>
</dl>
</li>
</ul>
<a name="waitForCompletion--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForCompletion</h4>
<pre>public&nbsp;void&nbsp;waitForCompletion()
throws <a href="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#waitForCompletion--">IMqttToken</a></code></span></div>
<div class="block">Blocks the current thread until the action this token is associated with has
completed.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#waitForCompletion--">waitForCompletion</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<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 a problem with the action associated with the token.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#waitForCompletion-long-"><code>IMqttToken.waitForCompletion(long)</code></a></dd>
</dl>
</li>
</ul>
<a name="waitForCompletion-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForCompletion</h4>
<pre>public&nbsp;void&nbsp;waitForCompletion(long&nbsp;timeout)
throws <a href="../../../../../org/eclipse/paho/client/mqttv3/MqttException.html" title="class in org.eclipse.paho.client.mqttv3">MqttException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#waitForCompletion-long-">IMqttToken</a></code></span></div>
<div class="block">Blocks the current thread until the action this token is associated with has
completed.
<p>The timeout specifies the maximum time it will block for. If the action
completes before the timeout then control returns immediately, if not
it will block until the timeout expires. </p>
<p>If the action being tracked fails or the timeout expires an exception will
be thrown. In the event of a timeout the action may complete after timeout.
</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#waitForCompletion-long-">waitForCompletion</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>timeout</code> - the maximum amount of time to wait for, in milliseconds.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<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 a problem with the action associated with the token.</dd>
</dl>
</li>
</ul>
<a name="getClient--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getClient</h4>
<pre>public&nbsp;<a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttAsyncClient.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttAsyncClient</a>&nbsp;getClient()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getClient--">IMqttToken</a></code></span></div>
<div class="block">Returns the MQTT client that is responsible for processing the asynchronous
action</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getClient--">getClient</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
</dl>
</li>
</ul>
<a name="getTopics--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTopics</h4>
<pre>public&nbsp;java.lang.String[]&nbsp;getTopics()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getTopics--">IMqttToken</a></code></span></div>
<div class="block">Returns the topic string(s) for the action being tracked by this
token. If the action has not been initiated or the action has not
topic associated with it such as connect then null will be returned.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getTopics--">getTopics</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the topic string(s) for the subscribe being tracked by this token or null</dd>
</dl>
</li>
</ul>
<a name="getUserContext--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserContext</h4>
<pre>public&nbsp;java.lang.Object&nbsp;getUserContext()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getUserContext--">IMqttToken</a></code></span></div>
<div class="block">Retrieve the context associated with an action.
<p>Allows the ActionListener associated with an action to retrieve any context
that was associated with the action when the action was invoked. If not
context was provided null is returned. </p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getUserContext--">getUserContext</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Object context associated with an action or null if there is none.</dd>
</dl>
</li>
</ul>
<a name="setUserContext-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setUserContext</h4>
<pre>public&nbsp;void&nbsp;setUserContext(java.lang.Object&nbsp;userContext)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#setUserContext-java.lang.Object-">IMqttToken</a></code></span></div>
<div class="block">Store some context associated with an action.
<p>Allows the caller of an action to store some context that can be
accessed from within the ActionListener associated with the action. This
can be useful when the same ActionListener is associated with multiple
actions</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#setUserContext-java.lang.Object-">setUserContext</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>userContext</code> - to associate with an action</dd>
</dl>
</li>
</ul>
<a name="getMessageId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessageId</h4>
<pre>public&nbsp;int&nbsp;getMessageId()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getMessageId--">IMqttToken</a></code></span></div>
<div class="block">Returns the message ID of the message that is associated with the token.
A message id of zero will be returned for tokens associated with
connect, disconnect and ping operations as there can only ever
be one of these outstanding at a time. For other operations
the MQTT message id flowed over the network.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getMessageId--">getMessageId</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
</dl>
</li>
</ul>
<a name="getGrantedQos--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGrantedQos</h4>
<pre>public&nbsp;int[]&nbsp;getGrantedQos()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getGrantedQos--">IMqttToken</a></code></span></div>
<div class="block">Returns the granted QoS list from a suback</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getGrantedQos--">getGrantedQos</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
</dl>
</li>
</ul>
<a name="getSessionPresent--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSessionPresent</h4>
<pre>public&nbsp;boolean&nbsp;getSessionPresent()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getSessionPresent--">IMqttToken</a></code></span></div>
<div class="block">Returns the session present flag from a connack</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getSessionPresent--">getSessionPresent</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
</dl>
</li>
</ul>
<a name="getResponse--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getResponse</h4>
<pre>public&nbsp;<a href="../../../../../org/eclipse/paho/client/mqttv3/internal/wire/MqttWireMessage.html" title="class in org.eclipse.paho.client.mqttv3.internal.wire">MqttWireMessage</a>&nbsp;getResponse()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getResponse--">IMqttToken</a></code></span></div>
<div class="block">Returns the response wire message</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html#getResponse--">getResponse</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/eclipse/paho/client/mqttv3/IMqttToken.html" title="interface in org.eclipse.paho.client.mqttv3">IMqttToken</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/MqttToken.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttSecurityException.html" title="class in org.eclipse.paho.client.mqttv3"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/eclipse/paho/client/mqttv3/MqttTopic.html" title="class in org.eclipse.paho.client.mqttv3"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/eclipse/paho/client/mqttv3/MqttToken.html" target="_top">Frames</a></li>
<li><a href="MqttToken.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>