Package io.moquette.interception
Class BrokerInterceptor
- java.lang.Object
-
- io.moquette.interception.BrokerInterceptor
-
- All Implemented Interfaces:
Interceptor
public final class BrokerInterceptor extends Object implements Interceptor
An interceptor that execute the interception tasks asynchronously.
-
-
Constructor Summary
Constructors Constructor Description BrokerInterceptor(IConfig props, List<InterceptHandler> handlers)Configures a broker interceptor using the pool size specified in the IConfig argument.BrokerInterceptor(List<InterceptHandler> handlers)Configures a broker interceptor, with a thread pool of one thread.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInterceptHandler(InterceptHandler interceptHandler)voidnotifyClientConnected(io.netty.handler.codec.mqtt.MqttConnectMessage msg)voidnotifyClientConnectionLost(String clientID, String username)voidnotifyClientDisconnected(String clientID, String username)voidnotifyMessageAcknowledged(InterceptAcknowledgedMessage msg)voidnotifyTopicPublished(io.netty.handler.codec.mqtt.MqttPublishMessage msg, String clientID, String username)voidnotifyTopicSubscribed(Subscription sub, String username)voidnotifyTopicUnsubscribed(String topic, String clientID, String username)voidremoveInterceptHandler(InterceptHandler interceptHandler)voidstop()Shutdown graciously the executor service
-
-
-
Constructor Detail
-
BrokerInterceptor
public BrokerInterceptor(List<InterceptHandler> handlers)
Configures a broker interceptor, with a thread pool of one thread.- Parameters:
handlers- InterceptHandlers listeners.
-
BrokerInterceptor
public BrokerInterceptor(IConfig props, List<InterceptHandler> handlers)
Configures a broker interceptor using the pool size specified in the IConfig argument.- Parameters:
props- configuration properties.handlers- InterceptHandlers listeners.
-
-
Method Detail
-
stop
public void stop()
Shutdown graciously the executor service
-
notifyClientConnected
public void notifyClientConnected(io.netty.handler.codec.mqtt.MqttConnectMessage msg)
- Specified by:
notifyClientConnectedin interfaceInterceptor
-
notifyClientDisconnected
public void notifyClientDisconnected(String clientID, String username)
- Specified by:
notifyClientDisconnectedin interfaceInterceptor
-
notifyClientConnectionLost
public void notifyClientConnectionLost(String clientID, String username)
- Specified by:
notifyClientConnectionLostin interfaceInterceptor
-
notifyTopicPublished
public void notifyTopicPublished(io.netty.handler.codec.mqtt.MqttPublishMessage msg, String clientID, String username)- Specified by:
notifyTopicPublishedin interfaceInterceptor
-
notifyTopicSubscribed
public void notifyTopicSubscribed(Subscription sub, String username)
- Specified by:
notifyTopicSubscribedin interfaceInterceptor
-
notifyTopicUnsubscribed
public void notifyTopicUnsubscribed(String topic, String clientID, String username)
- Specified by:
notifyTopicUnsubscribedin interfaceInterceptor
-
notifyMessageAcknowledged
public void notifyMessageAcknowledged(InterceptAcknowledgedMessage msg)
- Specified by:
notifyMessageAcknowledgedin interfaceInterceptor
-
addInterceptHandler
public void addInterceptHandler(InterceptHandler interceptHandler)
- Specified by:
addInterceptHandlerin interfaceInterceptor
-
removeInterceptHandler
public void removeInterceptHandler(InterceptHandler interceptHandler)
- Specified by:
removeInterceptHandlerin interfaceInterceptor
-
-