Petals-BC-FTP 3.3.x

New feature : Adding the parameter overwrite.

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:

Configuration of the component (CDK)


Configuration of the component (CDK)

Parameter Description Default Required Required
acceptor-pool-size The size of the thread pool used to accept Message Exchanges from the NMR. Once a message is accepted, its processing is delegated to the processor pool thread. 3 Yes Runtime
processor-pool-size The size of the thread pool used to process Message Exchanges. Once a message is accepted, its processing is delegated to one of the thread of this pool. 10 Yes Runtime
processor-max-pool-size The maximum size of the thread pool used to process Message Exchanges. The difference between this size and the processorpool-size represents the dynamic threads that can be created and destroyed during overhead processing time. 50 No Runtime
notifications Enable the EDA mode. The component produces and consumes notifications. See the EDA documentation for further details. false No Installation
properties-file Name of the file containing properties used as reference by other parameters. Parameters reference the property name in the following pattern ${myPropertyName}. At runtime, the expression is replaced by the value of the property.
The value of this parameter is:
  • an URL
  • a file relative to the PEtALS installation path
  • an empty value to stipulate a non-using file
- No Installation

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.

Service Configuration

Unable to render {include} Couldn't find a page to include called: 0 CDK SU BC Provide Configuration

PROVIDE SERVICE : Proposes a service to process FTP commands on an FTP server

Petals FTP binding component allows JBI consumers to call FTP command. A JBI endpoint is registered into the JBI environment, and is linked to an FTP server, with a configured user/password.To use this service, the consumer has to call explicitely the {service namespace}get/mget/put/mput/dir/del operations.When the FTP component receives a message exchange from Petals platform, it call the FTP command associate with the jbi operation.

This service can either connects to an FTP server configured in the ServiceUnit, or retrieve the FTP server information in the XML message request.

Service Unit descriptor

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

<?xml version="1.0" encoding="UTF-8"?>
<!-- JBI descriptor for PEtALS' "petals-bc-ftp" (FTP), version 3.0 -->
<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-5"
xmlns:ftp="http://petals.ow2.org/components/ftp/version-3"
xmlns:interfaceNs="http://petals.ow2.org/components/ftp/version-3"
xmlns:serviceNs="http://myservice">
<!-- 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="interfaceNs:Ftp"
  service-name="serviceNs:FtpSrv"
  endpoint-name="FtpSrvEndpoint">
    <!-- CDK specific elements -->
    <petalsCDK:wsdl>FtpService.wsdl</petalsCDK:wsdl>
    <!-- Component specific elements -->
    <ftp:server>server</ftp:server>
    <ftp:port>21</ftp:port>
    <ftp:user>user</ftp:user>
    <ftp:password>password</ftp:password>
    <ftp:folder>folder</ftp:folder>
  </jbi:provides>
</jbi:services>
</jbi:jbi>


Service Unit attributes to provide services

Attribute Description Default value Required
server IP or DNS name of the server (do not include "ftp://" prefix)
  Yes (except when uins FtpService)
port the port number of the ftp server 21 No
user the user login name used to connect to the server   Yes (except when using FtpService)
password the user password   Yes (except when using FtpService)
folder the folder on the FTP server   Yes
filename file name for the standard PUT operation (write the XML message content on the FTP server) content.xml No
connection-mode In Active mode, the connection port is set by the client. In Passive mode, it is set by the server (default is Active) active No
transfer-type transfer mode used for put or get files ascii/binary ascii No
delete-processed-files If true, the service delete the files processed by operation get or mget false No
overwrite Defined if the component have to overwrite the existing remote file. If "false", the file is not copied and a fault is returned to the caller saying "The file already exists". False
No

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)

FTP Service


The petals-bc-ftp component provides 5 operations, when using the Ftp service:

  • put : copy incoming XML message on the FTP server
  • mput : copy incoming message attachments on the FTP server
  • get : get one specified file from the FTP server and return it as an XML message
  • mget : get files from the FTP server and return them as attachments
  • dir : return the files list on the FTP server
  • del : remove file on the FTP server

When using the FTP service, you can optionnaly define the FTP connection information in your XML request. If you don't, the service unit parameters are used.
To configure the FTP connection in your XML message request, you have to provide a connection element.

...
<ver:connection>
            <ver:server>?</ver:server>
            <ver:port>?</ver:port>
            <ver:user>?</ver:user>
            <ver:password>?</ver:password>
            <!--Optional:-->
            <ver:folder>?</ver:folder>
            <ver:transfer-type>ascii|binary</ver:transfer-type>
            <ver:connection-mode>active|passive (optional, default is active)</ver:connection-mode>
            <ver:delete-processed-files>true|false(optional, default is false)</ver:delete-processed-files>
            <ver:overwrite>true|false(optional, default is false)</ver:overwrite>
         </ver:connection>
...

PUT operation

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

The IN message looks like :

<?xml version="1.0" encoding="UTF-8"?>
<ver:put xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
    <ver:body>xml body</ver:body>
    <ver:filename>file name on the FTP server</ver:filename>
   <!--Optional:-->
   <ver:connection>
      ...
   </ver:connection>
</ver:put>

The service does not return a message.

The service might return an error when an element in the request is missing or if the FTP connection failed.

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 FTP server.

The IN message looks like :

<?xml version="1.0" encoding="UTF-8"?>
<ver:mput xmlns:ver="http://petals.ow2.org/components/ftp/version-3.0">
       <ver:connection>
         ...
       </ver:connection>
</ver:mput>

The service does not return a message.

The service might return an error when an element in the request is missing or if the FTP connection failed.

The available exchange pattern is : InOnly.

GET operation

When the get operation is set on the incoming IN message, the component retrieve ONE file from the FTP 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 :

<?xml version="1.0" encoding="UTF-8"?>
<ver:get xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
     <ver:filename>file name to retrieve</ver:filename>
    <!--Optional:-->
    <ver:connection>
      ...
    </ver:connection>
 </ver:get>

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 FTP connection failed

The available exchange patterns is : InOut.

Only xml file could be processed otherwise an error will be raised.

MGET operation

When the mget operation is set on the incoming IN message, the component retrieves files from the FTP 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 :

<?xml version="1.0" encoding="UTF-8"?>
<ver:mget xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
    <!--1 or more repetitions:-->
    <ver:filename>*.xml</ver:filename>
    <ver:filename>myFile.txt</ver:filename>
    <!--Optional:-->
    <ver:connection>
     ...
    </ver:connection>
</ver:mget>

The OUT message returned to the consumer contains files, as attachments, and an XML message report :

<?xml version="1.0" encoding="UTF-8"?>
<tns:mgetResponse xmlns:tns="http://petals.ow2.org/components/ftp/version-3.0">
     <tns:filename>source.xml</tns:filename>
     <tns:filename>source2.xml</tns:filename>
     <tns:filename>myFile.txt</tns:filename>
</tns:mgetResponse>

The service might return a Fault when an element in the request is missing or if the FTP connection failed

The available exchange pattern is : InOut.

DIR operation

When the dir operation is set on the incoming IN message, the component returns the file names listed from the FTP
server.
The IN message looks like :

<?xml version="1.0" encoding="UTF-8"?><ver:dir xmlns:ver="http://petals.ow2.org/components/ftp/version-3>
   <!--Optional:-->
   <ver:connection>
     ...
   </ver:connection>
</ver:dir>

The OUT message returned to the consumer is defined as follow :

<tns:dirResponse xmlns:tns="http://petals.ow2.org/components/ftp/version-3">
         <!--Zero or more repetitions:-->
         <tns:filename>file1.txt</tns:filename>
         <tns:filename>linux.jpg</tns:filename>
</tns:dirResponse>

The service might return a Fault when an element in the request is missing or if the FTP connection failed

The available exchange pattern is : InOut.

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/ftp/version-3>
  <ver:filename>?</ver:filename>
  <!--Optional:-->
  <ver:connection>
      ...
  </ver:connection>
</ver:del>

The service does not return a message.
The service might return an Error when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : InOnly.

Contributors
No contributors found for: authors on selected page(s)
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.