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 0521bd368cb126210746764ed4dec18af266369d
Author: Nicolas Filotto <[email protected]>
AuthorDate: Tue Mar 22 11:06:44 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-ganglia
---
 .../org/apache/camel/component/ganglia/ganglia.json    |  9 +++++++++
 .../camel-ganglia/src/main/docs/ganglia-component.adoc |  3 +++
 .../camel/component/ganglia/GangliaConstants.java      | 18 ++++++++++++++++++
 .../camel/component/ganglia/GangliaEndpoint.java       |  2 +-
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-ganglia/src/generated/resources/org/apache/camel/component/ganglia/ganglia.json
 
b/components/camel-ganglia/src/generated/resources/org/apache/camel/component/ganglia/ganglia.json
index 3d0fe6f..0a913d0 100644
--- 
a/components/camel-ganglia/src/generated/resources/org/apache/camel/component/ganglia/ganglia.json
+++ 
b/components/camel-ganglia/src/generated/resources/org/apache/camel/component/ganglia/ganglia.json
@@ -38,6 +38,15 @@
     "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 [...]
     "configuration": { "kind": "property", "displayName": "Configuration", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "org.apache.camel.component.ganglia.GangliaConfiguration", 
"deprecated": false, "autowired": false, "secret": false, "description": "To 
use the shared configuration" }
   },
+  "headers": {
+    "CamelGangliaGroupName": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The group that the metric belongs to." },
+    "CamelGangliaMetricName": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The name to use for the metric." },
+    "CamelGangliaMetricType": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": 
"info.ganglia.gmetric4j.gmetric.GMetricType", "enum": [ "STRING", "INT8", 
"UINT8", "INT16", "UINT16", "INT32", "UINT32", "FLOAT", "DOUBLE" ], 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The type of value" },
+    "CamelGangliaMetricSlope": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": 
"info.ganglia.gmetric4j.gmetric.GMetricSlope", "enum": [ "ZERO", "POSITIVE", 
"NEGATIVE", "BOTH" ], "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The slope" },
+    "CamelGangliaMetricUnits": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "Any unit of measurement that qualifies the metric, e.g. 
widgets, litres, bytes. Do not include a prefix such as k\n (kilo) or m 
(milli), other tools may scale the units later. The value should be unscaled." 
},
+    "CamelGangliaMetricTmax": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "Integer", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Maximum time in seconds that the value can be considered 
current. After this, Ganglia considers the value to have\n expired." },
+    "CamelGangliaMetricDmax": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "Integer", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Minumum time in seconds before Ganglia will purge the 
metric value if it expires. Set to 0 and the value will\n remain in Ganglia 
indefinitely until a gmond agent restart." }
+  },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "producer", 
"label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "239.2.11.71", "configurationClass": 
"org.apache.camel.component.ganglia.GangliaConfiguration", 
"configurationField": "configuration", "description": "Host name for Ganglia 
server" },
     "port": { "kind": "path", "displayName": "Port", "group": "producer", 
"label": "", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 8649, 
"configurationClass": 
"org.apache.camel.component.ganglia.GangliaConfiguration", 
"configurationField": "configuration", "description": "Port for Ganglia server" 
},
diff --git a/components/camel-ganglia/src/main/docs/ganglia-component.adoc 
b/components/camel-ganglia/src/main/docs/ganglia-component.adoc
index ab03d0f..79aec4b 100644
--- a/components/camel-ganglia/src/main/docs/ganglia-component.adoc
+++ b/components/camel-ganglia/src/main/docs/ganglia-component.adoc
@@ -49,6 +49,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Message body
 
diff --git 
a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConstants.java
 
b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConstants.java
index f7a2e0f..e12599a 100644
--- 
a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConstants.java
+++ 
b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConstants.java
@@ -16,14 +16,32 @@
  */
 package org.apache.camel.component.ganglia;
 
+import org.apache.camel.spi.Metadata;
+
 public final class GangliaConstants {
 
+    @Metadata(description = "The group that the metric belongs to.", javaType 
= "String")
     public static final String GROUP_NAME = "CamelGangliaGroupName";
+    @Metadata(description = "The name to use for the metric.", javaType = 
"String")
     public static final String METRIC_NAME = "CamelGangliaMetricName";
+    @Metadata(description = "The type of value", javaType = 
"info.ganglia.gmetric4j.gmetric.GMetricType")
     public static final String METRIC_TYPE = "CamelGangliaMetricType";
+    @Metadata(description = "The slope", javaType = 
"info.ganglia.gmetric4j.gmetric.GMetricSlope")
     public static final String METRIC_SLOPE = "CamelGangliaMetricSlope";
+    @Metadata(description = "Any unit of measurement that qualifies the 
metric, e.g. widgets, litres, bytes. Do not include a prefix such as k\n"
+                            +
+                            " (kilo) or m (milli), other tools may scale the 
units later. The value should be unscaled.",
+              javaType = "String")
     public static final String METRIC_UNITS = "CamelGangliaMetricUnits";
+    @Metadata(description = "Maximum time in seconds that the value can be 
considered current. After this, Ganglia considers the value to have\n"
+                            +
+                            " expired.",
+              javaType = "Integer")
     public static final String METRIC_TMAX = "CamelGangliaMetricTmax";
+    @Metadata(description = "Minumum time in seconds before Ganglia will purge 
the metric value if it expires. Set to 0 and the value will\n"
+                            +
+                            " remain in Ganglia indefinitely until a gmond 
agent restart.",
+              javaType = "Integer")
     public static final String METRIC_DMAX = "CamelGangliaMetricDmax";
 
     private GangliaConstants() {
diff --git 
a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaEndpoint.java
 
b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaEndpoint.java
index 0aa9e6a..353ad8d 100644
--- 
a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaEndpoint.java
+++ 
b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaEndpoint.java
@@ -33,7 +33,7 @@ import org.apache.camel.util.ObjectHelper;
  * Send metrics to Ganglia monitoring system.
  */
 @UriEndpoint(firstVersion = "2.15.0", scheme = "ganglia", title = "Ganglia", 
syntax = "ganglia:host:port", producerOnly = true,
-             category = { Category.MONITORING })
+             category = { Category.MONITORING }, headersClass = 
GangliaConstants.class)
 public class GangliaEndpoint extends DefaultEndpoint {
 
     private Publisher publisher;

Reply via email to