Class AbstractMQTTSocket

java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.transport.TransportSupport
org.apache.activemq.transport.ws.AbstractMQTTSocket
All Implemented Interfaces:
org.apache.activemq.broker.BrokerServiceAware, org.apache.activemq.Service, MQTTTransport, org.apache.activemq.transport.Transport
Direct Known Subclasses:
MQTTSocket

public abstract class AbstractMQTTSocket extends org.apache.activemq.transport.TransportSupport implements MQTTTransport, org.apache.activemq.broker.BrokerServiceAware
  • Field Details

    • protocolLock

      protected ReentrantLock protocolLock
    • protocolConverter

      protected volatile MQTTProtocolConverter protocolConverter
    • wireFormat

      protected MQTTWireFormat wireFormat
    • mqttInactivityMonitor

      protected final MQTTInactivityMonitor mqttInactivityMonitor
    • socketTransportStarted

      protected final CountDownLatch socketTransportStarted
    • brokerService

      protected org.apache.activemq.broker.BrokerService brokerService
    • receiveCounter

      protected volatile int receiveCounter
    • remoteAddress

      protected final String remoteAddress
    • peerCertificates

      protected X509Certificate[] peerCertificates
  • Constructor Details

    • AbstractMQTTSocket

      public AbstractMQTTSocket(String remoteAddress)
  • Method Details

    • oneway

      public void oneway(Object command) throws IOException
      Specified by:
      oneway in interface org.apache.activemq.transport.Transport
      Throws:
      IOException
    • sendToActiveMQ

      public void sendToActiveMQ(org.apache.activemq.command.Command command)
      Specified by:
      sendToActiveMQ in interface MQTTTransport
    • doStop

      protected void doStop(ServiceStopper stopper) throws Exception
      Specified by:
      doStop in class ServiceSupport
      Throws:
      Exception
    • doStart

      protected void doStart() throws Exception
      Specified by:
      doStart in class ServiceSupport
      Throws:
      Exception
    • sendToMQTT

      public abstract void sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command) throws IOException
      Specified by:
      sendToMQTT in interface MQTTTransport
      Throws:
      IOException
    • handleStopped

      public abstract void handleStopped() throws IOException
      Called when the transport is stopping to allow the dervied classes a chance to close WebSocket resources.
      Throws:
      IOException - if an error occurs during the stop.
    • getInactivityMonitor

      public MQTTInactivityMonitor getInactivityMonitor()
      Specified by:
      getInactivityMonitor in interface MQTTTransport
    • getWireFormat

      public MQTTWireFormat getWireFormat()
      Specified by:
      getWireFormat in interface MQTTTransport
      Specified by:
      getWireFormat in interface org.apache.activemq.transport.Transport
    • getRemoteAddress

      public String getRemoteAddress()
      Specified by:
      getRemoteAddress in interface org.apache.activemq.transport.Transport
    • getReceiveCounter

      public int getReceiveCounter()
      Specified by:
      getReceiveCounter in interface org.apache.activemq.transport.Transport
    • getPeerCertificates

      public X509Certificate[] getPeerCertificates()
      Specified by:
      getPeerCertificates in interface MQTTTransport
      Specified by:
      getPeerCertificates in interface org.apache.activemq.transport.Transport
    • setPeerCertificates

      public void setPeerCertificates(X509Certificate[] certificates)
      Specified by:
      setPeerCertificates in interface MQTTTransport
      Specified by:
      setPeerCertificates in interface org.apache.activemq.transport.Transport
    • setBrokerService

      public void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)
      Specified by:
      setBrokerService in interface org.apache.activemq.broker.BrokerServiceAware
    • getProtocolConverter

      protected MQTTProtocolConverter getProtocolConverter()
    • transportStartedAtLeastOnce

      protected boolean transportStartedAtLeastOnce()
    • setTransportOptions

      public void setTransportOptions(Map<String,Object> transportOptions)