Class MQTTConnection

  • All Implemented Interfaces:
    org.apache.activemq.artemis.spi.core.protocol.RemotingConnection, org.apache.activemq.artemis.spi.core.remoting.BufferHandler

    public class MQTTConnection
    extends java.lang.Object
    implements org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
    • Constructor Summary

      Constructors 
      Constructor Description
      MQTTConnection​(org.apache.activemq.artemis.spi.core.remoting.Connection transportConnection)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCloseListener​(org.apache.activemq.artemis.core.remoting.CloseListener listener)  
      void addFailureListener​(org.apache.activemq.artemis.core.remoting.FailureListener listener)  
      java.util.concurrent.Future asyncFail​(org.apache.activemq.artemis.api.core.ActiveMQException me)  
      void bufferReceived​(java.lang.Object connectionID, org.apache.activemq.artemis.api.core.ActiveMQBuffer buffer)  
      boolean checkDataReceived()  
      org.apache.activemq.artemis.api.core.ActiveMQBuffer createTransportBuffer​(int size)  
      protected void dataReceived()  
      void destroy()  
      void disconnect​(boolean criticalError)  
      void disconnect​(java.lang.String scaleDownNodeID, boolean criticalError)  
      void fail​(org.apache.activemq.artemis.api.core.ActiveMQException me)  
      void fail​(org.apache.activemq.artemis.api.core.ActiveMQException me, java.lang.String scaleDownTargetNodeID)  
      void flush()  
      javax.security.auth.Subject getAuditSubject()  
      java.lang.String getClientID()
      Returns the Client ID associated with this connection
      boolean getConnected()  
      long getCreationTime()  
      java.util.List<org.apache.activemq.artemis.core.remoting.FailureListener> getFailureListeners()  
      java.lang.Object getID()  
      java.lang.String getProtocolName()
      Returns the name of the protocol for this Remoting Connection
      java.lang.String getRemoteAddress()  
      javax.security.auth.Subject getSubject()  
      org.apache.activemq.artemis.spi.core.remoting.Connection getTransportConnection()  
      java.lang.String getTransportLocalAddress()  
      boolean isClient()  
      boolean isDestroyed()  
      boolean isSupportReconnect()  
      boolean isSupportsFlowControl()  
      boolean isWritable​(org.apache.activemq.artemis.spi.core.remoting.ReadyListener callback)  
      void killMessage​(org.apache.activemq.artemis.api.core.SimpleString nodeID)  
      boolean removeCloseListener​(org.apache.activemq.artemis.core.remoting.CloseListener listener)  
      java.util.List<org.apache.activemq.artemis.core.remoting.CloseListener> removeCloseListeners()  
      boolean removeFailureListener​(org.apache.activemq.artemis.core.remoting.FailureListener listener)  
      java.util.List<org.apache.activemq.artemis.core.remoting.FailureListener> removeFailureListeners()  
      void scheduledFlush()  
      void setAuditSubject​(javax.security.auth.Subject subject)  
      void setClientID​(java.lang.String cID)
      Sets the client ID associated with this connection
      void setCloseListeners​(java.util.List<org.apache.activemq.artemis.core.remoting.CloseListener> listeners)  
      void setConnected​(boolean connected)  
      void setFailureListeners​(java.util.List<org.apache.activemq.artemis.core.remoting.FailureListener> listeners)  
      • 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.remoting.BufferHandler

        endOfBatch
      • Methods inherited from interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection

        disconnect, isSameTarget
    • Constructor Detail

      • MQTTConnection

        public MQTTConnection​(org.apache.activemq.artemis.spi.core.remoting.Connection transportConnection)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • scheduledFlush

        public void scheduledFlush()
        Specified by:
        scheduledFlush in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • isWritable

        public boolean isWritable​(org.apache.activemq.artemis.spi.core.remoting.ReadyListener callback)
        Specified by:
        isWritable in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getID

        public java.lang.Object getID()
        Specified by:
        getID in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getCreationTime

        public long getCreationTime()
        Specified by:
        getCreationTime in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getRemoteAddress

        public java.lang.String getRemoteAddress()
        Specified by:
        getRemoteAddress in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • addFailureListener

        public void addFailureListener​(org.apache.activemq.artemis.core.remoting.FailureListener listener)
        Specified by:
        addFailureListener in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • removeFailureListener

        public boolean removeFailureListener​(org.apache.activemq.artemis.core.remoting.FailureListener listener)
        Specified by:
        removeFailureListener in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • addCloseListener

        public void addCloseListener​(org.apache.activemq.artemis.core.remoting.CloseListener listener)
        Specified by:
        addCloseListener in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • removeCloseListener

        public boolean removeCloseListener​(org.apache.activemq.artemis.core.remoting.CloseListener listener)
        Specified by:
        removeCloseListener in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • removeCloseListeners

        public java.util.List<org.apache.activemq.artemis.core.remoting.CloseListener> removeCloseListeners()
        Specified by:
        removeCloseListeners in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • setCloseListeners

        public void setCloseListeners​(java.util.List<org.apache.activemq.artemis.core.remoting.CloseListener> listeners)
        Specified by:
        setCloseListeners in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getFailureListeners

        public java.util.List<org.apache.activemq.artemis.core.remoting.FailureListener> getFailureListeners()
        Specified by:
        getFailureListeners in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • removeFailureListeners

        public java.util.List<org.apache.activemq.artemis.core.remoting.FailureListener> removeFailureListeners()
        Specified by:
        removeFailureListeners in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • setFailureListeners

        public void setFailureListeners​(java.util.List<org.apache.activemq.artemis.core.remoting.FailureListener> listeners)
        Specified by:
        setFailureListeners in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • createTransportBuffer

        public org.apache.activemq.artemis.api.core.ActiveMQBuffer createTransportBuffer​(int size)
        Specified by:
        createTransportBuffer in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • fail

        public void fail​(org.apache.activemq.artemis.api.core.ActiveMQException me)
        Specified by:
        fail in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • fail

        public void fail​(org.apache.activemq.artemis.api.core.ActiveMQException me,
                         java.lang.String scaleDownTargetNodeID)
        Specified by:
        fail in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • asyncFail

        public java.util.concurrent.Future asyncFail​(org.apache.activemq.artemis.api.core.ActiveMQException me)
        Specified by:
        asyncFail in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getTransportConnection

        public org.apache.activemq.artemis.spi.core.remoting.Connection getTransportConnection()
        Specified by:
        getTransportConnection in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • isClient

        public boolean isClient()
        Specified by:
        isClient in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • isDestroyed

        public boolean isDestroyed()
        Specified by:
        isDestroyed in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • disconnect

        public void disconnect​(boolean criticalError)
        Specified by:
        disconnect in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • disconnect

        public void disconnect​(java.lang.String scaleDownNodeID,
                               boolean criticalError)
        Specified by:
        disconnect in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • dataReceived

        protected void dataReceived()
      • checkDataReceived

        public boolean checkDataReceived()
        Specified by:
        checkDataReceived in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • flush

        public void flush()
        Specified by:
        flush in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • bufferReceived

        public void bufferReceived​(java.lang.Object connectionID,
                                   org.apache.activemq.artemis.api.core.ActiveMQBuffer buffer)
        Specified by:
        bufferReceived in interface org.apache.activemq.artemis.spi.core.remoting.BufferHandler
      • setConnected

        public void setConnected​(boolean connected)
      • getConnected

        public boolean getConnected()
      • killMessage

        public void killMessage​(org.apache.activemq.artemis.api.core.SimpleString nodeID)
        Specified by:
        killMessage in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • isSupportReconnect

        public boolean isSupportReconnect()
        Specified by:
        isSupportReconnect in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • isSupportsFlowControl

        public boolean isSupportsFlowControl()
        Specified by:
        isSupportsFlowControl in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • setAuditSubject

        public void setAuditSubject​(javax.security.auth.Subject subject)
        Specified by:
        setAuditSubject in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getAuditSubject

        public javax.security.auth.Subject getAuditSubject()
        Specified by:
        getAuditSubject in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getSubject

        public javax.security.auth.Subject getSubject()
        Specified by:
        getSubject in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
      • getProtocolName

        public java.lang.String getProtocolName()
        Returns the name of the protocol for this Remoting Connection
        Specified by:
        getProtocolName in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
        Returns:
      • setClientID

        public void setClientID​(java.lang.String cID)
        Sets the client ID associated with this connection
        Specified by:
        setClientID in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
        Parameters:
        cID -
      • getClientID

        public java.lang.String getClientID()
        Returns the Client ID associated with this connection
        Specified by:
        getClientID in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
        Returns:
      • getTransportLocalAddress

        public java.lang.String getTransportLocalAddress()
        Specified by:
        getTransportLocalAddress in interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection