Class MqttIntroductionAdvice

java.lang.Object
io.micronaut.mqtt.intercept.AbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,org.eclipse.paho.mqttv5.common.MqttMessage>
io.micronaut.mqtt.v5.intercept.MqttIntroductionAdvice
All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,Object>, io.micronaut.aop.MethodInterceptor<Object,Object>, io.micronaut.core.order.Ordered

@Singleton @InterceptorBean(MqttPublisher.class) public class MqttIntroductionAdvice extends AbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,org.eclipse.paho.mqttv5.common.MqttMessage>
The MQTT v5 implementation of AbstractMqttIntroductionAdvice.
Since:
1.0.0
Author:
James Kleeh
  • Constructor Details

    • MqttIntroductionAdvice

      public MqttIntroductionAdvice(org.eclipse.paho.mqttv5.client.MqttAsyncClient mqttAsyncClient, MqttBinderRegistry binderRegistry)
  • Method Details

    • publish

      public Object publish(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message, org.eclipse.paho.mqttv5.client.MqttActionListener listener)
      Description copied from class: AbstractMqttIntroductionAdvice
      Publishes the message.
      Specified by:
      publish in class AbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,org.eclipse.paho.mqttv5.common.MqttMessage>
      Parameters:
      topic - The topic to publish the message to
      message - The message to publish
      listener - The publish action listener
      Returns:
      The result of the publish method
    • createBindingContext

      public MqttBindingContext<org.eclipse.paho.mqttv5.common.MqttMessage> createBindingContext(io.micronaut.aop.MethodInvocationContext<Object,Object> context)
      Specified by:
      createBindingContext in class AbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,org.eclipse.paho.mqttv5.common.MqttMessage>
      Parameters:
      context - The method context
      Returns:
      The binding context to bind data used in publishing
    • createListener

      public org.eclipse.paho.mqttv5.client.MqttActionListener createListener(Runnable onSuccess, Consumer<Throwable> onError)
      Description copied from class: AbstractMqttIntroductionAdvice
      Create a listener.
      Specified by:
      createListener in class AbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,org.eclipse.paho.mqttv5.common.MqttMessage>
      Parameters:
      onSuccess - The code to call when a message is sent successfully
      onError - The consumer to call in the case of an exception
      Returns:
      A publish action listener
    • getRequiredAnnotation

      public Class<? extends Annotation> getRequiredAnnotation()
      Specified by:
      getRequiredAnnotation in class AbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,org.eclipse.paho.mqttv5.common.MqttMessage>
      Returns:
      The implement specific client annotation class