org.apache.activemq.transport.ws
Class MQTTSocket

java.lang.Object
  extended by org.apache.activemq.util.ServiceSupport
      extended by org.apache.activemq.transport.TransportSupport
          extended by org.apache.activemq.transport.ws.MQTTSocket
All Implemented Interfaces:
Service, MQTTTransport, Transport, org.eclipse.jetty.websocket.WebSocket, org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage

public class MQTTSocket
extends TransportSupport
implements org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage, MQTTTransport


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.WebSocket
org.eclipse.jetty.websocket.WebSocket.Connection, org.eclipse.jetty.websocket.WebSocket.FrameConnection, org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage, org.eclipse.jetty.websocket.WebSocket.OnControl, org.eclipse.jetty.websocket.WebSocket.OnFrame, org.eclipse.jetty.websocket.WebSocket.OnTextMessage
 
Constructor Summary
MQTTSocket()
           
 
Method Summary
protected  void doStart()
           
protected  void doStop(ServiceStopper stopper)
           
 MQTTInactivityMonitor getInactivityMonitor()
           
 X509Certificate[] getPeerCertificates()
           
 int getReceiveCounter()
          Returns a counter which gets incremented as data is read from the transport.
 String getRemoteAddress()
           
 MQTTWireFormat getWireFormat()
           
 void onClose(int closeCode, String message)
           
 void oneway(Object command)
          A one way asynchronous send
 void onMessage(byte[] bytes, int offset, int length)
           
 void onOpen(org.eclipse.jetty.websocket.WebSocket.Connection connection)
           
 void sendToActiveMQ(Command command)
           
 void sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command)
           
 
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
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Constructor Detail

MQTTSocket

public MQTTSocket()
Method Detail

onMessage

public void onMessage(byte[] bytes,
                      int offset,
                      int length)
Specified by:
onMessage in interface org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage

onOpen

public void onOpen(org.eclipse.jetty.websocket.WebSocket.Connection connection)
Specified by:
onOpen in interface org.eclipse.jetty.websocket.WebSocket

onClose

public void onClose(int closeCode,
                    String message)
Specified by:
onClose in interface org.eclipse.jetty.websocket.WebSocket

doStart

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

doStop

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

getReceiveCounter

public int getReceiveCounter()
Description copied from interface: Transport
Returns a counter which gets incremented as data is read from the transport. It should only be used to determine if there is progress being made in reading the next command from the transport. The value may wrap into the negative numbers.

Specified by:
getReceiveCounter in interface Transport
Returns:
a counter which gets incremented as data is read from the transport.

getRemoteAddress

public String getRemoteAddress()
Specified by:
getRemoteAddress in interface Transport
Returns:
the remote address for this connection

oneway

public void oneway(Object command)
            throws IOException
Description copied from interface: Transport
A one way asynchronous send

Specified by:
oneway in interface Transport
Throws:
IOException

sendToActiveMQ

public void sendToActiveMQ(Command command)
Specified by:
sendToActiveMQ in interface MQTTTransport

sendToMQTT

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

getPeerCertificates

public X509Certificate[] getPeerCertificates()
Specified by:
getPeerCertificates in interface MQTTTransport

getInactivityMonitor

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

getWireFormat

public MQTTWireFormat getWireFormat()
Specified by:
getWireFormat in interface MQTTTransport


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.