This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-4.0.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.0.x by this push: new e335662d80e CAMEL-20676: camel-snmp - Delay cannot be configured (#13791) e335662d80e is described below commit e335662d80e737280181800a98de2d56139802ab 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 ++-- 4 files changed, 7 insertions(+), 20 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 08f6580aaf2..292a68d5f5e 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 @@ -40,7 +40,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 occurred while the consumer is trying to pickup incoming messages, or the li [...] diff --git a/components/camel-snmp/src/generated/resources/org/apache/camel/component/snmp/snmp.json b/components/camel-snmp/src/generated/resources/org/apache/camel/component/snmp/snmp.json index 08f6580aaf2..292a68d5f5e 100644 --- a/components/camel-snmp/src/generated/resources/org/apache/camel/component/snmp/snmp.json +++ b/components/camel-snmp/src/generated/resources/org/apache/camel/component/snmp/snmp.json @@ -40,7 +40,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 occurred while the consumer is trying to pickup incoming messages, or the li [...] 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 a4eb17058dd..19f422ca012 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 b1f7b9b678b..75729679f3c 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: <code>long</code> 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 <code>long</code> type. *