public class MQTTProtocolConverter extends Object
Modifier and Type | Field and Description |
---|---|
static String |
MULTI_LEVEL_WILDCARD |
static String |
QOS_PROPERTY_NAME |
static String |
SINGLE_LEVEL_WILDCARD |
static int |
V3_1 |
static int |
V3_1_1 |
int |
version |
Constructor and Description |
---|
MQTTProtocolConverter(MQTTTransport mqttTransport,
BrokerService brokerService) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
containsMqttWildcard(String value) |
org.fusesource.mqtt.codec.PUBLISH |
convertMessage(ActiveMQMessage message) |
protected MQTTSubscriptionStrategy |
findSubscriptionStrategy() |
int |
getActiveMQSubscriptionPrefetch() |
String |
getClientId() |
ConnectionId |
getConnectionId() |
long |
getDefaultKeepAlive() |
MQTTTransport |
getMQTTTransport() |
MQTTPacketIdGenerator |
getPacketIdGenerator() |
boolean |
getPublishDollarTopics() |
SessionId |
getSessionId() |
String |
getSubscriptionStrategy() |
boolean |
isCleanSession() |
void |
onActiveMQCommand(Command command)
Dispatch an ActiveMQ command
|
void |
onMQTTCommand(org.fusesource.mqtt.codec.MQTTFrame frame)
Convert a MQTT command
|
void |
onTransportError() |
void |
onUnSubscribe(org.fusesource.mqtt.codec.UNSUBSCRIBE command) |
void |
sendToActiveMQ(Command command,
ResponseHandler handler) |
void |
setActiveMQSubscriptionPrefetch(int activeMQSubscriptionPrefetch)
set the default prefetch size when mapping the MQTT subscription to an ActiveMQ one
The default = 1
|
void |
setDefaultKeepAlive(long keepAlive)
Set the default keep alive time (in milliseconds) that would be used if configured on server side
and the client sends a keep-alive value of 0 (zero) on a CONNECT frame
|
void |
setPublishDollarTopics(boolean publishDollarTopics) |
void |
setSubscriptionStrategy(String name) |
public static final String QOS_PROPERTY_NAME
public static final int V3_1
public static final int V3_1_1
public static final String SINGLE_LEVEL_WILDCARD
public static final String MULTI_LEVEL_WILDCARD
public int version
public MQTTProtocolConverter(MQTTTransport mqttTransport, BrokerService brokerService)
public void sendToActiveMQ(Command command, ResponseHandler handler)
public void onMQTTCommand(org.fusesource.mqtt.codec.MQTTFrame frame) throws IOException, javax.jms.JMSException
IOException
javax.jms.JMSException
public void onUnSubscribe(org.fusesource.mqtt.codec.UNSUBSCRIBE command) throws MQTTProtocolException
MQTTProtocolException
public void onActiveMQCommand(Command command) throws Exception
Exception
public org.fusesource.mqtt.codec.PUBLISH convertMessage(ActiveMQMessage message) throws IOException, javax.jms.JMSException, DataFormatException
IOException
javax.jms.JMSException
DataFormatException
public MQTTTransport getMQTTTransport()
public void onTransportError()
public long getDefaultKeepAlive()
public void setDefaultKeepAlive(long keepAlive)
keepAlive
- the keepAlive in millisecondspublic int getActiveMQSubscriptionPrefetch()
public void setActiveMQSubscriptionPrefetch(int activeMQSubscriptionPrefetch)
activeMQSubscriptionPrefetch
- set the prefetch for the corresponding ActiveMQ subscriptionpublic MQTTPacketIdGenerator getPacketIdGenerator()
public void setPublishDollarTopics(boolean publishDollarTopics)
public boolean getPublishDollarTopics()
public ConnectionId getConnectionId()
public SessionId getSessionId()
public boolean isCleanSession()
public String getSubscriptionStrategy()
public void setSubscriptionStrategy(String name)
public String getClientId()
protected boolean containsMqttWildcard(String value)
protected MQTTSubscriptionStrategy findSubscriptionStrategy() throws IOException
IOException
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.