Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 523DD200ACC for ; Mon, 2 May 2016 08:48:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 50A5A1609B0; Mon, 2 May 2016 08:48:51 +0200 (CEST) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 47C1C1609A1 for ; Mon, 2 May 2016 08:48:50 +0200 (CEST) Received: (qmail 21102 invoked by uid 500); 2 May 2016 06:48:49 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 21091 invoked by uid 99); 2 May 2016 06:48:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 06:48:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5C51CDFA10; Mon, 2 May 2016 06:48:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: acosentino@apache.org To: commits@camel.apache.org Date: Mon, 02 May 2016 06:48:49 -0000 Message-Id: <49f7148456cc47a29b1e145595ccde44@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] camel git commit: Added camel-jsch docs to Gitbook archived-at: Mon, 02 May 2016 06:48:51 -0000 Repository: camel Updated Branches: refs/heads/master 65aea6a54 -> 802c3dbb5 Added camel-jsch docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a9e450b2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a9e450b2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a9e450b2 Branch: refs/heads/master Commit: a9e450b293aeef6780c5d1a7995beab728b5e150 Parents: 65aea6a Author: Andrea Cosentino Authored: Mon May 2 08:43:38 2016 +0200 Committer: Andrea Cosentino Committed: Mon May 2 08:43:38 2016 +0200 ---------------------------------------------------------------------- components/camel-jsch/src/main/docs/scp.adoc | 127 ++++++++++++++++++++++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 128 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a9e450b2/components/camel-jsch/src/main/docs/scp.adoc ---------------------------------------------------------------------- diff --git a/components/camel-jsch/src/main/docs/scp.adoc b/components/camel-jsch/src/main/docs/scp.adoc new file mode 100644 index 0000000..ce604f2 --- /dev/null +++ b/components/camel-jsch/src/main/docs/scp.adoc @@ -0,0 +1,127 @@ +[[Jsch-Jsch]] +Jsch +~~~~ + +The *camel-jsch* component supports the +http://en.wikipedia.org/wiki/Secure_copy[SCP protocol] using the Client +API of the http://www.jcraft.com/jsch/[Jsch] project. Jsch is already +used in camel by the link:ftp.html[FTP] component for the *sftp:* +protocol. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +------------------------------------------------------------ + + org.apache.camel + camel-jsch + x.x.x + + +------------------------------------------------------------ + +[[Jsch-URIformat]] +URI format +^^^^^^^^^^ + +[source,java] +--------------------------------------- +scp://host[:port]/destination[?options] +--------------------------------------- + +You can append query options to the URI in the following format, +`?option=value&option=value&...` + +The file name can be specified either in the part of the URI or +as a "CamelFileName" header on the message (`Exchange.FILE_NAME` if used +in code). + +[[Jsch-Options]] +Options +^^^^^^^ + + +// component options: START +The SCP component supports 1 options which are listed below. + + + +[width="100%",cols="2s,1m,8",options="header"] +|======================================================================= +| Name | Java Type | Description +| verboseLogging | boolean | JSCH is verbose logging out of the box. Therefore we turn the logging down to DEBUG logging by default. But setting this option to true turns on the verbose logging again. +|======================================================================= +// component options: END + + + +// endpoint options: START +The SCP component supports 42 endpoint options which are listed below: + +[width="100%",cols="2s,1,1m,1m,5",options="header"] +|======================================================================= +| Name | Group | Default | Java Type | Description +| host | producer | | String | *Required* Hostname of the FTP server +| port | producer | | int | Port of the FTP server +| directoryName | producer | | String | The starting directory +| binary | producer | false | boolean | Specifies the file transfer mode BINARY or ASCII. Default is ASCII (false). +| charset | producer | | String | This option is used to specify the encoding of the file. You can use this on the consumer to specify the encodings of the files which allow Camel to know the charset it should load the file content in case the file content is being accessed. Likewise when writing a file you can use this option to specify which charset to write the file as well. +| chmod | producer | 664 | String | Allows you to set chmod on the stored file. For example chmod=664. +| ciphers | producer | | String | Set a comma separated list of ciphers that will be used in order of preference. Possible cipher names are defined by JCraft JSCH. Some examples include: aes128-ctraes128-cbc3des-ctr3des-cbcblowfish-cbcaes192-cbcaes256-cbc. If not specified the default list from JSCH will be used. +| disconnect | producer | false | boolean | Whether or not to disconnect from remote FTP server right after use. Disconnect will only disconnect the current connection to the FTP server. If you have a consumer which you want to stop then you need to stop the consumer/route instead. +| doneFileName | producer | | String | If provided then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Only $file.name and $file.name.noext is supported as dynamic placeholders. +| download | producer | false | boolean | Whether the FTP consumer should download the file. If this option is set to false then the message body will be null but the consumer will still trigger a Camel Exchange that has details about the file such as file name file size etc. It's just that the file will not be downloaded. +| fastExistsCheck | producer | false | boolean | If set this option to be true camel-ftp will use the list file directly to check if the file exists. Since some FTP server may not support to list the file directly if the option is false camel-ftp will use the old way to list the directory and check if the file exists. This option also influences readLock=changed to control whether it performs a fast check to update file information or not. This can be used to speed up the process if the FTP server has a lot of files. +| fileExist | producer | Override | GenericFileExist | What to do if a file already exists with the same name. Override which is the default replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile can be used to control what to do if an moving the file and there exists already an existing file otherwise causing the move operation to fail. The Move option will move any existing files before writing the target file. TryRename Camel is only applicable if tempFileName option is in use. This allows to try renaming the file from the temporary name to the actual name without doing any exists check.This check may be faster on some file systems and especially FT P servers. +| fileName | producer | | String | Use Expression such as File Language to dynamically set the filename. For consumers it's used as a filename filter. For producers it's used to evaluate the filename to write. If an expression is set it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type it is always evaluated using the File Language. If the expression is an Expression type the specified Expression type is used - this allows you for instance to use OGNL expressions. For the consumer you can use it to filter filenames so you can for instance consume today's file using the File Language syntax: mydata-$date:now:yyyyMMdd.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once and makes it easier as this avoids to temporary store CamelFileName and have to restore it afterwards. +| flatten | producer | false | boolean | Flatten is used to flatten the file name path to strip any leading paths so it's just the file name. This allows you to consume recursively into sub-directories but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. +| knownHostsFile | producer | | String | Sets the known_hosts file so that the jsch endpoint can do host key verification. +| maximumReconnectAttempts | producer | | int | Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior. +| moveExisting | producer | | String | Expression (such as File Language) used to compute file name to use when fileExist=Move is configured. To move files into a backup subdirectory just enter backup. This option only supports the following File Language tokens: file:name file:name.ext file:name.noext file:onlyname file:onlyname.noext file:ext and file:parent. Notice the file:parent is not supported by the FTP component as the FTP component can only move any existing files to a relative directory based on current dir as base. +| passiveMode | producer | false | boolean | Sets passive mode connections. Default is active mode connections. +| privateKeyFile | producer | | String | Set the private key file to that the SFTP endpoint can do private key verification. +| privateKeyFilePassphrase | producer | | String | Set the private key file passphrase to that the SFTP endpoint can do private key verification. +| reconnectDelay | producer | | long | Delay in millis Camel will wait before performing a reconnect attempt. +| separator | producer | UNIX | PathSeparator | Sets the path separator to be used. UNIX = Uses unix style path separator Windows = Uses windows style path separator Auto = (is default) Use existing path separator in file name +| strictHostKeyChecking | producer | no | String | Sets whether to use strict host key checking. Possible values are: no yes +| tempFileName | producer | | String | The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename as it uses the File Language. +| tempPrefix | producer | | String | This option is used to write the file using a temporary name and then after the write is complete rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by FTP when uploading big files. +| useUserKnownHostsFile | producer | true | boolean | If knownHostFile has not been explicit configured then use the host file from System.getProperty(user.home) /.ssh/known_hosts +| allowNullBody | producer (advanced) | false | boolean | Used to specify if a null body is allowed during file writing. If set to true then an empty file will be created when set to false and attempting to send a null body to the file component a GenericFileWriteException of 'Cannot write null body to file.' will be thrown. If the fileExist option is set to 'Override' then the file will be truncated and if set to append the file will remain unchanged. +| eagerDeleteTargetFile | producer (advanced) | true | boolean | Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists=Override and the tempFileName option as well. You can use this to disable (set it to false) deleting the target file before the temp file is written. For example you may write big files and want the target file to exists during the temp file is being written. This ensure the target file is only deleted until the very last moment just before the temp file is being renamed to the target filename. This option is also used to control whether to delete any existing files when fileExist=Move is enabled and an existing file exists. If this option copyAndDeleteOnRenameFails false then an exception will be thrown if an existing file existed if its true then the existing file is deleted before the move operation. +| keepLastModified | producer (advanced) | false | boolean | Will keep the last modified timestamp from the source file (if any). Will use the Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.util.Date or long with the timestamp. If the timestamp exists and the option is enabled it will set this timestamp on the written file. Note: This option only applies to the file producer. You cannot use this option with any of the ftp producers. +| sendNoop | producer (advanced) | true | boolean | Whether to send a noop command as a pre-write check before uploading files to the FTP server. This is enabled by default as a validation of the connection is still valid which allows to silently re-connect to be able to upload the file. However if this causes problems you can turn this option off. +| autoCreate | advanced | true | boolean | Automatically create missing directories in the file's pathname. For the file consumer that means creating the starting directory. For the file producer it means the directory the files should be written to. +| bufferSize | advanced | 131072 | int | Write buffer sized in bytes. +| connectTimeout | advanced | 10000 | int | Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH +| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| siteCommand | advanced | | String | Sets optional site command(s) to be executed after successful login. Multiple site commands can be separated using a new line character (\n). +| soTimeout | advanced | 300000 | int | Sets the so timeout Used only by FTPClient +| stepwise | advanced | true | boolean | Sets whether we should stepwise change directories while traversing file structures when downloading files or as well when uploading a file to a directory. You can disable this if you for example are in a situation where you cannot change directory on the FTP server due security reasons. +| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| throwExceptionOnConnectFailed | advanced | false | boolean | Should an exception be thrown if connection failed (exhausted) By default exception is not thrown and a WARN is logged. You can use this to enable exception being thrown and handle the thrown exception from the org.apache.camel.spi.PollingConsumerPollStrategy rollback method. +| timeout | advanced | 30000 | int | Sets the data timeout for waiting for reply Used only by FTPClient +| password | security | | String | Password to use for login +| username | security | | String | Username to use for login +|======================================================================= +// endpoint options: END + + +[[Jsch-Limitations]] +Limitations +^^^^^^^^^^^ + +Currently camel-jsch only supports a +http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Producer.html[Producer] +(i.e. copy files to another host).  + +[[Jsch-SeeAlso]] +See Also +^^^^^^^^ + +* link:configuring-camel.html[Configuring Camel] +* link:component.html[Component] +* link:endpoint.html[Endpoint] +* link:getting-started.html[Getting Started] + http://git-wip-us.apache.org/repos/asf/camel/blob/a9e450b2/docs/user-manual/en/SUMMARY.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index a8df1e8..e0e9eab 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -182,6 +182,7 @@ * [NATS](nats.adoc) * [Properties](properties.adoc) * [Quickfix](quickfix.adoc) + * [Scp](scp.adoc) * [SJMS](sjms.adoc) * [SJMS Batch](sjms-batch.adoc) * [Twitter](twitter.adoc)