/** * Uploads an event message to Hono. * <p> * This method always sends a response to the device. The status code will be set * as specified in the * <a href="https://www.eclipse.org/hono/user-guide/http-adapter/#publish-an-event-authenticated-device"> * HTTP adapter User Guide</a>. * * @param ctx The context to retrieve cookies and the HTTP response from. * @param tenant The tenant of the device that has produced the data. * @param deviceId The id of the device that has produced the data. * @param payload The message payload to send. * @param contentType The content type of the message payload. * @throws NullPointerException if any of response, tenant or device ID is {@code null}. */ public final void uploadEventMessage(final RoutingContext ctx, final String tenant, final String deviceId, final Buffer payload, final String contentType) { doUploadMessage( Objects.requireNonNull(ctx), Objects.requireNonNull(tenant), Objects.requireNonNull(deviceId), payload, contentType, getEventSender(tenant), EventConstants.EVENT_ENDPOINT); }
/** * Uploads an event message to Hono. * <p> * This method always sends a response to the device. The status code will be set * as specified in the * <a href="https://www.eclipse.org/hono/user-guide/http-adapter/#publish-an-event-authenticated-device"> * HTTP adapter User Guide</a>. * * @param ctx The context to retrieve cookies and the HTTP response from. * @param tenant The tenant of the device that has produced the data. * @param deviceId The id of the device that has produced the data. * @param payload The message payload to send. * @param contentType The content type of the message payload. * @throws NullPointerException if any of response, tenant or device ID is {@code null}. */ public final void uploadEventMessage(final RoutingContext ctx, final String tenant, final String deviceId, final Buffer payload, final String contentType) { doUploadMessage( Objects.requireNonNull(ctx), Objects.requireNonNull(tenant), Objects.requireNonNull(deviceId), payload, contentType, getEventSender(tenant), EventConstants.EVENT_ENDPOINT); }