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/07 08:19:11 UTC

[camel] 01/01: CAMEL-17792: Add doc about the message headers of camel-gora

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 f970976a1b324ef352e721b16c546dedeb758053
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Apr 7 10:18:49 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-gora
---
 .../org/apache/camel/component/gora/gora.json          |  4 ++++
 .../camel-gora/src/main/docs/gora-component.adoc       | 18 +++++-------------
 .../org/apache/camel/component/gora/GoraAttribute.java |  5 +++++
 .../org/apache/camel/component/gora/GoraEndpoint.java  |  5 +++--
 4 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/components/camel-gora/src/generated/resources/org/apache/camel/component/gora/gora.json b/components/camel-gora/src/generated/resources/org/apache/camel/component/gora/gora.json
index 4b3eb640c07..0b168f75e66 100644
--- a/components/camel-gora/src/generated/resources/org/apache/camel/component/gora/gora.json
+++ b/components/camel-gora/src/generated/resources/org/apache/camel/component/gora/gora.json
@@ -26,6 +26,10 @@
     "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": {
+    "goraKey": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Used in order to define the datum key for the operations need it." },
+    "goraOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Used in order to define the operation to execute." }
+  },
   "properties": {
     "name": { "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.gora.GoraConfiguration", "configurationField": "configuration", "description": "Instance name" },
     "dataStoreClass": { "kind": "parameter", "displayName": "Data Store Class", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.gora.GoraConfiguration", "configurationField": "configuration", "description": "The type of the dataStore" },
diff --git a/components/camel-gora/src/main/docs/gora-component.adoc b/components/camel-gora/src/main/docs/gora-component.adoc
index abc0d08c28a..6a775bb2488 100644
--- a/components/camel-gora/src/main/docs/gora-component.adoc
+++ b/components/camel-gora/src/main/docs/gora-component.adoc
@@ -70,7 +70,7 @@ _Java DSL_
 to("gora:foobar?keyClass=java.lang.Long&valueClass=org.apache.camel.component.gora.generated.Pageview&dataStoreClass=org.apache.gora.hbase.store.HBaseStore")
 -------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-== Configuratiion
+== Configuration
 
 Using camel-gora needs some configuration. This mainly involve to
 configure the _AvroStore_ through the _gora.properties_ file and to
@@ -96,6 +96,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 
 == Supported Gora Operations
@@ -104,7 +107,7 @@ Supported operations include : *put*, *get*, *delete*, *getSchemaName*,
 *deleteSchema*, *createSchema*, *query*, *deleteByQuery*,
 *schemaExists*.
 
-Some of the operations require arguments while some others no. The
+Some operations require arguments while some others no. The
 arguments to operations could be either the _body_ of the _in_ message
 or defined in a header property. Below there is a list with some
 additional info for each operation.
@@ -136,17 +139,6 @@ hold the objects._
 datastore._
 |=======================================================================
 
-== Gora Headers
-
-[width="100%",cols="20%,80%",options="header",]
-|=======================================================================
-|Property |Description
-
-|GoraOperation |_Used in order to define the operation to execute._
-
-|GoraKey | _Used in order to define the datum key for the operations need it._
-|=======================================================================
-
 == Usage examples
 
 *Create Schema* _(XML DSL)_:
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java
index 0e75b552058..ca47d563ee9 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.gora;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Camel-Gora attributes
  */
@@ -24,11 +26,14 @@ public enum GoraAttribute {
     /**
      * Gora KEY attribute
      */
+    @Metadata(label = "producer", description = "Used in order to define the datum key for the operations need it.",
+              javaType = "Object")
     GORA_KEY("goraKey"),
 
     /**
      * Gora operation header name
      */
+    @Metadata(label = "producer", description = "Used in order to define the operation to execute.", javaType = "String")
     GORA_OPERATION("goraOperation"),
 
     /**
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
index 1d97fab91ff..df078ab0db6 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
@@ -30,7 +30,8 @@ import org.apache.gora.store.DataStore;
  * Access NoSQL databases using the Apache Gora framework.
  */
 @UriEndpoint(firstVersion = "2.14.0", scheme = "gora", title = "Gora", syntax = "gora:name",
-             category = { Category.DATABASE, Category.NOSQL, Category.BIGDATA })
+             category = { Category.DATABASE, Category.NOSQL, Category.BIGDATA }, headersClass = GoraAttribute.class,
+             headersNameProvider = "value")
 public class GoraEndpoint extends DefaultEndpoint {
 
     /**
@@ -39,7 +40,7 @@ public class GoraEndpoint extends DefaultEndpoint {
     private final DataStore<Object, Persistent> dataStore;
 
     /**
-     * Camel-Gora Endpoint Configuratopn
+     * Camel-Gora Endpoint Configuration
      */
     @UriParam
     private GoraConfiguration configuration;