View Source

{section}
{column}
{info}Only release >= 3.0{info}

h1. Feature

The FileTransfer component is a Binding Component (BC) which supports file transfers.

This component allows to:

* Poll a configured directory for incoming files. At a poll, each file retrieved is put into a new JBI message, set as source or attachment. The message is sent to a target JBI service.

* Expose a file system connector as a service which provide a set of 8 operations:
** *put:* Write the received JBI messages in a file with a specified name
** *mput:* Write the JBI message attachments it receives into files.
** *get:* Retrieve *Xml* file corresponding to a pattern, from a folder. Return it as message payload.
** *getAsAttachment:* Retrieve the first file corresponding to a pattern, from a folder. Return it as message's attachment.(XOP standard)
** *mGet:* Retrieve files corresponding to a pattern, from a folder. Return them as message's attachment.
** *checkFile:* Check the availability of a file.
** *del:* Delete one file.
** *dir:* List the content of a folder.

h1. Exposing a file system access as a service


h2. Usage


h3. Put Operation

When the put operation is set on the incoming IN message, the component write the XML message to the configured directory.

The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:put xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">?</ver:put>
{code}
The service does not return a message.
The available exchange pattern is : *InOnly*.

h3. MPut Operation

When the mput operation is set on the incoming IN message, the component write the attachments on the configured directory.
The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:mput>
<ver:attachments xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">
<!--1 or more repetitions:-->
<ver:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test1.xml"/></ver:filename>
<ver:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test2.xml"/></ver:filename>
</ver:attachments>
</ver:mput>
{code}
The service does not return a message.

The available exchange pattern is : *InOnly*.

h3. Get Operation


h3. GetAsAttachement Operation

h3. MGet Operation

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/filetransfer/version-3">
<ver:filename>?</ver:filename>
</ver:del>
{code}
The service does not return a message.

The available exchange pattern is : InOnly.

h3. CheckFile Operation

When the check operation is set on the incoming IN message, the component check
if the specified file exist. The IN message looks like&nbsp;:
{code:lang=xml}
<ver:checkFile xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">
<ver:filename>?</ver:filename>
</ver:checkFile>
{code}

The OUT message returned to the consumer looks like&nbsp;:
{code:lang=xml}
<ver:checkFileResponse xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">
<ver:filename>?</ver:filename>
<ver:exist>true|false</ver:exist>
</ver:checkFileResponse>
{code}

The service might return an ioFault.
The available exchange pattern is : InOut.

h2. Configuration

{include:0 CDK SU Provide Configuration}

&nbsp; *Service Unit attributes to provide services*
{table-plus}
















|| Attribute || Description || Default value || Required ||
| server | IP or DNS name of the server | | {center}Yes{center} |
{table-plus}

h3. Service Unit descriptor

The service unit is configurable via its extensions in the jbi.xml file:
\\
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
version="1.0">

<jbi:services binding-component="true">
....
</jbi:services>
</jbi:jbi>{code}

h3. Service Unit content

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

{code}service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}

h1. Invoking service on incoming file

h2. Configurations


h3. Service Unit descriptor

h1. Component Configuration

The following attributes can be set during the installation phase to configure the component, using the params element of the jbi-install-component ANT task:

{include:0 CDK Component Configuration Table}

{include:0 CDK Parameter scope}
{column}
{column:width=25%}
{panel:title=Table of contents}{toc}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list}{panel}
{column}
{section}