Petals-BC-Filetransfer 3.x

Only release >= 3.0

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.

Exposing a file system access as a service

Usage

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 :

<?xml version="1.0" encoding="UTF-8"?>
<ver:put xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">?</ver:put>

The service does not return a message.
The available exchange pattern is : InOnly.

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 :

<?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>

The service does not return a message.

The available exchange pattern is : InOnly.

Get Operation

GetAsAttachement Operation

MGet Operation

Del Operation

When the del operation is set on the incoming IN message, the component delete the remote file. The IN message looks like :

<?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>

The service does not return a message.

The available exchange pattern is : InOnly.

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 :

<ver:checkFile xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">
         <ver:filename>?</ver:filename>
</ver:checkFile>

The OUT message returned to the consumer looks like :

<ver:checkFileResponse xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">
         <ver:filename>?</ver:filename>
         <ver:exist>true|false</ver:exist>
</ver:checkFileResponse>

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

Configuration

Configuration of a Service Unit to provide a service (JBI)

Parameter Description
Default
Required
provides Describe the JBI service that will be exposed into the JBI bus. Interface (QName), Service (QName) and Endpoint (String) attributes are required. - Yes

Configuration of a Service Unit to provide a service (CDK)

Parameter Description
Default
Required
timeout Timeout in milliseconds of a synchronous send. This parameter is used by the method sendSync (Exchange exchange) proposes by the CDK Listeners classes.
Set it to 0 for an infinite timeout.
30000 No
exchange-properties This sections defines the list of properties to set to the JBI exchange when processing a service. - No
message-properties This sections defines the list of properties to set to the JBI message when processing a service. - No
validate-wsdl Activate the validation of the WSDL when deploying a service unit. true No
wsdl
Path to the WSDL document describing services and operations exposed by the provided JBI endpoints defined in the SU.
The value of this parameter is :
  • an URL
  • a file relative to the root of the SU package
    If not specified, a basic WSDL description is automaticaly provided by the CDK.
- No
forward-attachments
Defines if attachment will be forwarded from IN message to OUT message.
false No
forward-message-properties
Defines if the message properties will be forwarded from IN message to OUT message. false No
forward-security-subject
Defines if the security subject will be forwarded from IN message to OUT message. false No

  Service Unit attributes to provide services

Attribute Description Default value Required
server IP or DNS name of the server  
Yes

Service Unit descriptor

The service unit is configurable via its extensions in the jbi.xml file:

<?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>

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
service-unit.zip
+ META-INF
    - jbi.xml (as defined above)
    - service.wsdl (optional)

Invoking service on incoming file

Configurations

Service Unit descriptor

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:

Unable to render {include} Couldn't find a page to include called: 0 CDK Component Configuration Table

Definition of CDK parameter scope :

  • Installation: The parameter can be set during the installation of the component, by using the installation MBean (see JBI specifications for details about the installation sequence). If the parameter is optional and has not been defined during the development of the component, it is not available at installation time.
  • Runtime: The paramater can be set during the installation of the component and during runtime. The runtime configuration can be changed using the CDK custom MBean named RuntimeConfiguration. If the parameter is optional and has not been defined during the development of the component, it is not available at installation and runtime times.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.