Petals-BC-Filetransfer

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (7)

View Page History
h2. Transfer files into the JBI bus

\\ !worddav103ae1837a51c53a71a57c7c0997a20a.png|align=center!

h3. Service Unit descriptor
h3. Consumer usage

If you want to invoke a service in the JBI bus with files, put the files in the configured directory (read-directory). Ateach configured polling period (polling-period), the component fetchs the incoming files.If you want to invoke a service in the JBI bus with files, put the files in the configured directory (read-directory). At each At each configured polling period (polling-period), the component fetchs the incoming files.For each received files and according to the transfer mode (transfer-mode), the component creates a new message exchange message exchange and attachs the file, either as source or as attachment.

If a file is put as a attachment, the name of the attachment is set to the name of the file, and in the source of the message exchange, message exchange, the component put a XML structure like following :

<attached-files><file-name>myFileName</file-name><attached-files>
The resulted message exchange(s) are sent to the target endpoint.

During the transfer, if the backup directory (backup-directory) is set, the transfered file is moved into it and never deleted by deleted&nbsp;by the component. Otherwise the file is moved to the system temporary directory.

When deploying a service unit like in the previous code snippet, all the files put in the directory $PETALS_HOME/filetransfer/in would be set as the payload of an invocation to the FileService service.
h2. Transfer files out of the JBI bus

\\ !worddav93ef27655066d2f8dbcd5b821bb00665.png|align=center!



h3. Service Unit descriptor
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
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-4.0"
xmlns:filetransfer="http://petals.ow2.org/components/filetransfer/version-2.2"
xmlns:generatedNs="http://petals.ow2.org/filetransfer">
<jbi:services binding-component="true">
 
<jbi:provides
interface-name="generatedNs:put"
service-name="generatedNs:putService"
endpoint-name="putServiceEndpoint">

<!-- WSDL file -->
<petalsCDK:wsdl xsi:nil="true" />

<!-- FileTransfer specific fields -->
<filetransfer:write-directory>${PETALS_HOME}/filetransfer/out</filetransfer:write-directory>
<filetransfer:copy-mode>content-only</filetransfer:copy-mode>
<filetransfer:file-pattern>test.xml</filetransfer:file-pattern>
</jbi:provides>
</jbi:services>
</jbi:jbi>{code}

h3. Provider restrictions