Class Mqtt3IntroductionAdvice
java.lang.Object
io.micronaut.mqtt.intercept.AbstractMqttIntroductionAdvice<BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,Throwable>,MqttMessage>
io.micronaut.mqtt.hivemq.v3.intercept.Mqtt3IntroductionAdvice
- All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,
,Object> io.micronaut.aop.MethodInterceptor<Object,
,Object> io.micronaut.core.order.Ordered
@Singleton
@InterceptorBean(MqttPublisher.class)
@Requires(property="mqtt.client.mqtt-version",
value="3")
public class Mqtt3IntroductionAdvice
extends AbstractMqttIntroductionAdvice<BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,Throwable>,MqttMessage>
The MQTT v3 implementation of
AbstractMqttIntroductionAdvice
.- Since:
- 3.0.0
- Author:
- Sven Kobow
-
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
ConstructorDescriptionMqtt3IntroductionAdvice
(com.hivemq.client.mqtt.mqtt3.Mqtt3AsyncClient mqtt3AsyncClient, MqttBinderRegistry binderRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncreateBindingContext
(io.micronaut.aop.MethodInvocationContext<Object, Object> context) BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,
Throwable> createListener
(Runnable onSuccess, Consumer<Throwable> onError) Create a listener.Class<? extends Annotation>
publish
(String topic, MqttMessage message, BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish, Throwable> 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
-
Mqtt3IntroductionAdvice
public Mqtt3IntroductionAdvice(com.hivemq.client.mqtt.mqtt3.Mqtt3AsyncClient mqtt3AsyncClient, MqttBinderRegistry binderRegistry)
-
-
Method Details
-
createBindingContext
public MqttBindingContext<MqttMessage> createBindingContext(io.micronaut.aop.MethodInvocationContext<Object, Object> context) - Specified by:
createBindingContext
in classAbstractMqttIntroductionAdvice<BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,
Throwable>, MqttMessage> - Parameters:
context
- The method context- Returns:
- The binding context to bind data used in publishing
-
publish
public Object publish(String topic, MqttMessage message, BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish, Throwable> listener) Description copied from class:AbstractMqttIntroductionAdvice
Publishes the message.- Specified by:
publish
in classAbstractMqttIntroductionAdvice<BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,
Throwable>, 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 BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,Throwable> createListener(Runnable onSuccess, Consumer<Throwable> onError) Description copied from class:AbstractMqttIntroductionAdvice
Create a listener.- Specified by:
createListener
in classAbstractMqttIntroductionAdvice<BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,
Throwable>, 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<BiConsumer<com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish,
Throwable>, MqttMessage> - Returns:
- The implement specific client annotation class
-