public class MQTTVirtualTopicSubscriptionStrategy extends AbstractMQTTSubscriptionStrategy
brokerService, consumerIdGenerator, mqttSubscriptionByTopic, protocol, restoredDurableSubs, subscriptionsByConsumerId
Constructor and Description |
---|
MQTTVirtualTopicSubscriptionStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
isControlTopic(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(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.
|
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, setProtocolConverter
public MQTTVirtualTopicSubscriptionStrategy()
public void onConnect(org.fusesource.mqtt.codec.CONNECT connect) throws MQTTProtocolException
MQTTSubscriptionStrategy
MQTTProtocolException
- if an error occurs while processing the connect actions.public byte onSubscribe(String topicName, org.fusesource.mqtt.client.QoS requestedQoS) throws MQTTProtocolException
MQTTSubscriptionStrategy
topicName
- 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
MQTTSubscriptionStrategy
onReSubscribe
in interface MQTTSubscriptionStrategy
onReSubscribe
in class AbstractMQTTSubscriptionStrategy
mqttSubscription
- the MQTTSubscription that contains the subscription state.MQTTProtocolException
public void onUnSubscribe(String topicName) throws MQTTProtocolException
MQTTSubscriptionStrategy
topicName
- the name of the Topic the client wishes to unsubscribe from.MQTTProtocolException
- if an error occurs during the un-subscribe processing.public ActiveMQDestination onSend(String topicName)
MQTTSubscriptionStrategy
onSend
in interface MQTTSubscriptionStrategy
onSend
in class AbstractMQTTSubscriptionStrategy
topicName
- the targeted Topic that the client sent the message to.public String onSend(ActiveMQDestination destination)
MQTTSubscriptionStrategy
onSend
in interface MQTTSubscriptionStrategy
onSend
in class AbstractMQTTSubscriptionStrategy
destination
- the destination that the message was dispatched frompublic boolean isControlTopic(ActiveMQDestination destination)
MQTTSubscriptionStrategy
isControlTopic
in interface MQTTSubscriptionStrategy
isControlTopic
in class AbstractMQTTSubscriptionStrategy
destination
- the destination to query.Copyright © 2005–2017. All rights reserved.