org.eclipse.paho.client.mqttv3.internal.wire
Class MqttSubscribe

java.lang.Object
  extended by org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage
      extended by org.eclipse.paho.client.mqttv3.internal.wire.MqttSubscribe

public class MqttSubscribe
extends MqttWireMessage

An on-the-wire representation of an MQTT SUBSCRIBE message.


Field Summary
 
Fields inherited from class org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage
duplicate, MESSAGE_TYPE_CONNACK, MESSAGE_TYPE_CONNECT, MESSAGE_TYPE_DISCONNECT, MESSAGE_TYPE_PINGREQ, MESSAGE_TYPE_PINGRESP, MESSAGE_TYPE_PUBACK, MESSAGE_TYPE_PUBCOMP, MESSAGE_TYPE_PUBLISH, MESSAGE_TYPE_PUBREC, MESSAGE_TYPE_PUBREL, MESSAGE_TYPE_SUBACK, MESSAGE_TYPE_SUBSCRIBE, MESSAGE_TYPE_UNSUBACK, MESSAGE_TYPE_UNSUBSCRIBE, msgId, STRING_ENCODING
 
Constructor Summary
MqttSubscribe(byte info, byte[] data)
          Constructor for an on the wire MQTT subscribe message
MqttSubscribe(String[] names, int[] qos)
          Constructor for an on the wire MQTT subscribe message
 
Method Summary
protected  byte getMessageInfo()
          Sub-classes should override this to encode the message info.
 byte[] getPayload()
          Sub-classes should override this method to supply the payload bytes.
protected  byte[] getVariableHeader()
           
 boolean isRetryable()
           
 String toString()
           
 
Methods inherited from class org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage
createWireMessage, createWireMessage, decodeUTF8, encodeMBI, encodeMessageId, encodeUTF8, getHeader, getKey, getMessageId, getType, isMessageIdRequired, readMBI, setDuplicate, setMessageId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MqttSubscribe

public MqttSubscribe(byte info,
                     byte[] data)
              throws IOException
Constructor for an on the wire MQTT subscribe message

Parameters:
info -
data -
Throws:
IOException

MqttSubscribe

public MqttSubscribe(String[] names,
                     int[] qos)
Constructor for an on the wire MQTT subscribe message

Parameters:
names - - one or more topics to subscribe to
qos - - the max QoS that each each topic will be subscribed at
Method Detail

toString

public String toString()
Overrides:
toString in class MqttWireMessage
Returns:
string representation of this subscribe packet

getMessageInfo

protected byte getMessageInfo()
Description copied from class: MqttWireMessage
Sub-classes should override this to encode the message info. Only the least-significant four bits will be used.

Specified by:
getMessageInfo in class MqttWireMessage

getVariableHeader

protected byte[] getVariableHeader()
                            throws MqttException
Specified by:
getVariableHeader in class MqttWireMessage
Throws:
MqttException

getPayload

public byte[] getPayload()
                  throws MqttException
Description copied from class: MqttWireMessage
Sub-classes should override this method to supply the payload bytes.

Overrides:
getPayload in class MqttWireMessage
Throws:
MqttException

isRetryable

public boolean isRetryable()
Overrides:
isRetryable in class MqttWireMessage


Copyright © 2013. All Rights Reserved.