use of org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponsePayload in project kapua by eclipse.
the class TranslatorResponseMqttKura method translate.
private KuraResponsePayload translate(MqttPayload mqttPayload) throws KapuaException {
byte[] mqttBody = mqttPayload.getBody();
KuraResponsePayload kuraResponsePayload = new KuraResponsePayload();
kuraResponsePayload.readFromByteArray(mqttBody);
// Return Kura Payload
return kuraResponsePayload;
}
use of org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponsePayload in project kapua by eclipse.
the class TranslatorResponseMqttKura method translate.
@Override
public KuraResponseMessage translate(MqttMessage mqttMessage) throws KapuaException {
//
// Kura topic
KuraResponseChannel kuraChannel = translate(mqttMessage.getRequestTopic());
//
// Kura payload
KuraResponsePayload kuraPayload = translate(mqttMessage.getPayload());
// Kura message
return new KuraResponseMessage(kuraChannel, mqttMessage.getTimestamp(), kuraPayload);
}
Aggregations