Search in sources :

Example 1 with KuraResponsePayload

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;
}
Also used : KuraResponsePayload(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponsePayload)

Example 2 with 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);
}
Also used : KuraResponseMessage(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseMessage) KuraResponseChannel(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseChannel) KuraResponsePayload(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponsePayload)

Aggregations

KuraResponsePayload (org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponsePayload)2 KuraResponseChannel (org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseChannel)1 KuraResponseMessage (org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseMessage)1