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, setProtocolConverterpublic MQTTDefaultSubscriptionStrategy()
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.Copyright © 2005–2017 The Apache Software Foundation. All rights reserved.