Class MQTTWireFormat
- java.lang.Object
-
- org.apache.activemq.transport.mqtt.MQTTWireFormat
-
- All Implemented Interfaces:
WireFormat
public class MQTTWireFormat extends Object implements WireFormat
Implements marshalling and unmarsalling the MQTT protocol.
-
-
Constructor Summary
Constructors Constructor Description MQTTWireFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetConnectAttemptTimeout()intgetMaxFrameSize()intgetVersion()ByteSequencemarshal(Object command)Packet based marshalingvoidmarshal(Object command, DataOutput dataOut)Stream based marshalingvoidsetConnectAttemptTimeout(long connectTimeout)Sets the timeout value used to fail a connection if no CONNECT frame is read in the given interval.voidsetMaxFrameSize(int maxFrameSize)Sets the maximum frame size for an incoming MQTT frame.voidsetVersion(int version)Objectunmarshal(DataInput dataIn)Packet based un-marshalingObjectunmarshal(ByteSequence packet)Packet based un-marshaling
-
-
-
Method Detail
-
marshal
public ByteSequence marshal(Object command) throws IOException
Description copied from interface:WireFormatPacket based marshaling- Specified by:
marshalin interfaceWireFormat- Throws:
IOException
-
unmarshal
public Object unmarshal(ByteSequence packet) throws IOException
Description copied from interface:WireFormatPacket based un-marshaling- Specified by:
unmarshalin interfaceWireFormat- Throws:
IOException
-
marshal
public void marshal(Object command, DataOutput dataOut) throws IOException
Description copied from interface:WireFormatStream based marshaling- Specified by:
marshalin interfaceWireFormat- Throws:
IOException
-
unmarshal
public Object unmarshal(DataInput dataIn) throws IOException
Description copied from interface:WireFormatPacket based un-marshaling- Specified by:
unmarshalin interfaceWireFormat- Throws:
IOException
-
setVersion
public void setVersion(int version)
- Specified by:
setVersionin interfaceWireFormat- Parameters:
version- the version of the wire format
-
getVersion
public int getVersion()
- Specified by:
getVersionin interfaceWireFormat- Returns:
- the version of the wire format
-
getMaxFrameSize
public int getMaxFrameSize()
- Returns:
- the maximum number of bytes a single MQTT message frame is allowed to be.
-
setMaxFrameSize
public void setMaxFrameSize(int maxFrameSize)
Sets the maximum frame size for an incoming MQTT frame. The protocl limit is 256 megabytes and this value cannot be set higher.- Parameters:
maxFrameSize- the maximum allowed frame size for a single MQTT frame.
-
getConnectAttemptTimeout
public long getConnectAttemptTimeout()
- Returns:
- the timeout value used to fail a connection if no CONNECT frame read.
-
setConnectAttemptTimeout
public void setConnectAttemptTimeout(long connectTimeout)
Sets the timeout value used to fail a connection if no CONNECT frame is read in the given interval.- Parameters:
connectTimeout- the connection frame received timeout value.
-
-