+ logger.log(Level.WARNING, "Could not find destination plugin: " + pluginReplySender);
+ }
+ }
+
+ //
+ // PRIVATE METHODS
+ //
+
+ /**
+ * Sends the given response to the given plugin.
+ *
+ * @param pluginReplySender
+ * The reply sender
+ * @param identifier
+ * The identifier (may be {@code null})
+ * @param response
+ * The response to send
+ * @throws PluginNotFoundException
+ * if the plugin can not be found
+ */
+ private static void sendReply(PluginReplySender pluginReplySender, String identifier, Response response) throws PluginNotFoundException {
+ SimpleFieldSet replyParameters = response.getReplyParameters();
+ if (identifier != null) {
+ replyParameters.putOverwrite("Identifier", identifier);
+ }
+ if (response.hasData()) {
+ pluginReplySender.send(replyParameters, response.getData());
+ } else if (response.hasBucket()) {
+ pluginReplySender.send(replyParameters, response.getBucket());
+ } else {
+ pluginReplySender.send(replyParameters);