|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.paho.client.mqttv3.MqttTopic
Represents a topic destination, used for publish/subscribe messaging.
Method Summary | |
---|---|
java.lang.String |
getName()
Returns the name of the queue or topic. |
MqttDeliveryToken |
publish(byte[] payload,
int qos,
boolean retained)
Publishes a message on the topic. |
MqttDeliveryToken |
publish(MqttMessage message)
Publishes the specified message to this topic, but doesn't wait for a response. |
java.lang.String |
toString()
Returns a string representation of this topic. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public MqttDeliveryToken publish(byte[] payload, int qos, boolean retained) throws MqttException, MqttPersistenceException
MqttMessage
object with a byte array payload and the
specified QoS, and then publish it. All other values in the
message will be set to the defaults.
payload
- the byte array to use as the payloadqos
- the Quality of Service. Valid values are 0, 1 or 2.retained
- whether or not this message should be retained by the server.
java.lang.IllegalArgumentException
- if value of QoS is not 0, 1 or 2.
MqttException
MqttPersistenceException
publish(MqttMessage)
,
MqttMessage.setQos(int)
,
MqttMessage.setRetained(boolean)
public MqttDeliveryToken publish(MqttMessage message) throws MqttException, MqttPersistenceException
token
can be used
to track the delivery status of the message. Once this message has
returned cleanly, the message has been accepted for publication by the
client - as long as a connection is available, it will try and deliver it.
message
- the message to publish
MqttException
MqttPersistenceException
public java.lang.String getName()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |