Search in sources :

Example 1 with KuraResponseCode

use of org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode in project kapua by eclipse.

the class AbstractDeviceApplicationCallResponseHandler method handleDeviceInternalErrorReply.

@SuppressWarnings("rawtypes")
protected void handleDeviceInternalErrorReply(DeviceResponseMessage responseMessage) throws DeviceManagementException {
    DeviceResponsePayload responsePayload = (DeviceResponsePayload) responseMessage.getPayload();
    KuraResponseCode responseCode = responsePayload.getResponseCode();
    throw new DeviceManagementException(DeviceManagementErrorCodes.RESPONSE_INTERNAL_ERROR, null, new Object[] { responseCode, responsePayload.getExceptionMessage(), responsePayload.getExceptionStack() });
}
Also used : DeviceManagementException(org.eclipse.kapua.service.device.management.commons.exception.DeviceManagementException) DeviceResponsePayload(org.eclipse.kapua.service.device.call.message.app.response.DeviceResponsePayload) KuraResponseCode(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode)

Example 2 with KuraResponseCode

use of org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode in project kapua by eclipse.

the class AbstractDeviceApplicationCallResponseHandler method handleBadRequestReply.

@SuppressWarnings("rawtypes")
protected void handleBadRequestReply(DeviceResponseMessage responseMessage) throws DeviceManagementException {
    DeviceResponsePayload responsePayload = (DeviceResponsePayload) responseMessage.getPayload();
    KuraResponseCode responseCode = responsePayload.getResponseCode();
    throw new DeviceManagementException(DeviceManagementErrorCodes.RESPONSE_BAD_REQUEST, null, new Object[] { responseCode, responsePayload.getExceptionMessage(), responsePayload.getExceptionStack() });
}
Also used : DeviceManagementException(org.eclipse.kapua.service.device.management.commons.exception.DeviceManagementException) DeviceResponsePayload(org.eclipse.kapua.service.device.call.message.app.response.DeviceResponsePayload) KuraResponseCode(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode)

Example 3 with KuraResponseCode

use of org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode in project kapua by eclipse.

the class AbstractDeviceApplicationCallResponseHandler method handleNotFoundReply.

@SuppressWarnings("rawtypes")
protected void handleNotFoundReply(DeviceResponseMessage responseMessage) throws DeviceManagementException {
    DeviceResponsePayload responsePayload = (DeviceResponsePayload) responseMessage.getPayload();
    KuraResponseCode responseCode = responsePayload.getResponseCode();
    throw new DeviceManagementException(DeviceManagementErrorCodes.RESPONSE_NOT_FOUND, null, new Object[] { responseCode, responsePayload.getExceptionMessage(), responsePayload.getExceptionStack() });
}
Also used : DeviceManagementException(org.eclipse.kapua.service.device.management.commons.exception.DeviceManagementException) DeviceResponsePayload(org.eclipse.kapua.service.device.call.message.app.response.DeviceResponsePayload) KuraResponseCode(org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode)

Aggregations

DeviceResponsePayload (org.eclipse.kapua.service.device.call.message.app.response.DeviceResponsePayload)3 KuraResponseCode (org.eclipse.kapua.service.device.call.message.app.response.kura.KuraResponseCode)3 DeviceManagementException (org.eclipse.kapua.service.device.management.commons.exception.DeviceManagementException)3