public class MQTTDefaultSubscriptionStrategy extends AbstractMQTTSubscriptionStrategy
brokerService, consumerIdGenerator, mqttSubscriptionByTopic, protocol, restoredDurableSubs, subscriptionsByConsumerId
Constructor and Description |
---|
MQTTDefaultSubscriptionStrategy() |
Modifier and Type | Method and Description |
---|---|
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.
|
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, isControlTopic, lookupSubscription, onSend, onSend, onSubscribe, restoreDurableSubs, setBrokerService, setProtocolConverter
public MQTTDefaultSubscriptionStrategy()
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.Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.