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/04 13:40:43 UTC

[camel] 06/08: CAMEL-17792: Add doc about the message headers of camel-pubnub

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 b5081efbf0a10baa1a49c7f92f012a3a6b4a2eef
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Mon Apr 4 15:05:25 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-pubnub
---
 .../org/apache/camel/component/pubnub/pubnub.json          |  6 ++++++
 .../camel-pubnub/src/main/docs/pubnub-component.adoc       | 14 +++-----------
 .../org/apache/camel/component/pubnub/PubNubConstants.java |  6 ++++++
 .../org/apache/camel/component/pubnub/PubNubEndpoint.java  |  2 +-
 4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json b/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json
index 05dd87709be..4cf474fdca0 100644
--- a/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json
+++ b/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json
@@ -36,6 +36,12 @@
     "secure": { "kind": "property", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "Use SSL for secure transmission." },
     "subscribeKey": { "kind": "property", "displayName": "Subscribe Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The subscribe key obtained from your PubNub account. Required when subscribing to channels or listening for presence [...]
   },
+  "headers": {
+    "CamelPubNubOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform." },
+    "CamelPubNubTimeToken": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Timestamp for the event." },
+    "CamelPubNubChannel": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The channel for which the message belongs." },
+    "CamelPubNubUUID": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "UUID to be used as a device identifier." }
+  },
   "properties": {
     "channel": { "kind": "path", "displayName": "Channel", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The channel used for subscribing\/publishing events" },
     "uuid": { "kind": "parameter", "displayName": "Uuid", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "UUID to be used as a device identifier, a default UUID is generated if not passed." },
diff --git a/components/camel-pubnub/src/main/docs/pubnub-component.adoc b/components/camel-pubnub/src/main/docs/pubnub-component.adoc
index d92b4bded0a..f6bb8da94f3 100644
--- a/components/camel-pubnub/src/main/docs/pubnub-component.adoc
+++ b/components/camel-pubnub/src/main/docs/pubnub-component.adoc
@@ -58,17 +58,9 @@ include::partial$component-endpoint-options.adoc[]
 // endpoint options: START
 
 // endpoint options: END
-
-
-== Message headers when subscribing
-
-[width="100%",cols="20%,80%",options="header",]
-|=======================================================================
-|Name |Description
-|`CamelPubNubTimeToken` |The Timestamp for the event.
-|`CamelPubNubChannel` |The channel for which the message belongs.
-|=======================================================================
-
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Message body
 
diff --git a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConstants.java b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConstants.java
index 6f834622ace..8af38832d9c 100644
--- a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConstants.java
+++ b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConstants.java
@@ -16,9 +16,15 @@
  */
 package org.apache.camel.component.pubnub;
 
+import org.apache.camel.spi.Metadata;
+
 public abstract class PubNubConstants {
+    @Metadata(label = "producer", description = "The operation to perform.", javaType = "String")
     public static final String OPERATION = "CamelPubNubOperation";
+    @Metadata(description = "The Timestamp for the event.", javaType = "Long")
     public static final String TIMETOKEN = "CamelPubNubTimeToken";
+    @Metadata(label = "consumer", description = "The channel for which the message belongs.", javaType = "String")
     public static final String CHANNEL = "CamelPubNubChannel";
+    @Metadata(label = "producer", description = "UUID to be used as a device identifier.", javaType = "String")
     public static final String UUID = "CamelPubNubUUID";
 }
diff --git a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java
index 8bd06acebb5..8912e0da27f 100644
--- a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java
+++ b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java
@@ -32,7 +32,7 @@ import org.apache.camel.util.ObjectHelper;
  * Send and receive messages to/from PubNub data stream network for connected devices.
  */
 @UriEndpoint(firstVersion = "2.19.0", scheme = "pubnub", title = "PubNub", syntax = "pubnub:channel",
-             category = { Category.CLOUD, Category.IOT, Category.MESSAGING })
+             category = { Category.CLOUD, Category.IOT, Category.MESSAGING }, headersClass = PubNubConstants.class)
 public class PubNubEndpoint extends DefaultEndpoint {
 
     @UriParam(label = "advanced")