Features
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.
- Provide a standard service that write the JBI message (content and attachments) it receives into a file with a specified name and suffixed with the current date name.
- Provide a dedicated service GetFiles, which describe 2 operations:
- getFiles operation, to retrieve files correponding to a pattern, from a folder.
- getFile operation, to retrieve the first file correponding to a pattern, from a folder.
These operations are described in an embedded astract WSDL, the File Transfer dedicated WSDL.
Component Configuration
Service Configuration
Transfer files into the JBI bus
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam fermentum vestibulum est. Cras rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed quis tortor. Donec non ipsum. Mauris condimentum, odio nec porta tristique, ante neque malesuada massa, in dignissim eros velit at tellus. Donec et risus in ligula eleifend consectetuer. Donec volutpat eleifend augue. Integer gravida sodales leo. Nunc vehicula neque ac erat. Vivamus non nisl. Fusce ac magna. Suspendisse euismod libero eget mauris.
Service Unit descriptor
<?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="false"> <jbi:consumes interface-name="generatedNs:FileRepo" service-name="generatedNs:FileRepoService" endpoint-name="getServiceEndpoint"> <!-- CDK specific fields --> <petalsCDK:operation>test</petalsCDK:operation> <petalsCDK:mep>InOnly</petalsCDK:mep> <!-- FileTransfer specific fields --> <filetransfer:read-directory>${PETALS_HOME}/filetransfer/in</filetransfer:read-directory> <filetransfer:backup-directory>${PETALS_HOME}/filetransfer/backup</filetransfer:backup-directory> <filetransfer:transfer-mode>content</filetransfer:transfer-mode> <filetransfer:polling-period>1000</filetransfer:polling-period> </jbi:consumes> </jbi:services> </jbi:jbi>
Consumer restrictions
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam fermentum vestibulum est. Cras rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed quis tortor. Donec non ipsum. Mauris condimentum, odio nec porta tristique, ante neque malesuada massa, in dignissim eros velit at tellus. Donec et risus in ligula eleifend consectetuer. Donec volutpat eleifend augue. Integer gravida sodales leo. Nunc vehicula neque ac erat. Vivamus non nisl. Fusce ac magna. Suspendisse euismod libero eget mauris.
Consumer usage
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam fermentum vestibulum est. Cras rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed quis tortor. Donec non ipsum. Mauris condimentum, odio nec porta tristique, ante neque malesuada massa, in dignissim eros velit at tellus. Donec et risus in ligula eleifend consectetuer. Donec volutpat eleifend augue. Integer gravida sodales leo. Nunc vehicula neque ac erat. Vivamus non nisl. Fusce ac magna. Suspendisse euismod libero eget mauris.
Transfer files out of the JBI bus
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam fermentum vestibulum est. Cras rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed quis tortor. Donec non ipsum. Mauris condimentum, odio nec porta tristique, ante neque malesuada massa, in dignissim eros velit at tellus. Donec et risus in ligula eleifend consectetuer. Donec volutpat eleifend augue. Integer gravida sodales leo. Nunc vehicula neque ac erat. Vivamus non nisl. Fusce ac magna. Suspendisse euismod libero eget mauris.
Service Unit descriptor
Provider restrictions
Provider Usage
Retrieve files from a folder : the GetFiles service
Service Unit descriptor
Provider restrictions
Provider Usage
GetFile operation
When the getFile operation is set on the incoming message exchange, the component returns the first file found in the configured directory, according to the file filter set in the XML request (the source of the IN message). The file is returned as an XML response message (OUT message), so the file MUST be an XML file !
The IN message looks like :
<q0:getFile xmlns:q0="http://petals.ow2.org/components/filetransfer/version-2.2"> <q0:filepattern>*.xml</q0:filepattern> </q0:getFile>
The OUT message returned to the consumer contains the XML content of the first file matching the pattern, in its source :
The read file is moved to the configured backup directory (backup-directory) or in the system default temporary directory.
| This operation is defined in the File Transfer abstract WSDL. You can import this abstract WSDL and define a concret WSDL to reference in your SU. Thus the service provided is properly defined by its WSDL. |
GetFiles operation
When the getFiles operation is set on the incoming message exchange, the component returns all the files file found in
the configured directory (read-directory), according to the files filters set in the XML request. The files are all returned
as attachments. An XML report message is returned.
When the getFiles operation is set on the incoming message exchange, the component returns all the files file found in the configured directory (read-directory), according to the files filters set in the XML request. The files are all returned as attachments. An XML report message is returned.
The IN message looks like :
<q0:getFiles xmlns:q0="http://petals.ow2.org/components/filetransfer/version-2.2"> <q0:filepattern>*.xml</q0:filepattern> <q0:filepattern>picture.jpg</q0:filepattern> <q0:filepattern>document??.doc</q0:filepattern> </q0:getFiles>
The OUT message returned to the consumer is defined as follow :
<q0:getFilesResponse xmlns:q0="http://petals.ow2.org/components/filetransfer/version-2.2"> <q0:filename>file1.xml</q0:filename> <q0:filename>file2.xml</q0:filename> <q0:filename>picture.jpg</q0:filename> <q0:filename>document_1.doc</q0:filename> <q0:filename>document_2.doc</q0:filename> </q0:getFilesResponse>
Files are returned as attachments.
The read files are moved to the configured backup directory (backup-directory) or in the system default temporary directory.
| This operation is defined in the File Transfer abstract WSDL. You can import this abstract WSDL and define a concret WSDL to reference in your SU. Thus the service provided is properly defined by its WSDL. |