Package io.micronaut.mqtt.v3.intercept
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_TARGET
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionMqttIntroductionAdvice
(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.IMqttActionListener
createListener
(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 io.micronaut.mqtt.intercept.AbstractMqttIntroductionAdvice
intercept
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.aop.MethodInterceptor
intercept
Methods 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:
createBindingContext
in 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:AbstractMqttIntroductionAdvice
Publishes the message.- Specified by:
publish
in 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:AbstractMqttIntroductionAdvice
Create a listener.- Specified by:
createListener
in 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:
getRequiredAnnotation
in classAbstractMqttIntroductionAdvice<org.eclipse.paho.client.mqttv3.IMqttActionListener,
org.eclipse.paho.client.mqttv3.MqttMessage> - Returns:
- The implement specific client annotation class
-