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 948c0fc36344f77cb46734441b4301ec79088e4c Author: Nicolas Filotto <[email protected]> AuthorDate: Tue Mar 22 16:23:00 2022 +0100 CAMEL-17792: Add doc about the message headers of camel-grape --- .../resources/org/apache/camel/component/grape/grape.json | 3 +++ components/camel-grape/src/main/docs/grape-component.adoc | 15 +++------------ .../org/apache/camel/component/grape/GrapeConstants.java | 4 ++++ .../org/apache/camel/component/grape/GrapeEndpoint.java | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/components/camel-grape/src/generated/resources/org/apache/camel/component/grape/grape.json b/components/camel-grape/src/generated/resources/org/apache/camel/component/grape/grape.json index bace9f7..d98b751 100644 --- a/components/camel-grape/src/generated/resources/org/apache/camel/component/grape/grape.json +++ b/components/camel-grape/src/generated/resources/org/apache/camel/component/grape/grape.json @@ -26,6 +26,9 @@ "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 [...] "patchesRepository": { "kind": "property", "displayName": "Patches Repository", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.grape.PatchesRepository", "deprecated": false, "autowired": false, "secret": false, "description": "Implementation of org.apache.camel.component.grape.PatchesRepository, by default: FilePatchesRepository" } }, + "headers": { + "CamelGrapeCommand": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.grape.GrapeCommand", "enum": [ "grab", "listPatches", "clearPatches" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "grab", "description": "The command to be performed by the Grape endpoint." } + }, "properties": { "defaultCoordinates": { "kind": "path", "displayName": "Default Coordinates", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maven coordinates to use as default to grab if the message body is empty." }, "lazyStartProducer": { "kind": "parameter", "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 sta [...] diff --git a/components/camel-grape/src/main/docs/grape-component.adoc b/components/camel-grape/src/main/docs/grape-component.adoc index 33c2213..9c9557f 100644 --- a/components/camel-grape/src/main/docs/grape-component.adoc +++ b/components/camel-grape/src/main/docs/grape-component.adoc @@ -34,7 +34,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: START // endpoint options: END - +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == Setting up class loader @@ -109,17 +111,6 @@ String: producerTemplate.sendBody("grape:defaultMavenCoordinates", "org.apache.camel/camel-ftp/2.15.2".getBytes()); ----------------------------------------------------------------------------------------------------------- -== Headers - -The following headers are recognized by the Grape component: - -[width="100%",cols="10%,10%,10%,10%,60%",options="header",] -|======================================================================= -|Header |Java constant |Endpoint type |Value type |Description - -|`CamelGrapeCommand` |`GrapeConstants.GRAPE_COMMAND` |Producer |`org.apache.camel.component.grape.GrapeCommand` |The command to be performed by the Grape endpoint. Default to `grab`. -|======================================================================= - == Loading components at runtime In order to load the new component at the router runtime, just grab the diff --git a/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeConstants.java b/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeConstants.java index e885752..0c2d014 100644 --- a/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeConstants.java +++ b/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeConstants.java @@ -16,8 +16,12 @@ */ package org.apache.camel.component.grape; +import org.apache.camel.spi.Metadata; + public final class GrapeConstants { + @Metadata(description = "The command to be performed by the Grape endpoint.", + javaType = "org.apache.camel.component.grape.GrapeCommand", defaultValue = "grab") public static final String GRAPE_COMMAND = "CamelGrapeCommand"; private GrapeConstants() { diff --git a/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeEndpoint.java b/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeEndpoint.java index e020009..3a44962 100644 --- a/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeEndpoint.java +++ b/components/camel-grape/src/main/java/org/apache/camel/component/grape/GrapeEndpoint.java @@ -36,7 +36,7 @@ import org.codehaus.groovy.runtime.DefaultGroovyMethods; * Fetch, load and manage additional jars dynamically after Camel Context was started. */ @UriEndpoint(firstVersion = "2.16.0", scheme = "grape", syntax = "grape:defaultCoordinates", title = "Grape", - producerOnly = true, category = { Category.MANAGEMENT, Category.DEPLOYMENT }) + producerOnly = true, category = { Category.MANAGEMENT, Category.DEPLOYMENT }, headersClass = GrapeConstants.class) public class GrapeEndpoint extends DefaultEndpoint { @UriPath(description = "Maven coordinates to use as default to grab if the message body is empty.")
