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/03/17 18:32:17 UTC

[camel] 10/13: CAMEL-17792: Add doc about the message headers of camel-corda

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 3f4184915f1fb6c139d0d2ee323bda3df4f06ee6
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Mar 17 18:09:09 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-corda
---
 .../org/apache/camel/component/corda/corda.json         | 11 +++++++++++
 .../camel-corda/src/main/docs/corda-component.adoc      | 14 +++-----------
 .../apache/camel/component/corda/CordaConstants.java    | 17 +++++++++++++++++
 .../org/apache/camel/component/corda/CordaEndpoint.java |  2 +-
 4 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/components/camel-corda/src/generated/resources/org/apache/camel/component/corda/corda.json b/components/camel-corda/src/generated/resources/org/apache/camel/component/corda/corda.json
index 95645d7..3d814f9 100644
--- a/components/camel-corda/src/generated/resources/org/apache/camel/component/corda/corda.json
+++ b/components/camel-corda/src/generated/resources/org/apache/camel/component/corda/corda.json
@@ -37,6 +37,17 @@
     "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.corda.CordaConfiguration", "configurationField": "configuration", "description": "Password for login" },
     "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.corda.CordaConfiguration", "configurationField": "configuration", "description": "Username for login" }
   },
+  "headers": {
+    "OPERATION": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform" },
+    "ATTACHMENT_QUERY_CRITERIA": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "net.corda.core.node.services.vault.AttachmentQueryCriteria", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The attachment query criteria" },
+    "SORT": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sort" },
+    "EXACT_MATCH": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "If true, a case sensitive match is done against each component of each X.500 name." },
+    "ARGUMENTS": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The arguments." },
+    "DRAINING_MODE": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The value of the node's flows draining mode." },
+    "SECURE_HASH": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "net.corda.core.crypto.SecureHash", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Container for a cryptographically secure hash value." },
+    "QUERY_CRITERIA": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "net.corda.core.node.services.vault.QueryCriteria", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The query criteria." },
+    "PAGE_SPECIFICATION": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "net.corda.core.node.services.vault.PageSpecification", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The PageSpecification allows specification of a page number and page size" }
+  },
   "properties": {
     "node": { "kind": "path", "displayName": "Node", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.corda.CordaConfiguration", "configurationField": "configuration", "description": "The url for the corda node" },
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
diff --git a/components/camel-corda/src/main/docs/corda-component.adoc b/components/camel-corda/src/main/docs/corda-component.adoc
index 0a2a49c..f1a3032 100644
--- a/components/camel-corda/src/main/docs/corda-component.adoc
+++ b/components/camel-corda/src/main/docs/corda-component.adoc
@@ -50,17 +50,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
-
-== Message Headers
-
-[width="100%",cols="10%,90%",options="header",]
-|=======================================================================
-|Header |Description
-
-|`All URI options` |All URI options can also be set as exchange headers.
-
-|=======================================================================
-
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Samples
 
diff --git a/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConstants.java b/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConstants.java
index 7e6bf40..fd8a22a 100644
--- a/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConstants.java
+++ b/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConstants.java
@@ -16,7 +16,10 @@
  */
 package org.apache.camel.component.corda;
 
+import org.apache.camel.spi.Metadata;
+
 public interface CordaConstants {
+    @Metadata(label = "producer", description = "The operation to perform", javaType = "String")
     String OPERATION = "OPERATION";
     String NODE_INFO = "NODE_INFO";
     String CURRENT_NODE_TIME = "CURRENT_NODE_TIME";
@@ -58,13 +61,27 @@ public interface CordaConstants {
     String STATE_MACHINE_RECORDED_TRANSACTION_MAPPING_FEED = "STATE_MACHINE_RECORDED_TRANSACTION_MAPPING_FEED";
     String START_TRACKED_FLOW_DYNAMIC = "START_TRACKED_FLOW_DYNAMIC";
 
+    @Metadata(label = "producer", description = "The attachment query criteria",
+              javaType = "net.corda.core.node.services.vault.AttachmentQueryCriteria")
     String ATTACHMENT_QUERY_CRITERIA = "ATTACHMENT_QUERY_CRITERIA";
+    @Metadata(label = "producer", description = "The sort")
     String SORT = "SORT";
+    @Metadata(label = "producer",
+              description = "If true, a case sensitive match is done against each component of each X.500 name.",
+              javaType = "Boolean")
     String EXACT_MATCH = "EXACT_MATCH";
+    @Metadata(label = "producer", description = "The arguments.", javaType = "Object[]")
     String ARGUMENTS = "ARGUMENTS";
+    @Metadata(label = "producer", description = "The value of the node's flows draining mode.", javaType = "Boolean")
     String DRAINING_MODE = "DRAINING_MODE";
+    @Metadata(label = "producer", description = "Container for a cryptographically secure hash value.",
+              javaType = "net.corda.core.crypto.SecureHash")
     String SECURE_HASH = "SECURE_HASH";
+    @Metadata(label = "producer", description = "The query criteria.",
+              javaType = "net.corda.core.node.services.vault.QueryCriteria")
     String QUERY_CRITERIA = "QUERY_CRITERIA";
+    @Metadata(label = "producer", description = "The PageSpecification allows specification of a page number and page size",
+              javaType = "net.corda.core.node.services.vault.PageSpecification")
     String PAGE_SPECIFICATION = "PAGE_SPECIFICATION";
 
     String TERMINATE = "TERMINATE";
diff --git a/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaEndpoint.java b/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaEndpoint.java
index d771a45..dcb4b0c 100644
--- a/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaEndpoint.java
+++ b/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaEndpoint.java
@@ -32,7 +32,7 @@ import org.apache.camel.support.DefaultEndpoint;
  * Perform operations against Corda blockchain platform using corda-rpc library.
  */
 @UriEndpoint(firstVersion = "2.23.0", scheme = "corda", title = "Corda", syntax = "corda:node",
-             category = { Category.BLOCKCHAIN, Category.RPC })
+             category = { Category.BLOCKCHAIN, Category.RPC }, headersClass = CordaConstants.class)
 public class CordaEndpoint extends DefaultEndpoint {
 
     @UriParam