net.sf.xenqtt.client
Class Subscription

java.lang.Object
  extended by net.sf.xenqtt.client.Subscription

public final class Subscription
extends Object

An MQTT topic subscription


Constructor Summary
Subscription(String topic, QoS qos)
           
 
Method Summary
 boolean equals(Object obj)
           
 QoS getQos()
           
 String getTopic()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Subscription

public Subscription(String topic,
                    QoS qos)
Parameters:
topic - The topic being subscribed to. This can include wildcards:
  • '+': Matches a single level in the topic. foo/+ would match foo/bar but not foo/a/b or foo/a/b/c. foo/+/+/c would match foo/a/b/c and foo/d/g/c but not foo/a/c
  • '#': Matches the rest of the topic. Must be the last character in the topic. foo/# would match foo/bar, foo/a/b/c, etc
qos - The QoS for the topic. When a subscription request is sent to the broker this is the requested qos. When the subscription acknowledgment is received from the broker this is the granted qos.
Method Detail

getTopic

public String getTopic()
Returns:
The topic being subscribed to. This can include wildcards:
  • '+': Matches a single level in the topic. foo/+ would match foo/bar but not foo/a/b or foo/a/b/c. foo/+/+/c would match foo/a/b/c and foo/d/g/c but not foo/a/c
  • '#': Matches the rest of the topic. Must be the last character in the topic. foo/# would match foo/bar, foo/a/b/c, etc

getQos

public QoS getQos()
Returns:
The QoS for the topic. When a subscription request is sent to the broker this is the requested qos. When the subscription acknowledgment is received from the broker this is the granted qos.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2013. All Rights Reserved.