Class MQTTDefaultSubscriptionStrategy

    • Constructor Detail

      • MQTTDefaultSubscriptionStrategy

        public MQTTDefaultSubscriptionStrategy()
    • Method Detail

      • onConnect

        public void onConnect​(org.fusesource.mqtt.codec.CONNECT connect)
                       throws MQTTProtocolException
        Description copied from interface: MQTTSubscriptionStrategy
        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.
        Throws:
        MQTTProtocolException - if an error occurs while processing the connect actions.
      • onSubscribe

        public byte onSubscribe​(String topicName,
                                org.fusesource.mqtt.client.QoS requestedQoS)
                         throws MQTTProtocolException
        Description copied from interface: MQTTSubscriptionStrategy
        Called when a new Subscription is being requested. This method allows the strategy to create a specific type of subscription for the client such as mapping topic subscriptions to Queues etc.
        Parameters:
        topicName - the requested Topic name to subscribe to.
        requestedQoS - the QoS level that the client has requested for this subscription.
        Returns:
        the assigned QoS value given to the new subscription
        Throws:
        MQTTProtocolException - if an error occurs while processing the subscribe actions.
      • onUnSubscribe

        public void onUnSubscribe​(String topicName)
                           throws MQTTProtocolException
        Description copied from interface: MQTTSubscriptionStrategy
        Called when a client requests an un-subscribe a previous subscription.
        Parameters:
        topicName - the name of the Topic the client wishes to unsubscribe from.
        Throws:
        MQTTProtocolException - if an error occurs during the un-subscribe processing.