Space Menu Consortium | Solutions | Middleware | Forge | MyObjectWeb |
spacer PDF | spacer History |
More Actions
View
Code | XML |
Help
Documentation | XWiki Syntax |

FTP Binding Component (petals-bc-ftp)

Introduction

In order to be able to put, get, or detect files on a ftp server, we have developped a ftp binding component.

spacer

Configuration

Service Unit configuration

The component is configurable with its jbi descriptor file. You can:
  • Define the ftp server you want to access by setting its IP address or DNS name
  • Define the port number the server listen to. (If the port is not specified, the 21 port will be automaticaly be used)
  • Specify the user you want to use to connect
  • Specify the password corresponding to this server
The PEtALS extension are defined in the JBI.xml file of the component like this:
<extensions:extensions>
  <keyvalue:extension> 
	<ftp.server>IP or DNS name</ftp.server>
	<ftp.login>login</ftp.login>
	<ftp.password>password</ftp.password>
	<ftp.port>21</ftp.port>
  </keyvalue:extension>
</extensions:extensions>

WSDL location

As described in the CDK documentation, you can define the wsdl location URL in the service unit extensions (Note that it is only possible in a provider SU):

<extensions:extensions>
  <keyvalue:extension>
    <address>EXTERNAL WS URL</address>
    <wsdl>WSDL URL</wsdl>
   </keyvalue:extension>
</extensions:extensions>

Downloading, putting, and detecting files on the ftp server

As a binding component, you have to deploy service assemblies to be able to access a ftp server. Examples of service assemblies are provided as attachments (see below).

Features

The FTP BC has three possible operations :
  • detect : to detect if a file exists on the server or if a directory contains files.
  • put : to send a file to the server
  • get : to download a file from the server.

Detecting a file on the ftp server : the "detect" operation

When the FTP BC receives a message wich operation is "detect", it will try to to retrieve the "remote" propertie in this message. If these propertie is not set, an error is sent back. If these propertie is a file, the BC will detect if this file exists on the ftp server. If these propertie is a directory, the BC will detect if this directory contains files or not. The detect operation accepts "InOut" and "InOptionalOut" message exchange patterns. The message sent back can be:

<info>file(s) detected</info>
if the file has been detected or the directory contains at least one file.

<info>No file detetected</info>
if the file has not been detected or the directory is empty.

Putting a file on the ftp server : the "put" operation

The remote propertie of the incomming message contains the name under which the file will be uploaded on the ftp server. When the FTP BC receives a message wich operation is "put", it will try to to retrieve the "remote" propertie in this message. If these propertie is not set, an error is sent back. In the other case, it tries to put on the ftp server the file contained as attachment of the incomming message. The put operation accepts "InOnly" and "InOptionalOut" message exchange patterns, so no response message is sent back.

Downloading a file from the ftp server : the "get" operation

The "remote" propertie of the incomming message contains the name of the file to download. When the FTP BC receives a message wich operation is "get", it will try to to retrieve the "remote" propertie in this message. If these propertie is not set, an error is sent back. In the other case, it will try to download the file. The detect operation accepts "InOut" and "InOptionalOut" message exchange patterns. The message sent back is:

<info>attached file(s)</info>

The downloaded file is sent as attachment of the outgoing message.

FTP Service Assembly sample

The FTPClientServiceSA.zip file is a Service Assembly sample to connect to a ftp server. It has to be correctly configured to have valid ftp server connexion parameters in the jbi.xml file.
FTPClientServiceSA.zip

Future work

  • Add ftp connexions pool

Changelog

Version 1.3

  • first version of the ftp binding component

Menu

Petals

  • Home
  • Team

Components

  • Binding Components

Technical

  • Architecture
  • JBI API
  • JBI Spec
  • Developers
  • Current code reports

Contribution

  • JONES
  • OSGi

 
Attachments: 2 Attachments by mbeldame ...
 
 
Components.Binding.WebHome > FTP Binding Component (petals-bc-ftp) (en)
Creator: mbeldame  Date: 2007/04/20 15:12
Last Author: nsalatge  Date: 2007/07/13 09:50
spacer
Copyright (c) 2005-2006, ObjectWeb Consortium | Work licensed under a Creative Commons Attribution-Share Alike 2.5 License | contact | webmaster
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.