From 8c6a76f4c8a45f577bb4b6558fd63547251e5921 Mon Sep 17 00:00:00 2001 From: Croway Date: Fri, 13 Feb 2026 10:26:50 +0100 Subject: [PATCH] CAMEL-23000: camel-ssh - idleTimeout --- .../apache/camel/catalog/components/ssh.json | 82 ++++----- .../component/ssh/SshComponentConfigurer.java | 6 + .../component/ssh/SshEndpointConfigurer.java | 6 + .../component/ssh/SshEndpointUriFactory.java | 3 +- .../org/apache/camel/component/ssh/ssh.json | 82 ++++----- .../camel/component/ssh/SshConfiguration.java | 16 ++ .../camel/component/ssh/SshConsumer.java | 12 +- .../camel/component/ssh/SshProducer.java | 11 +- .../apache/camel/component/ssh/SshUtils.java | 17 ++ .../ssh/DelayedEchoCommandFactory.java | 112 ++++++++++++ .../component/ssh/SshIdleTimeoutTest.java | 159 ++++++++++++++++++ .../dsl/SshComponentBuilderFactory.java | 18 ++ .../dsl/SshEndpointBuilderFactory.java | 96 +++++++++++ 13 files changed, 518 insertions(+), 102 deletions(-) create mode 100644 components/camel-ssh/src/test/java/org/apache/camel/component/ssh/DelayedEchoCommandFactory.java create mode 100644 components/camel-ssh/src/test/java/org/apache/camel/component/ssh/SshIdleTimeoutTest.java diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ssh.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ssh.json index 1d3cf85ec9585..a304cd37b8dd7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ssh.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ssh.json @@ -36,20 +36,21 @@ "clientBuilder": { "index": 8, "kind": "property", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.sshd.client.ClientBuilder", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Instance of ClientBuilder used by the producer or consumer to create a new SshClient" }, "compressions": { "index": 9, "kind": "property", "displayName": "Compressions", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Whether to use compression, and if so which." }, "configuration": { "index": 10, "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.ssh.SshConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" }, - "shellPrompt": { "index": 11, "kind": "property", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, - "sleepForShellPrompt": { "index": 12, "kind": "property", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, - "healthCheckConsumerEnabled": { "index": 13, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, - "healthCheckProducerEnabled": { "index": 14, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." }, - "certResource": { "index": 15, "kind": "property", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, - "certResourcePassword": { "index": 16, "kind": "property", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, - "ciphers": { "index": 17, "kind": "property", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, - "kex": { "index": 18, "kind": "property", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, - "keyPairProvider": { "index": 19, "kind": "property", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, - "keyType": { "index": 20, "kind": "property", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, - "macs": { "index": 21, "kind": "property", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, - "password": { "index": 22, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, - "signatures": { "index": 23, "kind": "property", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, - "username": { "index": 24, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } + "idleTimeout": { "index": 11, "kind": "property", "displayName": "Idle Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the timeout in milliseconds to wait before the SSH session is closed due to inactivity. The default value is 0, which means no idle timeout is applied." }, + "shellPrompt": { "index": 12, "kind": "property", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, + "sleepForShellPrompt": { "index": 13, "kind": "property", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, + "healthCheckConsumerEnabled": { "index": 14, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 15, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." }, + "certResource": { "index": 16, "kind": "property", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, + "certResourcePassword": { "index": 17, "kind": "property", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, + "ciphers": { "index": 18, "kind": "property", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, + "kex": { "index": 19, "kind": "property", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, + "keyPairProvider": { "index": 20, "kind": "property", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, + "keyType": { "index": 21, "kind": "property", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, + "macs": { "index": 22, "kind": "property", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, + "password": { "index": 23, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, + "signatures": { "index": 24, "kind": "property", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, + "username": { "index": 25, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } }, "headers": { "CamelSshUsername": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The user name", "constantName": "org.apache.camel.component.ssh.SshConstants#USERNAME_HEADER" }, @@ -73,31 +74,32 @@ "channelType": { "index": 12, "kind": "parameter", "displayName": "Channel Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "exec", "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the channel type to pass to the Channel as part of command execution. Defaults to exec." }, "clientBuilder": { "index": 13, "kind": "parameter", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.sshd.client.ClientBuilder", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Instance of ClientBuilder used by the producer or consumer to create a new SshClient" }, "compressions": { "index": 14, "kind": "parameter", "displayName": "Compressions", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Whether to use compression, and if so which." }, - "shellPrompt": { "index": 15, "kind": "parameter", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, - "sleepForShellPrompt": { "index": 16, "kind": "parameter", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, - "backoffErrorThreshold": { "index": 17, "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." }, - "backoffIdleThreshold": { "index": 18, "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." }, - "backoffMultiplier": { "index": 19, "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and\/or backoffErrorThreshold must also be configured." }, - "delay": { "index": 20, "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." }, - "greedy": { "index": 21, "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." }, - "initialDelay": { "index": 22, "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." }, - "repeatCount": { "index": 23, "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, - "runLoggingLevel": { "index": 24, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level for that." }, - "scheduledExecutorService": { "index": 25, "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." }, - "scheduler": { "index": 26, "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" }, - "schedulerProperties": { "index": 27, "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. This is a multi-value option with prefix: scheduler." }, - "startScheduler": { "index": 28, "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, - "timeUnit": { "index": 29, "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, - "useFixedDelay": { "index": 30, "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, - "certResource": { "index": 31, "kind": "parameter", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, - "certResourcePassword": { "index": 32, "kind": "parameter", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, - "ciphers": { "index": 33, "kind": "parameter", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, - "kex": { "index": 34, "kind": "parameter", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, - "keyPairProvider": { "index": 35, "kind": "parameter", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, - "keyType": { "index": 36, "kind": "parameter", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, - "macs": { "index": 37, "kind": "parameter", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, - "password": { "index": 38, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, - "signatures": { "index": 39, "kind": "parameter", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, - "username": { "index": 40, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } + "idleTimeout": { "index": 15, "kind": "parameter", "displayName": "Idle Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the timeout in milliseconds to wait before the SSH session is closed due to inactivity. The default value is 0, which means no idle timeout is applied." }, + "shellPrompt": { "index": 16, "kind": "parameter", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, + "sleepForShellPrompt": { "index": 17, "kind": "parameter", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, + "backoffErrorThreshold": { "index": 18, "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." }, + "backoffIdleThreshold": { "index": 19, "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." }, + "backoffMultiplier": { "index": 20, "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and\/or backoffErrorThreshold must also be configured." }, + "delay": { "index": 21, "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." }, + "greedy": { "index": 22, "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." }, + "initialDelay": { "index": 23, "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." }, + "repeatCount": { "index": 24, "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, + "runLoggingLevel": { "index": 25, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level for that." }, + "scheduledExecutorService": { "index": 26, "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." }, + "scheduler": { "index": 27, "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" }, + "schedulerProperties": { "index": 28, "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. This is a multi-value option with prefix: scheduler." }, + "startScheduler": { "index": 29, "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, + "timeUnit": { "index": 30, "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, + "useFixedDelay": { "index": 31, "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, + "certResource": { "index": 32, "kind": "parameter", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, + "certResourcePassword": { "index": 33, "kind": "parameter", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, + "ciphers": { "index": 34, "kind": "parameter", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, + "kex": { "index": 35, "kind": "parameter", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, + "keyPairProvider": { "index": 36, "kind": "parameter", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, + "keyType": { "index": 37, "kind": "parameter", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, + "macs": { "index": 38, "kind": "parameter", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, + "password": { "index": 39, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, + "signatures": { "index": 40, "kind": "parameter", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, + "username": { "index": 41, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } } } diff --git a/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshComponentConfigurer.java b/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshComponentConfigurer.java index 26d4514b49af8..bc65f5aa177c6 100644 --- a/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshComponentConfigurer.java +++ b/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshComponentConfigurer.java @@ -51,6 +51,8 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj case "healthCheckConsumerEnabled": target.setHealthCheckConsumerEnabled(property(camelContext, boolean.class, value)); return true; case "healthcheckproducerenabled": case "healthCheckProducerEnabled": target.setHealthCheckProducerEnabled(property(camelContext, boolean.class, value)); return true; + case "idletimeout": + case "idleTimeout": getOrCreateConfiguration(target).setIdleTimeout(property(camelContext, long.class, value)); return true; case "kex": getOrCreateConfiguration(target).setKex(property(camelContext, java.lang.String.class, value)); return true; case "keypairprovider": case "keyPairProvider": getOrCreateConfiguration(target).setKeyPairProvider(property(camelContext, org.apache.sshd.common.keyprovider.KeyPairProvider.class, value)); return true; @@ -104,6 +106,8 @@ public Class getOptionType(String name, boolean ignoreCase) { case "healthCheckConsumerEnabled": return boolean.class; case "healthcheckproducerenabled": case "healthCheckProducerEnabled": return boolean.class; + case "idletimeout": + case "idleTimeout": return long.class; case "kex": return java.lang.String.class; case "keypairprovider": case "keyPairProvider": return org.apache.sshd.common.keyprovider.KeyPairProvider.class; @@ -153,6 +157,8 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { case "healthCheckConsumerEnabled": return target.isHealthCheckConsumerEnabled(); case "healthcheckproducerenabled": case "healthCheckProducerEnabled": return target.isHealthCheckProducerEnabled(); + case "idletimeout": + case "idleTimeout": return getOrCreateConfiguration(target).getIdleTimeout(); case "kex": return getOrCreateConfiguration(target).getKex(); case "keypairprovider": case "keyPairProvider": return getOrCreateConfiguration(target).getKeyPairProvider(); diff --git a/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointConfigurer.java b/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointConfigurer.java index 8a984245b764b..0979b3ccc0f28 100644 --- a/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointConfigurer.java +++ b/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointConfigurer.java @@ -49,6 +49,8 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj case "failonunknownhost": case "failOnUnknownHost": target.getConfiguration().setFailOnUnknownHost(property(camelContext, boolean.class, value)); return true; case "greedy": target.setGreedy(property(camelContext, boolean.class, value)); return true; + case "idletimeout": + case "idleTimeout": target.getConfiguration().setIdleTimeout(property(camelContext, long.class, value)); return true; case "initialdelay": case "initialDelay": target.setInitialDelay(property(camelContext, long.class, value)); return true; case "kex": target.getConfiguration().setKex(property(camelContext, java.lang.String.class, value)); return true; @@ -128,6 +130,8 @@ public Class getOptionType(String name, boolean ignoreCase) { case "failonunknownhost": case "failOnUnknownHost": return boolean.class; case "greedy": return boolean.class; + case "idletimeout": + case "idleTimeout": return long.class; case "initialdelay": case "initialDelay": return long.class; case "kex": return java.lang.String.class; @@ -203,6 +207,8 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { case "failonunknownhost": case "failOnUnknownHost": return target.getConfiguration().isFailOnUnknownHost(); case "greedy": return target.isGreedy(); + case "idletimeout": + case "idleTimeout": return target.getConfiguration().getIdleTimeout(); case "initialdelay": case "initialDelay": return target.getInitialDelay(); case "kex": return target.getConfiguration().getKex(); diff --git a/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointUriFactory.java b/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointUriFactory.java index 9ea92bc46be85..4dcff074f1ab4 100644 --- a/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointUriFactory.java +++ b/components/camel-ssh/src/generated/java/org/apache/camel/component/ssh/SshEndpointUriFactory.java @@ -23,7 +23,7 @@ public class SshEndpointUriFactory extends org.apache.camel.support.component.En private static final Set SECRET_PROPERTY_NAMES; private static final Map MULTI_VALUE_PREFIXES; static { - Set props = new HashSet<>(41); + Set props = new HashSet<>(42); props.add("backoffErrorThreshold"); props.add("backoffIdleThreshold"); props.add("backoffMultiplier"); @@ -40,6 +40,7 @@ public class SshEndpointUriFactory extends org.apache.camel.support.component.En props.add("failOnUnknownHost"); props.add("greedy"); props.add("host"); + props.add("idleTimeout"); props.add("initialDelay"); props.add("kex"); props.add("keyPairProvider"); diff --git a/components/camel-ssh/src/generated/resources/META-INF/org/apache/camel/component/ssh/ssh.json b/components/camel-ssh/src/generated/resources/META-INF/org/apache/camel/component/ssh/ssh.json index 1d3cf85ec9585..a304cd37b8dd7 100644 --- a/components/camel-ssh/src/generated/resources/META-INF/org/apache/camel/component/ssh/ssh.json +++ b/components/camel-ssh/src/generated/resources/META-INF/org/apache/camel/component/ssh/ssh.json @@ -36,20 +36,21 @@ "clientBuilder": { "index": 8, "kind": "property", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.sshd.client.ClientBuilder", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Instance of ClientBuilder used by the producer or consumer to create a new SshClient" }, "compressions": { "index": 9, "kind": "property", "displayName": "Compressions", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Whether to use compression, and if so which." }, "configuration": { "index": 10, "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.ssh.SshConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" }, - "shellPrompt": { "index": 11, "kind": "property", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, - "sleepForShellPrompt": { "index": 12, "kind": "property", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, - "healthCheckConsumerEnabled": { "index": 13, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, - "healthCheckProducerEnabled": { "index": 14, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." }, - "certResource": { "index": 15, "kind": "property", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, - "certResourcePassword": { "index": 16, "kind": "property", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, - "ciphers": { "index": 17, "kind": "property", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, - "kex": { "index": 18, "kind": "property", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, - "keyPairProvider": { "index": 19, "kind": "property", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, - "keyType": { "index": 20, "kind": "property", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, - "macs": { "index": 21, "kind": "property", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, - "password": { "index": 22, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, - "signatures": { "index": 23, "kind": "property", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, - "username": { "index": 24, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } + "idleTimeout": { "index": 11, "kind": "property", "displayName": "Idle Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the timeout in milliseconds to wait before the SSH session is closed due to inactivity. The default value is 0, which means no idle timeout is applied." }, + "shellPrompt": { "index": 12, "kind": "property", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, + "sleepForShellPrompt": { "index": 13, "kind": "property", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, + "healthCheckConsumerEnabled": { "index": 14, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 15, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." }, + "certResource": { "index": 16, "kind": "property", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, + "certResourcePassword": { "index": 17, "kind": "property", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, + "ciphers": { "index": 18, "kind": "property", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, + "kex": { "index": 19, "kind": "property", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, + "keyPairProvider": { "index": 20, "kind": "property", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, + "keyType": { "index": 21, "kind": "property", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, + "macs": { "index": 22, "kind": "property", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, + "password": { "index": 23, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, + "signatures": { "index": 24, "kind": "property", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, + "username": { "index": 25, "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } }, "headers": { "CamelSshUsername": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The user name", "constantName": "org.apache.camel.component.ssh.SshConstants#USERNAME_HEADER" }, @@ -73,31 +74,32 @@ "channelType": { "index": 12, "kind": "parameter", "displayName": "Channel Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "exec", "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the channel type to pass to the Channel as part of command execution. Defaults to exec." }, "clientBuilder": { "index": 13, "kind": "parameter", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.sshd.client.ClientBuilder", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Instance of ClientBuilder used by the producer or consumer to create a new SshClient" }, "compressions": { "index": 14, "kind": "parameter", "displayName": "Compressions", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Whether to use compression, and if so which." }, - "shellPrompt": { "index": 15, "kind": "parameter", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, - "sleepForShellPrompt": { "index": 16, "kind": "parameter", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, - "backoffErrorThreshold": { "index": 17, "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." }, - "backoffIdleThreshold": { "index": 18, "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." }, - "backoffMultiplier": { "index": 19, "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and\/or backoffErrorThreshold must also be configured." }, - "delay": { "index": 20, "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." }, - "greedy": { "index": 21, "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." }, - "initialDelay": { "index": 22, "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." }, - "repeatCount": { "index": 23, "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, - "runLoggingLevel": { "index": 24, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level for that." }, - "scheduledExecutorService": { "index": 25, "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." }, - "scheduler": { "index": 26, "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" }, - "schedulerProperties": { "index": 27, "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. This is a multi-value option with prefix: scheduler." }, - "startScheduler": { "index": 28, "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, - "timeUnit": { "index": 29, "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, - "useFixedDelay": { "index": 30, "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, - "certResource": { "index": 31, "kind": "parameter", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, - "certResourcePassword": { "index": 32, "kind": "parameter", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, - "ciphers": { "index": 33, "kind": "parameter", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, - "kex": { "index": 34, "kind": "parameter", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, - "keyPairProvider": { "index": 35, "kind": "parameter", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, - "keyType": { "index": 36, "kind": "parameter", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, - "macs": { "index": 37, "kind": "parameter", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, - "password": { "index": 38, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, - "signatures": { "index": 39, "kind": "parameter", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, - "username": { "index": 40, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } + "idleTimeout": { "index": 15, "kind": "parameter", "displayName": "Idle Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the timeout in milliseconds to wait before the SSH session is closed due to inactivity. The default value is 0, which means no idle timeout is applied." }, + "shellPrompt": { "index": 16, "kind": "parameter", "displayName": "Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the shellPrompt to be dropped when response is read after command execution" }, + "sleepForShellPrompt": { "index": 17, "kind": "parameter", "displayName": "Sleep For Shell Prompt", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds." }, + "backoffErrorThreshold": { "index": 18, "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." }, + "backoffIdleThreshold": { "index": 19, "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." }, + "backoffMultiplier": { "index": 20, "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and\/or backoffErrorThreshold must also be configured." }, + "delay": { "index": 21, "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." }, + "greedy": { "index": 22, "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." }, + "initialDelay": { "index": 23, "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." }, + "repeatCount": { "index": 24, "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, + "runLoggingLevel": { "index": 25, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level for that." }, + "scheduledExecutorService": { "index": 26, "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." }, + "scheduler": { "index": 27, "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" }, + "schedulerProperties": { "index": 28, "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. This is a multi-value option with prefix: scheduler." }, + "startScheduler": { "index": 29, "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, + "timeUnit": { "index": 30, "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, + "useFixedDelay": { "index": 31, "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, + "certResource": { "index": 32, "kind": "parameter", "displayName": "Cert Resource", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting." }, + "certResourcePassword": { "index": 33, "kind": "parameter", "displayName": "Cert Resource Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in loading certResource, if certResource is an encrypted key." }, + "ciphers": { "index": 34, "kind": "parameter", "displayName": "Ciphers", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported ciphers in their order of preference." }, + "kex": { "index": 35, "kind": "parameter", "displayName": "Kex", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported key exchange algorithms in their order of preference." }, + "keyPairProvider": { "index": 36, "kind": "parameter", "displayName": "Key Pair Provider", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.sshd.common.keyprovider.KeyPairProvider", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server." }, + "keyType": { "index": 37, "kind": "parameter", "displayName": "Key Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 \/ 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default." }, + "macs": { "index": 38, "kind": "parameter", "displayName": "Macs", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection." }, + "password": { "index": 39, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null." }, + "signatures": { "index": 40, "kind": "parameter", "displayName": "Signatures", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ssh.SshConfiguration", "configurationField": "configuration", "description": "Comma-separated list of allowed\/supported signature algorithms in their order of preference." }, + "username": { "index": 41, "kind": "parameter", "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.ssh.SshConfiguration", "configurationField": "configuration", "description": "Sets the username to use in logging into the remote SSH server." } } } diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java index 637c91f88e5bf..871fda4d83a16 100644 --- a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java @@ -74,6 +74,8 @@ public class SshConfiguration implements Cloneable { private String signatures; @UriParam(label = "advanced") private String compressions; + @UriParam(label = "advanced") + private long idleTimeout; @UriParam @Metadata(label = "advanced", autowired = true) private ClientBuilder clientBuilder; @@ -396,6 +398,20 @@ public void setCompressions(String compressions) { this.compressions = compressions; } + public long getIdleTimeout() { + return idleTimeout; + } + + /** + * Sets the timeout in milliseconds to wait before the SSH session is closed due to inactivity. The default value is + * 0, which means no idle timeout is applied. + * + * @param idleTimeout long milliseconds to wait before the session is closed due to inactivity. + */ + public void setIdleTimeout(long idleTimeout) { + this.idleTimeout = idleTimeout; + } + public ClientBuilder getClientBuilder() { return clientBuilder; } diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConsumer.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConsumer.java index 40e6c86d18dbb..b59c26712761a 100644 --- a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConsumer.java +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConsumer.java @@ -21,8 +21,6 @@ import org.apache.camel.support.ScheduledPollConsumer; import org.apache.sshd.client.SshClient; -import static org.apache.camel.component.ssh.SshUtils.*; - public class SshConsumer extends ScheduledPollConsumer { private final SshEndpoint endpoint; @@ -35,15 +33,7 @@ public SshConsumer(SshEndpoint endpoint, Processor processor) { @Override protected void doStart() throws Exception { - if (this.endpoint.getConfiguration() == null || this.endpoint.getConfiguration().getClientBuilder() == null) { - client = SshClient.setUpDefaultClient(); - } else { - client = this.endpoint.getConfiguration().getClientBuilder().build(true); - } - SshConfiguration configuration = endpoint.getConfiguration(); - configureAlgorithms(configuration, client); - - client.start(); + client = SshUtils.createAndStartClient(endpoint.getConfiguration()); super.doStart(); } diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshProducer.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshProducer.java index 0fd9cccd171a3..850bb794d2e85 100644 --- a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshProducer.java +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshProducer.java @@ -24,8 +24,6 @@ import org.apache.camel.support.DefaultProducer; import org.apache.sshd.client.SshClient; -import static org.apache.camel.component.ssh.SshUtils.*; - public class SshProducer extends DefaultProducer { private SshEndpoint endpoint; private SshClient client; @@ -37,14 +35,7 @@ public SshProducer(SshEndpoint endpoint) { @Override protected void doStart() throws Exception { - if (this.endpoint.getConfiguration() == null || this.endpoint.getConfiguration().getClientBuilder() == null) { - client = SshClient.setUpDefaultClient(); - } else { - client = this.endpoint.getConfiguration().getClientBuilder().build(true); - } - SshConfiguration configuration = endpoint.getConfiguration(); - configureAlgorithms(configuration, client); - client.start(); + client = SshUtils.createAndStartClient(endpoint.getConfiguration()); super.doStart(); } diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshUtils.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshUtils.java index 394201434cefe..86476082b50ca 100644 --- a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshUtils.java +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshUtils.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.ssh; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -43,6 +44,7 @@ import org.apache.sshd.common.signature.BuiltinSignatures; import org.apache.sshd.common.signature.Signature; import org.apache.sshd.common.signature.SignatureFactory; +import org.apache.sshd.core.CoreModuleProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -168,4 +170,19 @@ public static void configureAlgorithms(SshConfiguration configuration, SshClient configureCompressions(configuration.getCompressions(), client); } + public static SshClient createAndStartClient(SshConfiguration configuration) throws Exception { + SshClient client; + if (configuration == null || configuration.getClientBuilder() == null) { + client = SshClient.setUpDefaultClient(); + } else { + client = configuration.getClientBuilder().build(true); + } + configureAlgorithms(configuration, client); + if (configuration.getIdleTimeout() > 0) { + CoreModuleProperties.IDLE_TIMEOUT.set(client, Duration.ofMillis(configuration.getIdleTimeout())); + } + client.start(); + return client; + } + } diff --git a/components/camel-ssh/src/test/java/org/apache/camel/component/ssh/DelayedEchoCommandFactory.java b/components/camel-ssh/src/test/java/org/apache/camel/component/ssh/DelayedEchoCommandFactory.java new file mode 100644 index 0000000000000..913437e6a0cbc --- /dev/null +++ b/components/camel-ssh/src/test/java/org/apache/camel/component/ssh/DelayedEchoCommandFactory.java @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.ssh; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.apache.sshd.server.Environment; +import org.apache.sshd.server.ExitCallback; +import org.apache.sshd.server.channel.ChannelSession; +import org.apache.sshd.server.command.Command; +import org.apache.sshd.server.command.CommandFactory; + +/** + * A command factory that introduces a delay before echoing the command back. Used to test idle timeout behavior — if + * the client's idle timeout is shorter than the delay, the session will be closed before the command completes. + */ +public class DelayedEchoCommandFactory implements CommandFactory { + + private final long delayMs; + + public DelayedEchoCommandFactory(long delayMs) { + this.delayMs = delayMs; + } + + @Override + public Command createCommand(ChannelSession channelSession, String command) { + return new DelayedEchoCommand(command, delayMs); + } + + protected static class DelayedEchoCommand implements Command, Runnable { + private final String command; + private final long delayMs; + private OutputStream out; + private OutputStream err; + private ExitCallback callback; + private Thread thread; + + public DelayedEchoCommand(String command, long delayMs) { + this.command = command; + this.delayMs = delayMs; + } + + @Override + public void setInputStream(InputStream in) { + } + + @Override + public void setOutputStream(OutputStream out) { + this.out = out; + } + + @Override + public void setErrorStream(OutputStream err) { + this.err = err; + } + + @Override + public void setExitCallback(ExitCallback callback) { + this.callback = callback; + } + + @Override + public void start(ChannelSession channelSession, Environment environment) throws IOException { + thread = new Thread(this, "DelayedEchoCommand"); + thread.start(); + } + + @Override + public void destroy(ChannelSession channelSession) throws Exception { + // noop + } + + @Override + public void run() { + boolean succeeded = true; + String message = null; + try { + Thread.sleep(delayMs); + err.write("Error:".getBytes()); + err.write(command.getBytes()); + err.flush(); + out.write(command.getBytes()); + out.flush(); + } catch (Exception e) { + succeeded = false; + message = e.toString(); + } finally { + if (succeeded) { + callback.onExit(0); + } else { + callback.onExit(1, message); + } + } + } + } +} diff --git a/components/camel-ssh/src/test/java/org/apache/camel/component/ssh/SshIdleTimeoutTest.java b/components/camel-ssh/src/test/java/org/apache/camel/component/ssh/SshIdleTimeoutTest.java new file mode 100644 index 0000000000000..2ac79edd7b083 --- /dev/null +++ b/components/camel-ssh/src/test/java/org/apache/camel/component/ssh/SshIdleTimeoutTest.java @@ -0,0 +1,159 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.ssh; + +import java.nio.file.Paths; +import java.time.Duration; +import java.util.Optional; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.AvailablePortFinder; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.sshd.client.SshClient; +import org.apache.sshd.common.keyprovider.FileKeyPairProvider; +import org.apache.sshd.core.CoreModuleProperties; +import org.apache.sshd.server.SshServer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class SshIdleTimeoutTest extends SshComponentTestSupport { + + private int delayedPort = AvailablePortFinder.getNextAvailable(); + private SshServer delayedSshd; + + @AfterEach + public void stopDelayedServer() throws Exception { + if (delayedSshd != null) { + delayedSshd.stop(true); + delayedSshd = null; + } + } + + @Test + public void testProducerWithIdleTimeout() throws Exception { + final String msg = "test"; + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + mock.expectedBodiesReceived(msg); + mock.expectedHeaderReceived(SshConstants.EXIT_VALUE, 0); + mock.expectedHeaderReceived(SshConstants.STDERR, "Error:test"); + + template.sendBody("direct:sshWithIdleTimeout", msg); + + MockEndpoint.assertIsSatisfied(context); + } + + @Test + public void testProducerIdleTimeoutAppliedToClient() throws Exception { + SshEndpoint endpoint = context.getEndpoint( + "ssh://smx:smx@localhost:" + port + "?timeout=3000&idleTimeout=60000", SshEndpoint.class); + SshProducer producer = (SshProducer) endpoint.createProducer(); + producer.start(); + SshClient client = (SshClient) FieldUtils.readField(producer, "client", true); + + Optional idleTimeout = CoreModuleProperties.IDLE_TIMEOUT.get(client); + Assertions.assertTrue(idleTimeout.isPresent(), "Idle timeout should be set"); + Assertions.assertEquals(Duration.ofMillis(60000), idleTimeout.get()); + } + + @Test + public void testConsumerIdleTimeoutAppliedToClient() throws Exception { + SshEndpoint endpoint = context.getEndpoint( + "ssh://smx:smx@localhost:" + port + "?timeout=3000&idleTimeout=60000", SshEndpoint.class); + SshConsumer consumer = (SshConsumer) endpoint.createConsumer(x -> { + }); + consumer.start(); + SshClient client = (SshClient) FieldUtils.readField(consumer, "client", true); + + Optional idleTimeout = CoreModuleProperties.IDLE_TIMEOUT.get(client); + Assertions.assertTrue(idleTimeout.isPresent(), "Idle timeout should be set"); + Assertions.assertEquals(Duration.ofMillis(60000), idleTimeout.get()); + } + + @Test + public void testDefaultNoIdleTimeoutOnClient() throws Exception { + SshEndpoint endpoint = context.getEndpoint( + "ssh://smx:smx@localhost:" + port + "?timeout=3000", SshEndpoint.class); + SshProducer producer = (SshProducer) endpoint.createProducer(); + producer.start(); + SshClient client = (SshClient) FieldUtils.readField(producer, "client", true); + + Duration idleTimeout = CoreModuleProperties.IDLE_TIMEOUT.getOrNull(client); + Assertions.assertNull(idleTimeout, "Idle timeout should not be explicitly set by default"); + } + + private void startDelayedServer() throws Exception { + delayedSshd = SshServer.setUpDefaultServer(); + delayedSshd.setPort(delayedPort); + delayedSshd.setKeyPairProvider(new FileKeyPairProvider(Paths.get("src/test/resources/hostkey.pem"))); + delayedSshd.setCommandFactory(new DelayedEchoCommandFactory(1000)); + delayedSshd.setPasswordAuthenticator((username, password, session) -> true); + delayedSshd.setPublickeyAuthenticator((username, key, session) -> true); + delayedSshd.start(); + } + + @Test + public void testIdleTimeoutExpiresBeforeCommandCompletes() throws Exception { + startDelayedServer(); + // Send the command using a producer with idleTimeout=500ms. + // The client's idle timeout fires during the 3s command delay, + // closing the session before the command completes. + Exchange exchange = template.send( + "direct:sshWithShortIdleTimeout", + e -> e.getIn().setBody("test")); + + // The channel is closed before the command completes, so exit status is null. + Object exitValue = exchange.getMessage().getHeader(SshConstants.EXIT_VALUE); + Assertions.assertNull(exitValue, + "Exit value should be null because the session was closed by idle timeout before the command completed"); + } + + @Test + public void testIdleTimeoutLongerThanCommandDelay() throws Exception { + startDelayedServer(); + // Send the command using a producer with idleTimeout=5000ms. + // The command delay (3s) completes before the idle timeout fires. + Exchange exchange = template.send( + "direct:sshWithLongIdleTimeout", + e -> e.getIn().setBody("test")); + + Object exitValue = exchange.getMessage().getHeader(SshConstants.EXIT_VALUE); + Assertions.assertEquals(0, exitValue, + "Exit value should be 0 because the idle timeout is longer than the command delay"); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:sshWithIdleTimeout") + .to("ssh://smx:smx@localhost:" + port + "?timeout=3000&idleTimeout=60000") + .to("mock:result"); + + from("direct:sshWithShortIdleTimeout") + .to("ssh://smx:smx@localhost:" + delayedPort + "?timeout=5000&idleTimeout=500"); + from("direct:sshWithLongIdleTimeout") + .to("ssh://smx:smx@localhost:" + delayedPort + "?timeout=5000&idleTimeout=5000"); + } + }; + } +} diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SshComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SshComponentBuilderFactory.java index 5af20c1328536..e5a99a3f851ee 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SshComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SshComponentBuilderFactory.java @@ -260,6 +260,23 @@ default SshComponentBuilder configuration(org.apache.camel.component.ssh.SshConf return this; } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option is a: <code>long</code> type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default SshComponentBuilder idleTimeout(long idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } + /** * Sets the shellPrompt to be dropped when response is read after * command execution. @@ -528,6 +545,7 @@ protected boolean setPropertyOnComponent( case "clientBuilder": getOrCreateConfiguration((SshComponent) component).setClientBuilder((org.apache.sshd.client.ClientBuilder) value); return true; case "compressions": getOrCreateConfiguration((SshComponent) component).setCompressions((java.lang.String) value); return true; case "configuration": ((SshComponent) component).setConfiguration((org.apache.camel.component.ssh.SshConfiguration) value); return true; + case "idleTimeout": getOrCreateConfiguration((SshComponent) component).setIdleTimeout((long) value); return true; case "shellPrompt": getOrCreateConfiguration((SshComponent) component).setShellPrompt((java.lang.String) value); return true; case "sleepForShellPrompt": getOrCreateConfiguration((SshComponent) component).setSleepForShellPrompt((long) value); return true; case "healthCheckConsumerEnabled": ((SshComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SshEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SshEndpointBuilderFactory.java index 66f125fd0d881..30f3973a2228a 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SshEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SshEndpointBuilderFactory.java @@ -1024,6 +1024,38 @@ default AdvancedSshEndpointConsumerBuilder compressions(String compressions) { doSetProperty("compressions", compressions); return this; } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option is a: long type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default AdvancedSshEndpointConsumerBuilder idleTimeout(long idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option will be converted to a long type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default AdvancedSshEndpointConsumerBuilder idleTimeout(String idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } /** * Sets the shellPrompt to be dropped when response is read after * command execution. @@ -1450,6 +1482,38 @@ default AdvancedSshEndpointProducerBuilder compressions(String compressions) { doSetProperty("compressions", compressions); return this; } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option is a: long type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default AdvancedSshEndpointProducerBuilder idleTimeout(long idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option will be converted to a long type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default AdvancedSshEndpointProducerBuilder idleTimeout(String idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } /** * Sets the shellPrompt to be dropped when response is read after * command execution. @@ -1834,6 +1898,38 @@ default AdvancedSshEndpointBuilder compressions(String compressions) { doSetProperty("compressions", compressions); return this; } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option is a: long type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default AdvancedSshEndpointBuilder idleTimeout(long idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } + /** + * Sets the timeout in milliseconds to wait before the SSH session is + * closed due to inactivity. The default value is 0, which means no idle + * timeout is applied. + * + * The option will be converted to a long type. + * + * Group: advanced + * + * @param idleTimeout the value to set + * @return the dsl builder + */ + default AdvancedSshEndpointBuilder idleTimeout(String idleTimeout) { + doSetProperty("idleTimeout", idleTimeout); + return this; + } /** * Sets the shellPrompt to be dropped when response is read after * command execution.