public void sendOutputEvent(String connectionId, String outputName, String eventBody, Handler<AsyncResult<Void>> handler) { System.out.printf("sendOutputEvent called for %s, %s%n", connectionId, outputName); System.out.println(eventBody); Message msg = new Message(eventBody); msg.setOutputName(outputName); this.sendEventHelper(connectionId, msg, handler); }
/** * Sends a message to a particular outputName asynchronously * * @param outputName the outputName to route the message to * @param message the message to send * @param callback the callback to be fired when the message is acknowledged by the service * @param callbackContext the context to be included in the callback when fired * @throws IllegalArgumentException if the provided outputName is null or empty */ public void sendEventAsync(Message message, IotHubEventCallback callback, Object callbackContext, String outputName) throws IllegalArgumentException { if (outputName == null || outputName.isEmpty()) { //Codes_SRS_MODULECLIENT_34_001: [If the provided outputName is null or empty, this function shall throw an IllegalArgumentException.] throw new IllegalArgumentException("outputName cannot be null or empty"); } //Codes_SRS_MODULECLIENT_34_002: [This function shall set the provided message with the provided outputName.] message.setOutputName(outputName); //Codes_SRS_MODULECLIENT_34_003: [This function shall invoke super.sendEventAsync(message, callback, callbackContext).] this.sendEventAsync(message, callback, callbackContext); }
message.setOutputName(value); break; case CONTENT_ENCODING: