Class MqttIntroductionAdvice
java.lang.Object
io.micronaut.mqtt.intercept.AbstractMqttIntroductionAdvice<org.eclipse.paho.client.mqttv3.IMqttActionListener, org.eclipse.paho.client.mqttv3.MqttMessage>
io.micronaut.mqtt.v3.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.client.mqttv3.IMqttActionListener, org.eclipse.paho.client.mqttv3.MqttMessage>
The MQTT v3 implementation of
AbstractMqttIntroductionAdvice.- Since:
- 1.0.0
- Author:
- James Kleeh
-
Field Summary
Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGETFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionMqttIntroductionAdvice(org.eclipse.paho.client.mqttv3.MqttAsyncClient mqttAsyncClient, MqttBinderRegistry binderRegistry) -
Method Summary
Modifier and TypeMethodDescriptionMqttBindingContext<org.eclipse.paho.client.mqttv3.MqttMessage> createBindingContext(io.micronaut.aop.MethodInvocationContext<Object, Object> context) org.eclipse.paho.client.mqttv3.IMqttActionListenercreateListener(Runnable onSuccess, Consumer<Throwable> onError) Create a listener.Class<? extends Annotation> publish(String topic, org.eclipse.paho.client.mqttv3.MqttMessage message, org.eclipse.paho.client.mqttv3.IMqttActionListener listener) Publishes the message.Methods inherited from class AbstractMqttIntroductionAdvice
interceptMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.aop.MethodInterceptor
interceptMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
MqttIntroductionAdvice
public MqttIntroductionAdvice(org.eclipse.paho.client.mqttv3.MqttAsyncClient mqttAsyncClient, MqttBinderRegistry binderRegistry)
-
-
Method Details
-
createBindingContext
public MqttBindingContext<org.eclipse.paho.client.mqttv3.MqttMessage> createBindingContext(io.micronaut.aop.MethodInvocationContext<Object, Object> context) - Specified by:
createBindingContextin classAbstractMqttIntroductionAdvice<org.eclipse.paho.client.mqttv3.IMqttActionListener, org.eclipse.paho.client.mqttv3.MqttMessage>- Parameters:
context- The method context- Returns:
- The binding context to bind data used in publishing
-
publish
public Object publish(String topic, org.eclipse.paho.client.mqttv3.MqttMessage message, org.eclipse.paho.client.mqttv3.IMqttActionListener listener) Description copied from class:AbstractMqttIntroductionAdvicePublishes the message.- Specified by:
publishin classAbstractMqttIntroductionAdvice<org.eclipse.paho.client.mqttv3.IMqttActionListener, org.eclipse.paho.client.mqttv3.MqttMessage>- Parameters:
topic- The topic to publish the message tomessage- The message to publishlistener- The publish action listener- Returns:
- The result of the publish method
-
createListener
public org.eclipse.paho.client.mqttv3.IMqttActionListener createListener(Runnable onSuccess, Consumer<Throwable> onError) Description copied from class:AbstractMqttIntroductionAdviceCreate a listener.- Specified by:
createListenerin classAbstractMqttIntroductionAdvice<org.eclipse.paho.client.mqttv3.IMqttActionListener, org.eclipse.paho.client.mqttv3.MqttMessage>- Parameters:
onSuccess- The code to call when a message is sent successfullyonError- The consumer to call in the case of an exception- Returns:
- A publish action listener
-
getRequiredAnnotation
- Specified by:
getRequiredAnnotationin classAbstractMqttIntroductionAdvice<org.eclipse.paho.client.mqttv3.IMqttActionListener, org.eclipse.paho.client.mqttv3.MqttMessage>- Returns:
- The implement specific client annotation class
-