You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/04/05 16:14:58 UTC

[camel] 11/20: CAMEL-17792: Add doc about the message headers of camel-splunk-hec

This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ef11f1d2282de562c5929e620e9efa3ae7a565bb
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue Apr 5 14:50:58 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-splunk-hec
---
 .../org/apache/camel/component/splunkhec/splunk-hec.json |  3 +++
 .../src/main/docs/splunk-hec-component.adoc              | 16 +++-------------
 .../camel/component/splunkhec/SplunkHECConstants.java    |  6 ++++++
 .../camel/component/splunkhec/SplunkHECEndpoint.java     |  3 ++-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/components/camel-splunk-hec/src/generated/resources/org/apache/camel/component/splunkhec/splunk-hec.json b/components/camel-splunk-hec/src/generated/resources/org/apache/camel/component/splunkhec/splunk-hec.json
index 22ed02f750c..63bd148155b 100644
--- a/components/camel-splunk-hec/src/generated/resources/org/apache/camel/component/splunkhec/splunk-hec.json
+++ b/components/camel-splunk-hec/src/generated/resources/org/apache/camel/component/splunkhec/splunk-hec.json
@@ -25,6 +25,9 @@
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
   },
+  "headers": {
+    "CamelSplunkHECIndexTime": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Epoch-formatted time. Specify with the time query string parameter. Sets a default for all events in the request. The default time can be overridden." }
+  },
   "properties": {
     "splunkURL": { "kind": "path", "displayName": "Splunk URL", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Splunk Host URL" },
     "token": { "kind": "path", "displayName": "Token", "group": "security", "label": "security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Splunk authorization token" },
diff --git a/components/camel-splunk-hec/src/main/docs/splunk-hec-component.adoc b/components/camel-splunk-hec/src/main/docs/splunk-hec-component.adoc
index c06b272d831..a2978bbbf52 100644
--- a/components/camel-splunk-hec/src/main/docs/splunk-hec-component.adoc
+++ b/components/camel-splunk-hec/src/main/docs/splunk-hec-component.adoc
@@ -49,19 +49,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
-
-
-== Message Headers
-
-[width="100%",cols="10%,20%,70%",options="header",]
-|=======================================================================
-|Name |Type |Description
-
-|`SplunkHECConstants.INDEX_TIME` |`Long` | Epoch-formatted time.
-Specify with the time query string parameter. Sets a default for all events in the request.
-The default time can be overridden.
-
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Message body
 The body must be serializable to JSON so it may be sent to Splunk.
diff --git a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConstants.java b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConstants.java
index 4ca575c1062..3cd6f6f9f40 100644
--- a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConstants.java
+++ b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConstants.java
@@ -16,8 +16,14 @@
  */
 package org.apache.camel.component.splunkhec;
 
+import org.apache.camel.spi.Metadata;
+
 public interface SplunkHECConstants {
 
+    @Metadata(description = "Epoch-formatted time.\n" +
+                            "Specify with the time query string parameter. Sets a default for all events in the request.\n" +
+                            "The default time can be overridden.",
+              javaType = "Long")
     String INDEX_TIME = "CamelSplunkHECIndexTime";
 
 }
diff --git a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java
index 79a5074d9dd..81f70e4ad23 100644
--- a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java
+++ b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java
@@ -35,7 +35,8 @@ import org.apache.commons.validator.routines.InetAddressValidator;
  * The splunk component allows to publish events in Splunk using the HTTP Event Collector.
  */
 @UriEndpoint(firstVersion = "3.3.0", scheme = "splunk-hec", title = "Splunk HEC", producerOnly = true,
-             syntax = "splunk-hec:splunkURL/token", category = { Category.LOG, Category.MONITORING })
+             syntax = "splunk-hec:splunkURL/token", category = { Category.LOG, Category.MONITORING },
+             headersClass = SplunkHECConstants.class)
 public class SplunkHECEndpoint extends DefaultEndpoint {
 
     private static final Pattern URI_PARSER