Class MQTTProtocolManager
- java.lang.Object
-
- org.apache.activemq.artemis.spi.core.protocol.AbstractProtocolManager<io.netty.handler.codec.mqtt.MqttMessage,MQTTInterceptor,MQTTConnection,MQTTRoutingHandler>
-
- org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolManager
-
- All Implemented Interfaces:
NotificationListener,ProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
public class MQTTProtocolManager extends AbstractProtocolManager<io.netty.handler.codec.mqtt.MqttMessage,MQTTInterceptor,MQTTConnection,MQTTRoutingHandler> implements NotificationListener
-
-
Method Summary
-
Methods inherited from class org.apache.activemq.artemis.spi.core.protocol.AbstractProtocolManager
getPrefixes, getSecurityDomain, invokeInterceptors, setAnycastPrefix, setMulticastPrefix, setSecurityDomain
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.spi.core.protocol.ProtocolManager
removeHandler
-
-
-
-
Method Detail
-
getDefaultMqttSessionExpiryInterval
public int getDefaultMqttSessionExpiryInterval()
-
setDefaultMqttSessionExpiryInterval
public MQTTProtocolManager setDefaultMqttSessionExpiryInterval(int sessionExpiryInterval)
-
getTopicAliasMaximum
public int getTopicAliasMaximum()
-
setTopicAliasMaximum
public MQTTProtocolManager setTopicAliasMaximum(int topicAliasMaximum)
-
getReceiveMaximum
public int getReceiveMaximum()
-
setReceiveMaximum
public MQTTProtocolManager setReceiveMaximum(int receiveMaximum)
-
getMaximumPacketSize
public int getMaximumPacketSize()
-
setMaximumPacketSize
public MQTTProtocolManager setMaximumPacketSize(int maximumPacketSize)
-
getServerKeepAlive
public int getServerKeepAlive()
-
setServerKeepAlive
public MQTTProtocolManager setServerKeepAlive(int serverKeepAlive)
-
isCloseMqttConnectionOnPublishAuthorizationFailure
public boolean isCloseMqttConnectionOnPublishAuthorizationFailure()
-
setCloseMqttConnectionOnPublishAuthorizationFailure
public void setCloseMqttConnectionOnPublishAuthorizationFailure(boolean closeMqttConnectionOnPublishAuthorizationFailure)
-
onNotification
public void onNotification(Notification notification)
- Specified by:
onNotificationin interfaceNotificationListener
-
getFactory
public ProtocolManagerFactory getFactory()
- Specified by:
getFactoryin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
updateInterceptors
public void updateInterceptors(List incoming, List outgoing)
- Specified by:
updateInterceptorsin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
scanSessions
public void scanSessions()
-
createConnectionEntry
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection connection)
- Specified by:
createConnectionEntryin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
acceptsNoHandshake
public boolean acceptsNoHandshake()
- Specified by:
acceptsNoHandshakein interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
handleBuffer
public void handleBuffer(RemotingConnection connection, ActiveMQBuffer buffer)
- Specified by:
handleBufferin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
addChannelHandlers
public void addChannelHandlers(io.netty.channel.ChannelPipeline pipeline)
- Specified by:
addChannelHandlersin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
isProtocol
public boolean isProtocol(byte[] array)
Relevant portions of the specs we support: MQTT 3.1 - https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#connect MQTT 3.1.1 - http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718028 MQTT 5 - https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901033- Specified by:
isProtocolin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
handshake
public void handshake(NettyServerConnection connection, ActiveMQBuffer buffer)
- Specified by:
handshakein interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
websocketSubprotocolIdentifiers
public List<String> websocketSubprotocolIdentifiers()
- Specified by:
websocketSubprotocolIdentifiersin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
getRoutingHandler
public MQTTRoutingHandler getRoutingHandler()
- Specified by:
getRoutingHandlerin interfaceProtocolManager<MQTTInterceptor,MQTTRoutingHandler>
-
invokeIncoming
public String invokeIncoming(io.netty.handler.codec.mqtt.MqttMessage mqttMessage, MQTTConnection connection)
-
invokeOutgoing
public String invokeOutgoing(io.netty.handler.codec.mqtt.MqttMessage mqttMessage, MQTTConnection connection)
-
isClientConnected
public boolean isClientConnected(String clientId, MQTTConnection connection)
-
removeConnectedClient
public void removeConnectedClient(String clientId)
-
addConnectedClient
public MQTTConnection addConnectedClient(String clientId, MQTTConnection connection)
- Parameters:
clientId-connection-- Returns:
- the
MQTTConnectionthat the added connection replaced or null if there was no previous entry for theclientId
-
getSessionState
public MQTTSessionState getSessionState(String clientId)
-
removeSessionState
public MQTTSessionState removeSessionState(String clientId)
-
getSessionStates
public Map<String,MQTTSessionState> getSessionStates()
-
getConnectedClients
public Map<String,MQTTConnection> getConnectedClients()
For DEBUG only
-
-