This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new c1de3f7da35 CAMEL-20676: camel-snmp - Delay cannot be configured 
(#13791)
c1de3f7da35 is described below

commit c1de3f7da35cd0a2e40baac027879e15e2e59af8
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Apr 15 12:41:19 2024 +0200

    CAMEL-20676: camel-snmp - Delay cannot be configured (#13791)
---
 .../org/apache/camel/catalog/components/snmp.json     |  2 +-
 .../org/apache/camel/component/snmp/snmp.json         |  2 +-
 .../org/apache/camel/component/snmp/SnmpEndpoint.java | 19 +++----------------
 .../endpoint/dsl/SnmpEndpointBuilderFactory.java      |  4 ++--
 .../org/apache/camel/kotlin/components/SnmpUriDsl.kt  |  2 +-
 5 files changed, 8 insertions(+), 21 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/snmp.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/snmp.json
index a745c19d601..f1f5bfc28a2 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/snmp.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/snmp.json
@@ -41,7 +41,7 @@
     "snmpVersion": { "index": 8, "kind": "parameter", "displayName": "Snmp 
Version", "group": "common", "label": "", "required": false, "type": "integer", 
"javaType": "int", "enum": [ "0", "1", "3" ], "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 0, "description": "Sets the snmp 
version for the request. The value 0 means SNMPv1, 1 means SNMPv2c, and the 
value 3 means SNMPv3" },
     "timeout": { "index": 9, "kind": "parameter", "displayName": "Timeout", 
"group": "common", "label": "", "required": false, "type": "integer", 
"javaType": "int", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1500, "description": "Sets the timeout value for the request in 
millis." },
     "type": { "index": 10, "kind": "parameter", "displayName": "Type", 
"group": "common", "label": "", "required": false, "type": "object", 
"javaType": "org.apache.camel.component.snmp.SnmpActionType", "enum": [ "TRAP", 
"POLL", "GET_NEXT" ], "deprecated": false, "autowired": false, "secret": false, 
"description": "Which operation to perform such as poll, trap, etc." },
-    "delay": { "index": 11, "kind": "parameter", "displayName": "Delay", 
"group": "consumer", "label": "consumer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "60000", "description": "Sets update rate in 
seconds" },
+    "delay": { "index": 11, "kind": "parameter", "displayName": "Delay", 
"group": "consumer", "label": "consumer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "60000", "description": "Milliseconds before 
the next poll." },
     "sendEmptyMessageWhenIdle": { "index": 12, "kind": "parameter", 
"displayName": "Send Empty Message When Idle", "group": "consumer", "label": 
"consumer", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "If the polling consumer did not poll any files, you can 
enable this option to send an empty message (no body) instead." },
     "treeList": { "index": 13, "kind": "parameter", "displayName": "Tree 
List", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Sets the flag whether 
the scoped PDU will be displayed as the list if it has child elements in its 
tree" },
     "bridgeErrorHandler": { "index": 14, "kind": "parameter", "displayName": 
"Bridge Error Handler", "group": "consumer (advanced)", "label": 
"consumer,advanced", "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 (if possible) occurred 
while the Camel consumer is trying to pickup incoming [...]
diff --git 
a/components/camel-snmp/src/generated/resources/META-INF/org/apache/camel/component/snmp/snmp.json
 
b/components/camel-snmp/src/generated/resources/META-INF/org/apache/camel/component/snmp/snmp.json
index a745c19d601..f1f5bfc28a2 100644
--- 
a/components/camel-snmp/src/generated/resources/META-INF/org/apache/camel/component/snmp/snmp.json
+++ 
b/components/camel-snmp/src/generated/resources/META-INF/org/apache/camel/component/snmp/snmp.json
@@ -41,7 +41,7 @@
     "snmpVersion": { "index": 8, "kind": "parameter", "displayName": "Snmp 
Version", "group": "common", "label": "", "required": false, "type": "integer", 
"javaType": "int", "enum": [ "0", "1", "3" ], "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 0, "description": "Sets the snmp 
version for the request. The value 0 means SNMPv1, 1 means SNMPv2c, and the 
value 3 means SNMPv3" },
     "timeout": { "index": 9, "kind": "parameter", "displayName": "Timeout", 
"group": "common", "label": "", "required": false, "type": "integer", 
"javaType": "int", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1500, "description": "Sets the timeout value for the request in 
millis." },
     "type": { "index": 10, "kind": "parameter", "displayName": "Type", 
"group": "common", "label": "", "required": false, "type": "object", 
"javaType": "org.apache.camel.component.snmp.SnmpActionType", "enum": [ "TRAP", 
"POLL", "GET_NEXT" ], "deprecated": false, "autowired": false, "secret": false, 
"description": "Which operation to perform such as poll, trap, etc." },
-    "delay": { "index": 11, "kind": "parameter", "displayName": "Delay", 
"group": "consumer", "label": "consumer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "60000", "description": "Sets update rate in 
seconds" },
+    "delay": { "index": 11, "kind": "parameter", "displayName": "Delay", 
"group": "consumer", "label": "consumer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "60000", "description": "Milliseconds before 
the next poll." },
     "sendEmptyMessageWhenIdle": { "index": 12, "kind": "parameter", 
"displayName": "Send Empty Message When Idle", "group": "consumer", "label": 
"consumer", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "If the polling consumer did not poll any files, you can 
enable this option to send an empty message (no body) instead." },
     "treeList": { "index": 13, "kind": "parameter", "displayName": "Tree 
List", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Sets the flag whether 
the scoped PDU will be displayed as the list if it has child elements in its 
tree" },
     "bridgeErrorHandler": { "index": 14, "kind": "parameter", "displayName": 
"Bridge Error Handler", "group": "consumer (advanced)", "label": 
"consumer,advanced", "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 (if possible) occurred 
while the Camel consumer is trying to pickup incoming [...]
diff --git 
a/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
 
b/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
index fd453606954..d0500702ce2 100644
--- 
a/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
+++ 
b/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
@@ -68,7 +68,8 @@ public class SnmpEndpoint extends DefaultPollingEndpoint {
     private String snmpCommunity = DEFAULT_COMMUNITY;
     @UriParam
     private SnmpActionType type;
-    @UriParam(label = "consumer", defaultValue = "60000", javaType = 
"java.time.Duration")
+    @UriParam(label = "consumer", defaultValue = "60000", javaType = 
"java.time.Duration",
+              description = "Milliseconds before the next poll.")
     private long delay = 60000;
     @UriParam(defaultValue = "" + SecurityLevel.AUTH_PRIV, enums = "1,2,3", 
label = "security")
     private int securityLevel = SecurityLevel.AUTH_PRIV;
@@ -99,6 +100,7 @@ public class SnmpEndpoint extends DefaultPollingEndpoint {
      */
     public SnmpEndpoint(String uri, SnmpComponent component) {
         super(uri, component);
+        super.setDelay(60000);
     }
 
     @Override
@@ -148,21 +150,6 @@ public class SnmpEndpoint extends DefaultPollingEndpoint {
         // noop
     }
 
-    @Override
-    public long getDelay() {
-        return delay;
-    }
-
-    /**
-     * Sets update rate in seconds
-     *
-     * @param updateEvery the update rate in seconds
-     */
-    @Override
-    public void setDelay(long updateEvery) {
-        this.delay = updateEvery;
-    }
-
     public SnmpActionType getType() {
         return this.type;
     }
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SnmpEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SnmpEndpointBuilderFactory.java
index 38cc06b4f9f..5a1b0acd34b 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SnmpEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SnmpEndpointBuilderFactory.java
@@ -269,7 +269,7 @@ public interface SnmpEndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets update rate in seconds.
+         * Milliseconds before the next poll.
          * 
          * The option is a: &lt;code&gt;long&lt;/code&gt; type.
          * 
@@ -284,7 +284,7 @@ public interface SnmpEndpointBuilderFactory {
             return this;
         }
         /**
-         * Sets update rate in seconds.
+         * Milliseconds before the next poll.
          * 
          * The option will be converted to a &lt;code&gt;long&lt;/code&gt; 
type.
          * 
diff --git 
a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SnmpUriDsl.kt
 
b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SnmpUriDsl.kt
index 096de304a7c..1f637094f83 100644
--- 
a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SnmpUriDsl.kt
+++ 
b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SnmpUriDsl.kt
@@ -158,7 +158,7 @@ public class SnmpUriDsl(
   }
 
   /**
-   * Sets update rate in seconds
+   * Milliseconds before the next poll.
    */
   public fun delay(delay: String) {
     it.property("delay", delay)

Reply via email to