Package io.micronaut.mqtt.v5.intercept
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
-
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.mqttv5.client.MqttAsyncClient mqttAsyncClient, MqttBinderRegistry binderRegistry) -
Method Summary
Modifier and TypeMethodDescriptionMqttBindingContext<org.eclipse.paho.mqttv5.common.MqttMessage>
createBindingContext
(io.micronaut.aop.MethodInvocationContext<Object, Object> context) org.eclipse.paho.mqttv5.client.MqttActionListener
createListener
(Runnable onSuccess, Consumer<Throwable> onError) Create a listener.Class<? extends Annotation>
publish
(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message, org.eclipse.paho.mqttv5.client.MqttActionListener 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.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 classAbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,
org.eclipse.paho.mqttv5.common.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
-
createBindingContext
public MqttBindingContext<org.eclipse.paho.mqttv5.common.MqttMessage> createBindingContext(io.micronaut.aop.MethodInvocationContext<Object, Object> context) - Specified by:
createBindingContext
in classAbstractMqttIntroductionAdvice<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 classAbstractMqttIntroductionAdvice<org.eclipse.paho.mqttv5.client.MqttActionListener,
org.eclipse.paho.mqttv5.common.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.mqttv5.client.MqttActionListener,
org.eclipse.paho.mqttv5.common.MqttMessage> - Returns:
- The implement specific client annotation class
-