|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (122)
View Page History{column}
{warning}This version must be installed on [Petals ESB 5.2.0|petalsesb520:Petals 5.3.0|petalsesb530:Petals ESB 5.23.0]+{warning}
h1. Feature
These operations are described in an embedded WSDL.
{info}All attachment are processed by using XOP rules. (XML-binary Optimized Packaging : [http://www.w3.org/TR/xop10/] ){info} [http://www.w3.org/TR/xop10/]).{info}
{column}
{section}
h1. Exposing a SFTP connection as a service
In provide mode, the component expose an external service in the JBI environment to send SFTP commands on an SFTP server.
The component is able to expose an external service in the JBI environment to send SFTP commands on an SFTP server (*Service-unit mode*).
The component can expose directly a generic SFTP service without deploying a service unit (*Generic mode*) or use a service-unit (*Service-unit mode*).
In generic mode, parameter for the SFTP connection are set in the XML message request in a connection node (see [Generic Mode configuration|#GenericModeConfiguration]).
In generic mode, parameter for the SFTP connection are set in the XML message request in a connection node (see [Generic Mode configuration|#GenericModeConfiguration]).
h2. Usage
When using the SFTP service, you can optionnaly define the SFTP connection information in your XML request. If you don't, the service unit parameters are used.
The operations of the service exposed are explained here after:
* an operation need to be call explicitly in the form : \{service-namespace}operation (example: \{http://petals.ow2.org/components/sftp/version-1}put)
* all operations support wild card character.
* an operation need to be call explicitly in the form : \{service-namespace}operation (example: \{http://petals.ow2.org/components/sftp/version-1}put)
* all operations support wild card character.
{info}* Operation need to be call explicitely in the form : \{service-namespace}operation
Example : \{[http://petals.ow2.org/components/sftp/version-1]}put
* All operations support wild card character{info}
Example : \{[http://petals.ow2.org/components/sftp/version-1]}put
* All operations support wild card character{info}
h3. Put Operation
When the put operation is set on the incoming IN message, the component write the XML message to the SFTP server.
When the put operation is set on the incoming IN message, the component write the XML message to the SFTP server.
\\
The IN message looks like :
{code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<ver:put xmlns:ver="http://petals.ow2.org/components/sftp/version-1">
<ver:body>xml body</ver:body>
<ver:body>xml body</ver:body>
</ver:put>
{code}
{code}
The service does not return a message.
The service might return an error when an element in the request is missing or if the SFTP connection failed.
The service might return an error when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is : *InOnly*.
{tip}The operation '{{put}}' of the generic service supports the automatic creation of the remote directory if it does not exist. Just set the parameter '{{create-folder}}' available in the section '{{connection}}' to '{{true}}'. See [Generic Mode configuration|#GenericModeConfiguration].{tip} [connection parameters|#connection-parameters].{tip}
h3. MPut Operation
When the mput operation is set on the incoming IN message, the component write the attachments on the SFTP server.
The IN message looks like :
{code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<ver:mput xmlns:ver="http://petals.ow2.org/components/sftp/version-1">
<ver:attachments>
<ver:attachments>
</ver:mput>
{code}
{code}
The service does not return a message.
\\
The service might return an error when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is : *InOnly*.
{tip}The operation '{{mput}}' of the generic service supports the automatic creation of the remote directory if it does not exist. Just set the parameter '{{create-folder}}' available in the section '{{connection}}' to '{{true}}'. See [Generic Mode configuration|#GenericModeConfiguration].{tip} [connection parameters|#connection-parameters].{tip}
h3. Get Operation
When the get operation is set on the incoming IN message, the component retrieve ONE file from the SFTP server and return it as an XML message content.
\\
The name of the file to retrieve is set in the XML IN content of the message.
\\
The IN message looks like :
\\ {code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<ver:get xmlns:ver="http://petals.ow2.org/components/sftp/version-1">
<ver:filename>file name to retrieve</ver:filename>
</ver:get>
{code}
<ver:filename>file name to retrieve</ver:filename>
</ver:get>
{code}
The OUT message returned to the consumer is the content of the XML file
\\
\\
The service might return a Fault when an element in the request is missing or if the SFTP connection failed
\\
\\
The OUT message returned to the consumer is the content of the XML file.
The available exchange patterns is : *InOut*.
The service might return a Fault when an element in the request is missing or if the SFTP connection failed.
The available exchange patterns is: *InOut*.
{info}Only xml file could be processed otherwise an error will be raised.{info}
h3. GetAsAttachment Operation
The name of the file to retrieve is set in the XML IN content of the message.
The IN message looks like :
{code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<ver:getAsAttachment xmlns:ver="http://petals.ow2.org/components/sftp/version-1">
<ver:filename>file name to retrieve</ver:filename>
</ver:getAsAttachment>
{code}
<ver:filename>file name to retrieve</ver:filename>
</ver:getAsAttachment>
{code}
The OUT message returned to the consumer contains files, as attachments, and an XML message report :
{code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<tns:getAsAttachmentResponse xmlns:tns="http://petals.ow2.org/components/sftp/version-1">
<tns:attachment>
<tns:attachment>
</tns:getAsAttachmentResponse>
{code}
{code}
The service might return a Fault when an element in the request is missing or if the SFTP connection failed
The available exchange pattern is : *InOut*.
The service might return a Fault when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is: *InOut*.
h3. MGet Operation
When the mget operation is set on the incoming IN message, the component retrieves files from the SFTP server, according to the file names (or filters) set in the XML request.
When the mget operation is set on the incoming IN message, the component retrieves files from the SFTP server, according to the file names (or filters) set in the XML request.
\\
There is no recursivity, sub folders are ignored.
Each file is set in the OUT message as an attachment. The IN message looks like :
\\ {code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<ver:mget xmlns:ver="http://petals.ow2.org/components/sftp/version-1">
<!--1 or more repetitions:-->
<!--1 or more repetitions:-->
</ver:mget>
{code}
{code}
The OUT message returned to the consumer contains files, as attachments, and an XML message report :
\\ {code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<tns:mgetResponse xmlns:tns="http://petals.ow2.org/components/sftp/version-1">
<tns:attachments>
<tns:attachments>
</tns:mgetResponse>
{code}
{code}
The service might return a Fault when an element in the request is missing or if the SFTP connection failed
\\
\\
The available exchange pattern is : *InOut*.
The service might return a Fault when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is: *InOut*.
h3. Dir Operation
When the dir operation is set on the incoming IN message, the component returns the file names listed from the SFTP
server.
server.
The IN message looks like :{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?><ver:dir xmlns:ver="http://petals.ow2.org/components/sftp/version-1>
</ver:dir>{code}
The OUT message returned to the consumer is defined as follow :
<?xml version="1.0" encoding="UTF-8"?><ver:dir xmlns:ver="http://petals.ow2.org/components/sftp/version-1>
</ver:dir>{code}
The OUT message returned to the consumer is defined as follow :
The IN message looks like:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:dir xmlns:ver="http://petals.ow2.org/components/sftp/version-1 />
{code}
The OUT message returned to the consumer is defined as follow:
{code:lang=xml}
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:dir xmlns:ver="http://petals.ow2.org/components/sftp/version-1 />
{code}
The OUT message returned to the consumer is defined as follow:
{code:lang=xml}
{code:lang=xml}<tns:dirResponse xmlns:tns="http://petals.ow2.org/components/sftp/version-1">
<!--Zero or more repetitions:-->
<tns:filename>file1.txt</tns:filename>
<tns:filename>file1.txt</tns:filename>
</tns:dirResponse>
{code}
{code}
The service might return a Fault when an element in the request is missing or if the SFTP connection failed
The available exchange pattern is : *InOut*.
The service might return a Fault when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is: *InOut*.
h3. Del Operation
When the del operation is set on the incoming IN message, the component delete the remote file.
The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?><ver:del xmlns:ver="http://petals.ow2.org/components//version-3>
<?xml version="1.0" encoding="UTF-8"?><ver:del xmlns:ver="http://petals.ow2.org/components//version-3>
</ver:del>
{code}
{code}
The service does not return a message.
The service might return an Error when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is : InOnly.
The available exchange pattern is: InOnly.
h2. Configuration
{anchor:GenericModeConfiguration}
All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service provider implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service provider implementation at component layer.
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service provider implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service provider implementation at component layer.
h3. Generic Mode
h3. CDK parameters defining service provider implementation
The following parameters correspond to the CDK configuration of the service provider implementation.
The following parameters correspond to the CDK configuration of the service provider implementation.
To allow the component to provide his generic service, the component must have a wsdl with the name : component.wsdl. An example of this file is available in the component.
{include:0 CDK SU Provide Configuration 5.8.0}
To deactivate the generic service supplies by the component,simply erase the file : component.wsdl.
h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
The following parameters drive interceptors at CDK layer.
To configure the SFTP connection in your XML message request, you have to provide a connection element.
\\
{code:lang=xml}
...
<!--Optional:-->
<ver:connection>
<ver:server>?</ver:server>
<ver:port>?</ver:port>
<ver:user>?</ver:user>
\\
{code:lang=xml}
...
<!--Optional:-->
<ver:connection>
<ver:server>?</ver:server>
<ver:port>?</ver:port>
<ver:user>?</ver:user>
{include:0 CDK SU Interceptor configuration 5.8.0}
<!--Optional:-->
<ver:password>?</ver:password>
<ver:folder>?</ver:folder>
<ver:passphrase>?</ver:passphrase>
<ver:private-key>?</ver:private-key>
<ver:create-folder>?</ver:create-folder>
</ver:connection>
...
{code}
<ver:password>?</ver:password>
<ver:folder>?</ver:folder>
<ver:passphrase>?</ver:passphrase>
<ver:private-key>?</ver:private-key>
<ver:create-folder>?</ver:create-folder>
</ver:connection>
...
{code}
h3. Dedicated configuration
The following parameters correspond to the component specific configuration of the service provider implementation.
The following parameters correspond to the component specific configuration of the service provider implementation.
Example of a PUT request :
{anchor:connection-parameters}
{table-plus}
|| Parameter || Description || Default || Required ||
| server | IP or DNS name of the server | {center}\-{center} | {center}Yes{center} {center}except when using Dynamic mode{center} |
| port | the port number of the server | {center}21{center} | {center}No{center} |
| user | the user login name used to connect to the server | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| password | the user password | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| folder | the folder on the server | {center}\-{center} | {center}No{center} |
| privatekey | the path to the user's private key (on the PEtALS machine) | {center}\-{center} | {center}Yes{center}{center}except when using dynamic mode or password authentication{center} |
| passphrase | the passphrase matching the given private key | {center}\-{center} | {center}No{center} |
{table-plus}
{table-plus}
|| Parameter || Description || Default || Required ||
| server | IP or DNS name of the server | {center}\-{center} | {center}Yes{center} {center}except when using Dynamic mode{center} |
| port | the port number of the server | {center}21{center} | {center}No{center} |
| user | the user login name used to connect to the server | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| password | the user password | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| folder | the folder on the server | {center}\-{center} | {center}No{center} |
| privatekey | the path to the user's private key (on the PEtALS machine) | {center}\-{center} | {center}Yes{center}{center}except when using dynamic mode or password authentication{center} |
| passphrase | the passphrase matching the given private key | {center}\-{center} | {center}No{center} |
{table-plus}
{code:lang=xml}
<sftp:put xmlns:sftp="http://petals.ow2.org/components/sftp/generic/version-1">
<sftp:body>xml body</sftp:body>
<sftp:filename>file name on the server</sftp:filename>
<!--Optional:-->
<sftp:connection>
<sftp:host>192.168.1.206</sftp:host>
<sftp:port>22</sftp:port>
<sftp:user>user1</sftp:user>
<sftp:password>test</sftp:password>
</sftp:connection>
</sftp:put>
{code}
<sftp:put xmlns:sftp="http://petals.ow2.org/components/sftp/generic/version-1">
<sftp:body>xml body</sftp:body>
<sftp:filename>file name on the server</sftp:filename>
<!--Optional:-->
<sftp:connection>
<sftp:host>192.168.1.206</sftp:host>
<sftp:port>22</sftp:port>
<sftp:user>user1</sftp:user>
<sftp:password>test</sftp:password>
</sftp:connection>
</sftp:put>
{code}
h3. Service unit content
The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above,
* it is also highly recommended to provide a WSDL description for service provider embeded in the service-unit. The service provider contract must implement the interface "\{http://petals.ow2.org/components/sftp/version-1}SFTP" defined in the abstract WSDL 'SFtpServiceInterface.wsdl' available as resource in the component archive.
* the META-INF/jbi.xml descriptor file as described above,
* it is also highly recommended to provide a WSDL description for service provider embeded in the service-unit. The service provider contract must implement the interface "\{http://petals.ow2.org/components/sftp/version-1}SFTP" defined in the abstract WSDL 'SFtpServiceInterface.wsdl' available as resource in the component archive.
h3. Service Unit descriptor
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}
h3. Example
Excample An example of a Service Unit descriptor to provide a an SFTP service:
{code:lang=xml}
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<!--
JBI descriptor for the Petals' "petals-bc-sftp" component (SFTP).
Originally created for the version 1.2 of the component.
-->
JBI descriptor for the Petals' "petals-bc-sftp" component (SFTP).
Originally created for the version 1.2 of the component.
-->
<jbi:jbi version="1.0"
xmlns:generatedNs="http://petals.ow2.org/components/sftp/version-1"
xmlns:generatedNs="http://petals.ow2.org/components/sftp/version-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Import a Service into Petals or Expose a Petals Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Import a Service into Petals => provides a Service. -->
<jbi:provides
interface-name="generatedNs:SftpInterface"
interface-name="generatedNs:SftpInterface"
</jbi:jbi>{code}
h1. The integration service
{include:0 CDK SU Provide Configuration 5.7.0}
The component exposes directly a generic SFTP service without deploying a service unit (*Integration service mode*). This generic service can be deactivate removing the file '{{component.wsdl}}' from the component archive.
{center}{*}Configuration of a Service Unit to provide a service (SFTP)*{center}
In integration service mode, parameters for the SFTP connection are set in the XML message request in a connection node added to the operation payload as following. See [connection parameters|#connection-parameters] for more details:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<sftp:... xmlns:sftp="http://petals.ow2.org/components/sftp/generic/version-1">
<sftp:connection>
<sftp:server>?</ver:server>
<sftp:port>?</ver:port>
<sftp:user>?</ver:user>
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<sftp:... xmlns:sftp="http://petals.ow2.org/components/sftp/generic/version-1">
<sftp:connection>
<sftp:server>?</ver:server>
<sftp:port>?</ver:port>
<sftp:user>?</ver:user>
<!--Optional:-->
<sftp:password>?</sftp:password>
<sftp:folder>?</sftp:folder>
<sftp:passphrase>?</sftp:passphrase>
<sftp:private-key>?</sftp:private-key>
<sftp:overwrite>?</sftp:overwrite>
<sftp:create-folder>?</sftp:create-folder>
</ver:connection>
<sftp:password>?</sftp:password>
<sftp:folder>?</sftp:folder>
<sftp:passphrase>?</sftp:passphrase>
<sftp:private-key>?</sftp:private-key>
<sftp:overwrite>?</sftp:overwrite>
<sftp:create-folder>?</sftp:create-folder>
</ver:connection>
{table-plus} </sftp:...>
|| Parameter || Description || Default || Required ||
| server | IP or DNS name of the server | {center}\-{center} | {center}Yes{center} {center}except when using Dynamic mode{center} |
| port | the port number of the server | {center}21{center} | {center}No{center} |
| user | the user login name used to connect to the server | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| password | the user password | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| folder | the folder on the server | {center}\-{center} | {center}No{center} |
| privatekey | the path to the user's private key (on the PEtALS machine) | {center}\-{center} | {center}Yes{center}{center}except when using dynamic mode or password authentication{center} |
| passphrase | the passphrase matching the given private key | {center}\-{center} | {center}No{center} |
| server | IP or DNS name of the server | {center}\-{center} | {center}Yes{center} {center}except when using Dynamic mode{center} |
| port | the port number of the server | {center}21{center} | {center}No{center} |
| user | the user login name used to connect to the server | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| password | the user password | {center}\-{center} | {center}Yes{center}{center}except when using Dynamic mode{center} |
| folder | the folder on the server | {center}\-{center} | {center}No{center} |
| privatekey | the path to the user's private key (on the PEtALS machine) | {center}\-{center} | {center}Yes{center}{center}except when using dynamic mode or password authentication{center} |
| passphrase | the passphrase matching the given private key | {center}\-{center} | {center}No{center} |
{table-plus} {code}
{include:0 CDK SU Interceptor configuration}
Example of a PUT request:
{code:lang=xml}
<sftp:put xmlns:sftp="http://petals.ow2.org/components/sftp/generic/version-1">
<sftp:body>xml body</sftp:body>
<sftp:filename>file name on the server</sftp:filename>
<sftp:connection>
<sftp:host>192.168.1.206</sftp:host>
<sftp:port>22</sftp:port>
<sftp:user>user1</sftp:user>
<sftp:password>test</sftp:password>
</sftp:connection>
</sftp:put>
{code}
{code:lang=xml}
<sftp:put xmlns:sftp="http://petals.ow2.org/components/sftp/generic/version-1">
<sftp:body>xml body</sftp:body>
<sftp:filename>file name on the server</sftp:filename>
<sftp:connection>
<sftp:host>192.168.1.206</sftp:host>
<sftp:port>22</sftp:port>
<sftp:user>user1</sftp:user>
<sftp:password>test</sftp:password>
</sftp:connection>
</sftp:put>
{code}
h4. Service Unit content
h1. Configuring the component
The Service Unit has to contain the following elements, packaged in an archive:
\\
* The META-INF/jbi.xml descriptor file, has described above,
* An optional wsdl file describing the related service
\\
* The META-INF/jbi.xml descriptor file, has described above,
* An optional wsdl file describing the related service
The component can be configured through the parameters of its JBI descriptor file. These parameters are divided in following groups:
* *JBI parameters* that have not to be changed otherwise the component will not work,
* *CDK parameters* that are parameters driving the processing of the CDK layer,
* *Dedicated parameters* that are parameters specific to this component.
* *JBI parameters* that have not to be changed otherwise the component will not work,
* *CDK parameters* that are parameters driving the processing of the CDK layer,
* *Dedicated parameters* that are parameters specific to this component.
{code}service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}
h2. CDK parameters
The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.
The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.
h1. Component Configuration
{include:0 CDK Component Configuration Table 5.8.0}
h2. Interception configuration
{include:0 CDK Component Configuration Table 5.6.0} Interceptor configuration 5.8.0}
{include:0 CDK Parameter scope}
{include:0 CDK Component Interceptor configuration}
{include:0 CDK Component Interceptor configuration}
h2. Dedicated configuration
No dedicated configuration parameter is available.
No dedicated configuration parameter is available.
h1. Business monitoring
h3. Common metrics
{include:0 CDK Component Monitoring Metrics 5.68.0}
h3. Dedicated metrics