net.sf.xbus.technical.ftp
Class FTPReceiver

java.lang.Object
  extended by net.sf.xbus.technical.ftp.FTPReceiver
All Implemented Interfaces:
TAResource, Receiver, ReceiverSingleInterface

public class FTPReceiver
extends java.lang.Object
implements Receiver, ReceiverSingleInterface, TAResource

The class FTPReceiver receives data by reading a file on a FTP server.

It creates a Message object and calls the application layer.


Field Summary
protected  FileReceiverConfiguration mConfiguration
           
 
Constructor Summary
FTPReceiver()
           
 
Method Summary
 void close()
          Closes the connection to the FTP server.
 void commit()
          Depending on the parameter FinalResolution, the file previously read will either be renamed, deleted or will not be touched.
protected  java.lang.String getAddress()
           
protected  java.lang.String getRequestContent()
           
 java.lang.String getType()
          A Receiver can receive data either as a String or as an Object from a neighboring system.
 void open()
          Opens the connection to the FTP server.
 void receive(java.lang.String system)
          Reads data from files on a FTP server specified by the given system.
 void rollback()
          Depending on the parameter OnError, the file previously read will either be renamed, deleted or will not be touched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mConfiguration

protected FileReceiverConfiguration mConfiguration
Constructor Detail

FTPReceiver

public FTPReceiver()
Method Detail

receive

public void receive(java.lang.String system)
Reads data from files on a FTP server specified by the given system. If the file name contains variables, they will be filled with their actual values before.

Specified by:
receive in interface ReceiverSingleInterface
Parameters:
system - The name of the system from which messages shall be received.

getType

public java.lang.String getType()
Description copied from interface: Receiver
A Receiver can receive data either as a String or as an Object from a neighboring system.

Specified by:
getType in interface Receiver
Returns:
Constants.TYPE_TEXT
See Also:
Receiver.getType()

open

public void open()
          throws XException
Opens the connection to the FTP server.

Specified by:
open in interface TAResource
Throws:
XException - if something goes wrong

close

public void close()
Closes the connection to the FTP server.

Specified by:
close in interface TAResource

commit

public void commit()
            throws XException
Depending on the parameter FinalResolution, the file previously read will either be renamed, deleted or will not be touched.

Specified by:
commit in interface TAResource
Throws:
XException - if something goes wrong

rollback

public void rollback()
              throws XException
Depending on the parameter OnError, the file previously read will either be renamed, deleted or will not be touched.

Specified by:
rollback in interface TAResource
Throws:
XException - if something goes wrong

getRequestContent

protected java.lang.String getRequestContent()
                                      throws XException
Throws:
XException

getAddress

protected java.lang.String getAddress()