public class MQTTVirtualTopicSubscriptionStrategy extends AbstractMQTTSubscriptionStrategy
brokerService, consumerIdGenerator, mqttSubscriptionByTopic, protocol, restoredDurableSubs, subscriptionsByConsumerId| Constructor and Description |
|---|
MQTTVirtualTopicSubscriptionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isControlTopic(org.apache.activemq.command.ActiveMQDestination destination)
Allows the protocol handler to interrogate an destination name to determine if it
is equivalent to the MQTT control topic (starts with $).
|
void |
onConnect(org.fusesource.mqtt.codec.CONNECT connect)
Allows the strategy to perform any needed actions on client connect
prior to the CONNACK frame being sent back such as recovering old
subscriptions and performing any clean session actions.
|
void |
onReSubscribe(MQTTSubscription mqttSubscription)
Called when a client sends a duplicate subscribe request which should
force any retained messages on that topic to be replayed again as though
the client had just subscribed for the first time.
|
String |
onSend(org.apache.activemq.command.ActiveMQDestination destination)
Intercepts send operations from the broker and allows the strategy to map the
target topic name so that the client sees a valid Topic name.
|
org.apache.activemq.command.ActiveMQDestination |
onSend(String topicName)
Intercepts PUBLISH operations from the client and allows the strategy to map the
target destination so that the send operation will land in the destinations that
this strategy has mapped the incoming subscribe requests to.
|
byte |
onSubscribe(String topicName,
org.fusesource.mqtt.client.QoS requestedQoS)
Called when a new Subscription is being requested.
|
void |
onUnSubscribe(String topicName)
Called when a client requests an un-subscribe a previous subscription.
|
deleteDurableSubs, doSubscribe, doUnSubscribe, getNextConsumerId, getProtocolConverter, getSubscription, initialize, lookupSubscription, onSubscribe, restoreDurableSubs, setBrokerService, setProtocolConverterpublic MQTTVirtualTopicSubscriptionStrategy()
public void onConnect(org.fusesource.mqtt.codec.CONNECT connect) throws MQTTProtocolException
MQTTSubscriptionStrategyMQTTProtocolException - if an error occurs while processing the connect actions.public byte onSubscribe(String topicName, org.fusesource.mqtt.client.QoS requestedQoS) throws MQTTProtocolException
MQTTSubscriptionStrategytopicName - the requested Topic name to subscribe to.requestedQoS - the QoS level that the client has requested for this subscription.MQTTProtocolException - if an error occurs while processing the subscribe actions.public void onReSubscribe(MQTTSubscription mqttSubscription) throws MQTTProtocolException
MQTTSubscriptionStrategyonReSubscribe in interface MQTTSubscriptionStrategyonReSubscribe in class AbstractMQTTSubscriptionStrategymqttSubscription - the MQTTSubscription that contains the subscription state.MQTTProtocolExceptionpublic void onUnSubscribe(String topicName) throws MQTTProtocolException
MQTTSubscriptionStrategytopicName - the name of the Topic the client wishes to unsubscribe from.MQTTProtocolException - if an error occurs during the un-subscribe processing.public org.apache.activemq.command.ActiveMQDestination onSend(String topicName)
MQTTSubscriptionStrategyonSend in interface MQTTSubscriptionStrategyonSend in class AbstractMQTTSubscriptionStrategytopicName - the targeted Topic that the client sent the message to.public String onSend(org.apache.activemq.command.ActiveMQDestination destination)
MQTTSubscriptionStrategyonSend in interface MQTTSubscriptionStrategyonSend in class AbstractMQTTSubscriptionStrategydestination - the destination that the message was dispatched frompublic boolean isControlTopic(org.apache.activemq.command.ActiveMQDestination destination)
MQTTSubscriptionStrategyisControlTopic in interface MQTTSubscriptionStrategyisControlTopic in class AbstractMQTTSubscriptionStrategydestination - the destination to query.Copyright © 2005–2017 The Apache Software Foundation. All rights reserved.