public class MQTTTransportFilter extends TransportFilter implements MQTTTransport
next, transportListener
Constructor and Description |
---|
MQTTTransportFilter(Transport next,
WireFormat wireFormat,
BrokerService brokerService) |
Modifier and Type | Method and Description |
---|---|
int |
getActiveMQSubscriptionPrefetch() |
long |
getConnectAttemptTimeout() |
long |
getDefaultKeepAlive() |
MQTTInactivityMonitor |
getInactivityMonitor() |
int |
getMaxFrameSize() |
X509Certificate[] |
getPeerCertificates() |
boolean |
getPublishDollarTopics() |
String |
getSubscriptionStrategy() |
MQTTWireFormat |
getWireFormat()
Retrieves the WireFormat instance associated with this Transport instance.
|
boolean |
isTrace() |
void |
onCommand(Object command)
called to process a command
|
void |
oneway(Object o)
A one way asynchronous send
|
void |
onException(IOException error)
An unrecoverable exception has occured on the transport
|
void |
sendToActiveMQ(Command command) |
void |
sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command) |
void |
setActiveMQSubscriptionPrefetch(int activeMQSubscriptionPrefetch)
set the default prefetch size when mapping the MQTT subscription to an ActiveMQ one
The default = 1
|
void |
setConnectAttemptTimeout(long connectTimeout)
Sets the timeout value used to fail a connection if no CONNECT frame is read
in the given interval.
|
void |
setDefaultKeepAlive(long defaultHeartBeat) |
void |
setInactivityMonitor(MQTTInactivityMonitor monitor) |
void |
setMaxFrameSize(int maxFrameSize)
Sets the maximum frame size for an incoming MQTT frame.
|
void |
setPeerCertificates(X509Certificate[] certificates)
Sets the certificates provided by the connected peer.
|
void |
setPublishDollarTopics(boolean publishDollarTopics) |
void |
setSubscriptionStrategy(String name) |
void |
setTrace(boolean trace) |
void |
start() |
void |
stop() |
asyncRequest, getNext, getReceiveCounter, getRemoteAddress, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, reconnect, request, request, setTransportListener, toString, transportInterupted, transportResumed, updateURIs
public MQTTTransportFilter(Transport next, WireFormat wireFormat, BrokerService brokerService)
public void oneway(Object o) throws IOException
Transport
oneway
in interface Transport
oneway
in class TransportFilter
IOException
public void onCommand(Object command)
TransportListener
onCommand
in interface TransportListener
onCommand
in class TransportFilter
public void sendToActiveMQ(Command command)
sendToActiveMQ
in interface MQTTTransport
public void sendToMQTT(org.fusesource.mqtt.codec.MQTTFrame command) throws IOException
sendToMQTT
in interface MQTTTransport
IOException
public void start() throws Exception
start
in interface Service
start
in class TransportFilter
Exception
Service.start()
public void stop() throws Exception
stop
in interface Service
stop
in interface MQTTTransport
stop
in class TransportFilter
Exception
Service.stop()
public X509Certificate[] getPeerCertificates()
getPeerCertificates
in interface MQTTTransport
getPeerCertificates
in interface Transport
getPeerCertificates
in class TransportFilter
public boolean isTrace()
public void setTrace(boolean trace)
public MQTTInactivityMonitor getInactivityMonitor()
getInactivityMonitor
in interface MQTTTransport
public void setInactivityMonitor(MQTTInactivityMonitor monitor)
public MQTTWireFormat getWireFormat()
Transport
getWireFormat
in interface MQTTTransport
getWireFormat
in interface Transport
getWireFormat
in class TransportFilter
public void onException(IOException error)
TransportListener
onException
in interface MQTTTransport
onException
in interface TransportListener
onException
in class TransportFilter
public long getDefaultKeepAlive()
public void setDefaultKeepAlive(long defaultHeartBeat)
public long getConnectAttemptTimeout()
public void setConnectAttemptTimeout(long connectTimeout)
connectTimeout
- the connection frame received timeout value.public boolean getPublishDollarTopics()
public void setPublishDollarTopics(boolean publishDollarTopics)
public String getSubscriptionStrategy()
public void setSubscriptionStrategy(String name)
public int getActiveMQSubscriptionPrefetch()
public void setActiveMQSubscriptionPrefetch(int activeMQSubscriptionPrefetch)
activeMQSubscriptionPrefetch
- set the prefetch for the corresponding ActiveMQ subscriptionpublic int getMaxFrameSize()
public void setMaxFrameSize(int maxFrameSize)
maxFrameSize
- the maximum allowed frame size for a single MQTT frame.public void setPeerCertificates(X509Certificate[] certificates)
Transport
setPeerCertificates
in interface MQTTTransport
setPeerCertificates
in interface Transport
setPeerCertificates
in class TransportFilter
certificates
- the Certificates provided by the peer.Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.