/** * Convenience wrapper method to notify user if they have specified a callback. * If callback is not specified, it throws an exception. * @param cb - callback to be invoked. * @param status - message status to pass in the callback. * @param userData User defined data to be passed to the user in the callback. * @param e a Throwable that may have caused publish failure or null for success */ void notifyPublishResult(AWSIotMqttMessageDeliveryCallback cb, AWSIotMqttMessageDeliveryCallback.MessageDeliveryStatus status, Object userData, RuntimeException e) { if (cb != null) { cb.statusChanged(status, userData); } else { if (e != null) { throw e; } } }
/** * Convenience wrapper method to notify user if they have specified a callback. * If callback is not specified, it throws an exception. * @param cb - callback to be invoked. * @param status - message status to pass in the callback. * @param userData User defined data to be passed to the user in the callback. * @param e a Throwable that may have caused publish failure or null for success */ void notifyPublishResult(AWSIotMqttMessageDeliveryCallback cb, AWSIotMqttMessageDeliveryCallback.MessageDeliveryStatus status, Object userData, RuntimeException e) { if (cb != null) { cb.statusChanged(status, userData); } else { if (e != null) { throw e; } } }