Class MQTTSocket
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.transport.TransportSupport
-
- org.apache.activemq.transport.ws.AbstractMQTTSocket
-
- org.apache.activemq.transport.ws.jetty9.MQTTSocket
-
- All Implemented Interfaces:
BrokerServiceAware
,Service
,MQTTCodec.MQTTFrameSink
,MQTTTransport
,Transport
,org.eclipse.jetty.websocket.api.WebSocketConnectionListener
,org.eclipse.jetty.websocket.api.WebSocketListener
public class MQTTSocket extends AbstractMQTTSocket implements MQTTCodec.MQTTFrameSink, org.eclipse.jetty.websocket.api.WebSocketListener
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.transport.ws.AbstractMQTTSocket
brokerService, mqttInactivityMonitor, peerCertificates, protocolConverter, protocolLock, receiveCounter, remoteAddress, socketTransportStarted, wireFormat
-
-
Constructor Summary
Constructors Constructor Description MQTTSocket(String remoteAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleStopped()
Called when the transport is stopping to allow the dervied classes a chance to close WebSocket resources.void
onFrame(org.fusesource.mqtt.codec.MQTTFrame mqttFrame)
void
onWebSocketBinary(byte[] bytes, int offset, int length)
void
onWebSocketClose(int arg0, String arg1)
void
onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)
void
onWebSocketError(Throwable arg0)
void
onWebSocketText(String arg0)
void
sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command)
-
Methods inherited from class org.apache.activemq.transport.ws.AbstractMQTTSocket
doStart, doStop, getInactivityMonitor, getPeerCertificates, getProtocolConverter, getReceiveCounter, getRemoteAddress, getWireFormat, oneway, sendToActiveMQ, setBrokerService, setPeerCertificates, setTransportOptions, transportStartedAtLeastOnce
-
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
-
-
-
-
Constructor Detail
-
MQTTSocket
public MQTTSocket(String remoteAddress)
-
-
Method Detail
-
sendToMQTT
public void sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command) throws IOException
- Specified by:
sendToMQTT
in interfaceMQTTTransport
- Specified by:
sendToMQTT
in classAbstractMQTTSocket
- Throws:
IOException
-
handleStopped
public void handleStopped() throws IOException
Description copied from class:AbstractMQTTSocket
Called when the transport is stopping to allow the dervied classes a chance to close WebSocket resources.- Specified by:
handleStopped
in classAbstractMQTTSocket
- Throws:
IOException
- if an error occurs during the stop.
-
onWebSocketBinary
public void onWebSocketBinary(byte[] bytes, int offset, int length)
- Specified by:
onWebSocketBinary
in interfaceorg.eclipse.jetty.websocket.api.WebSocketListener
-
onWebSocketClose
public void onWebSocketClose(int arg0, String arg1)
- Specified by:
onWebSocketClose
in interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
onWebSocketConnect
public void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)
- Specified by:
onWebSocketConnect
in interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
onWebSocketError
public void onWebSocketError(Throwable arg0)
- Specified by:
onWebSocketError
in interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
onWebSocketText
public void onWebSocketText(String arg0)
- Specified by:
onWebSocketText
in interfaceorg.eclipse.jetty.websocket.api.WebSocketListener
-
onFrame
public void onFrame(org.fusesource.mqtt.codec.MQTTFrame mqttFrame)
- Specified by:
onFrame
in interfaceMQTTCodec.MQTTFrameSink
-
-