Package org.apache.activemq.transport.ws
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 Summary
Fields Modifier and Type Field Description protected org.apache.activemq.broker.BrokerServicebrokerServiceprotected MQTTInactivityMonitormqttInactivityMonitorprotected X509Certificate[]peerCertificatesprotected MQTTProtocolConverterprotocolConverterprotected ReentrantLockprotocolLockprotected intreceiveCounterprotected StringremoteAddressprotected CountDownLatchsocketTransportStartedprotected MQTTWireFormatwireFormat
-
Constructor Summary
Constructors Constructor Description AbstractMQTTSocket(String remoteAddress)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop(ServiceStopper stopper)MQTTInactivityMonitorgetInactivityMonitor()X509Certificate[]getPeerCertificates()protected MQTTProtocolConvertergetProtocolConverter()intgetReceiveCounter()StringgetRemoteAddress()MQTTWireFormatgetWireFormat()abstract voidhandleStopped()Called when the transport is stopping to allow the dervied classes a chance to close WebSocket resources.voidoneway(Object command)voidsendToActiveMQ(org.apache.activemq.command.Command command)abstract voidsendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command)voidsetBrokerService(org.apache.activemq.broker.BrokerService brokerService)voidsetPeerCertificates(X509Certificate[] certificates)voidsetTransportOptions(Map<String,Object> transportOptions)protected booleantransportStartedAtLeastOnce()-
Methods inherited from class org.apache.activemq.transport.TransportSupport
asyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setTransportListener, updateURIs
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
-
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.transport.mqtt.MQTTTransport
onException, stop
-
-
-
-
Field Detail
-
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 Detail
-
AbstractMQTTSocket
public AbstractMQTTSocket(String remoteAddress)
-
-
Method Detail
-
oneway
public void oneway(Object command) throws IOException
- Specified by:
onewayin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
sendToActiveMQ
public void sendToActiveMQ(org.apache.activemq.command.Command command)
- Specified by:
sendToActiveMQin interfaceMQTTTransport
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Specified by:
doStopin classServiceSupport- Throws:
Exception
-
doStart
protected void doStart() throws Exception- Specified by:
doStartin classServiceSupport- Throws:
Exception
-
sendToMQTT
public abstract void sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command) throws IOException- Specified by:
sendToMQTTin interfaceMQTTTransport- Throws:
IOException
-
handleStopped
public abstract void handleStopped() throws IOExceptionCalled 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:
getInactivityMonitorin interfaceMQTTTransport
-
getWireFormat
public MQTTWireFormat getWireFormat()
- Specified by:
getWireFormatin interfaceMQTTTransport- Specified by:
getWireFormatin interfaceorg.apache.activemq.transport.Transport
-
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceorg.apache.activemq.transport.Transport
-
getReceiveCounter
public int getReceiveCounter()
- Specified by:
getReceiveCounterin interfaceorg.apache.activemq.transport.Transport
-
getPeerCertificates
public X509Certificate[] getPeerCertificates()
- Specified by:
getPeerCertificatesin interfaceMQTTTransport- Specified by:
getPeerCertificatesin interfaceorg.apache.activemq.transport.Transport
-
setPeerCertificates
public void setPeerCertificates(X509Certificate[] certificates)
- Specified by:
setPeerCertificatesin interfaceMQTTTransport- Specified by:
setPeerCertificatesin interfaceorg.apache.activemq.transport.Transport
-
setBrokerService
public void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)
- Specified by:
setBrokerServicein interfaceorg.apache.activemq.broker.BrokerServiceAware
-
getProtocolConverter
protected MQTTProtocolConverter getProtocolConverter()
-
transportStartedAtLeastOnce
protected boolean transportStartedAtLeastOnce()
-
-