public interface MqttAgentConfiguration
PahoMqttAgent
to createDataReader
and DataWriter
for
specific MQTT topics, get the topics and notify errors.Modifier and Type | Method and Description |
---|---|
void |
errorOnMessageReceivedCallback(java.lang.Throwable t,
PahoMqttContext context,
java.lang.String topic,
org.eclipse.paho.client.mqttv3.MqttMessage message)
Method called when an error occurs while calling a listener
MqttListener.messageReceived(String, DataReader) . |
java.lang.String |
getLocalTopicPrefix()
Returns the topic prefix to use to publish data sandboxed within the current account.
|
java.lang.String |
getSharedTopicPrefix()
Returns the topic prefix to use to publish data shared with other accounts.
|
ej.data.DataReader |
newDataReader(java.io.InputStream is,
java.lang.String topic)
Creates a
DataReader for the given topic. |
ej.data.DataWriter |
newDataWriter(java.io.OutputStream os,
java.lang.String topic)
Creates a
DataWriter for the given topic. |
ej.data.DataWriter newDataWriter(java.io.OutputStream os, java.lang.String topic)
DataWriter
for the given topic. The created DataWriter
must use the given OutputStream
to write the data.os
- the OutputStream
used by the created DataWriter
.topic
- the MQTT topic.DataWriter
for the MQTT topic.ej.data.DataReader newDataReader(java.io.InputStream is, java.lang.String topic)
DataReader
for the given topic. The created DataReader
must use the given InputStream
to read the data.is
- the InputStream
used by the created DataReader
.topic
- the MQTT topic.DataReader
for the MQTT topic.java.lang.String getSharedTopicPrefix()
String
ends with a '/'
if it is not empty.java.lang.String getLocalTopicPrefix()
String
ends with a '/'
if it is not empty.void errorOnMessageReceivedCallback(java.lang.Throwable t, PahoMqttContext context, java.lang.String topic, org.eclipse.paho.client.mqttv3.MqttMessage message)
MqttListener.messageReceived(String, DataReader)
.message
- the received MQTT message.topic
- name of the topic on the message was published to.context
- MqttContext
that owns the listener that generates the error.t
- the thrown error.