Overview:
=========
  This is a very basic example that demonstrates how to configure the FTP
  gateway so that it picks up messages from an ftp server, routes them through
  a JMS queue and finally to your action class for processing. 
  
Running this quickstart:
========================
  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
  and a more detailed descripton of the different ways to run the quickstarts.

  Make sure that the quickstarts.properties file contains the configuration
  information for the FTP hostname, user, password and base directory.

  Make sure that you have write access to the FTP server.

To Run standalone mode:
=======================
  1. In a command terminal window in the quickstart folder type
     'ant deploy-jms-dests'.
  2. In a command terminal window in this folder ("Window1"), type 'ant run'.
  3. Open another command terminal window in this folder ("Window2"), type
     'ant runtest'.
  4. Switch back to "Window1" to see the output from the ESB
  5. When finished, interrupt the ESB using Ctrl-C and, in this folder
     ("Window1"), type 'ant undeploy-jms-dests'.

To Run standalone mode readonly configuration:
==============================================
  1. In a command terminal window in this folder ("Window1"), type
     'ant deploy-jms-dests'.
  1. In a command terminal window in this folder ("Window2"), type
     'ant run-readonly'.
  2. In another command terminal window in this folder ("Window3"), type
     'ant run-readonly'.
  3. In "Window1", type 'ant runtest'.
  4. You should see the file contents displayed in the one of the listener
     windows.
     Log onto the ftpserver and see that the file has not been renamed.
  5. Examine the jboss-esb-readonly-unfiltered.xml file and specifically this
     ftp-listener section:

     <property name="remoteFileSystemStrategy-configFile"
       value="./ftpfile-cache-config.xml"/>
     <property name="remoteFileSystemStrategy-cacheListener"
       value="org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener"/> 

     Setting the deleteOnEviction to true will cause the file name to be deleted
     from the cacheloader. You can set the eviction time in
     ftpfile-cache-config.xml:

     <region name="/ftp/cache">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToLiveSeconds">20</attribute>
       <attribute name="maxAgeSeconds">20</attribute>
     </region>

     This will cause the filename to be deleted every 20 seconds. Such as short
     period is only for testing and a more realistic interval could perhaps be
     every day or so. 

To Run '.esb' archive mode:
===========================
  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
  2. Open another command terminal window in this folder ("Window2"), type
     'ant runtest'.
  3. Switch back to Application Server console to see the output from the ESB
  4. In this folder ("Window1"), type 'ant undeploy'.

To Run as a .esb archive readonly version:
==========================================
  1. In a command terminal window in this folder ("Window1"), type
     'ant deploy-readonly'.
  2. Open another command terminal window in this folder ("Window2"), type
     'ant runtest'.
  3. Switch back to Application Server console to see the output from the ESB
  4. In this folder ("Window1"), type 'ant undeploy'.
   
What to consider in this Quickstart:
===================================  
  1. The FTP configuration has been initialised in
     ../conf/quickstarts.properties

  2. The FTP directory is accessable and can be written to as the "in process"
     and "completed" files are renamed accordingly. 
  
     If you do not have write access you will receive an error that looks
     something like the following:
       [java] 20:41:36,625 ERROR [Thread-5][AbstractFileGateway] Problems
         renaming file new_file.dat to new_file.dat.esbWorking

  3. Running the read-only version: 
     Note that the database used by the cacheloader is hypersonic and it is an
     inmemory database. This means that if you close all the ESBs
     running('ant run-readonly') windows all files will be retrieved once more.
     This would not be the case with a persistent database.
