Class FtpTransportHandler

java.lang.Object
com.nt.udc.util.FtpTransportHandler

public abstract class FtpTransportHandler extends Object
This class defines some common members and methods used in starting and maintaining FtpTransportSession classes.

Upon instantiation, there should be ftp configuration settings available in the form of a config file. This class handles configuration settings related to:

  • number of hosts
  • ip addresses of hosts
  • login strings
  • password strings
    • Field Summary

      Fields
      Modifier and Type
      Field
      Description
      protected Config
      Node configuration file.
      protected Config
      Ftp configuration file.
      protected Thread[]
      Ftp threads, used to run the FtpTransportSession objects.
      protected String[]
      IP Addresses of remote ftp hosts.
      protected File
      Local directory, where the transferred files should be put.
      protected Logger
      Event/Alarm logger.
      protected String[]
      Login strings.
      protected ActionListener
      Object notified when a ftp transfer is completed.
      protected String[]
      Password strings.
      protected int
      Number of remote ftp hosts.
      Ftp transport session objects, used to connect to a specific ftp host.
    • Constructor Summary

      Constructors
      Constructor
      Description
       
    • Method Summary

      Modifier and Type
      Method
      Description
      protected void
      Get some common ftp-related settings from the ftp config file; See the class comments for more details.
      protected abstract void
      Abstract method to get node-specific ftp configurations; Obtain the settings from either the ftp Config object, or node Config object.
      void
      Default shutdown method, which should be called by the node's shutdown method; This method currently just calls the FtpTransportSession objects' shutdown methods.
      abstract void
      Abstract method to actually start the ftp retrieval; In general, this method should create the appropriate FtpTransportSession object, and start the actual retrieval threads.

      Methods inherited from class java.lang.Object

      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Details

      • ftpConfig

        protected Config ftpConfig
        Ftp configuration file.
      • config

        protected Config config
        Node configuration file.
      • ftpThreads

        protected Thread[] ftpThreads
        Ftp threads, used to run the FtpTransportSession objects.
      • transports

        protected FtpTransportSession[] transports
        Ftp transport session objects, used to connect to a specific ftp host.
      • localDir

        protected File localDir
        Local directory, where the transferred files should be put.
      • totalHosts

        protected int totalHosts
        Number of remote ftp hosts.
      • hosts

        protected String[] hosts
        IP Addresses of remote ftp hosts.
      • loginStrs

        protected String[] loginStrs
        Login strings.
      • pwStrs

        protected String[] pwStrs
        Password strings.
      • processObj

        protected ActionListener processObj
        Object notified when a ftp transfer is completed.
      • logger

        protected Logger logger
        Event/Alarm logger.
    • Constructor Details

      • FtpTransportHandler

        public FtpTransportHandler(Config c, File ld, ActionListener listener, Logger l)
        Parameters:
        c - Ftp configuration file object.
        ld - Local directory, location of transferred files.
        listener - Object notified when transfer is completed.
        l - Logger, for alarms and information.
    • Method Details

      • getFtpConfig

        protected void getFtpConfig()
        Get some common ftp-related settings from the ftp config file; See the class comments for more details.
      • getSpecificFtpConfig

        protected abstract void getSpecificFtpConfig()
        Abstract method to get node-specific ftp configurations; Obtain the settings from either the ftp Config object, or node Config object.
      • startRetrieval

        public abstract void startRetrieval()
        Abstract method to actually start the ftp retrieval; In general, this method should create the appropriate FtpTransportSession object, and start the actual retrieval threads.
      • shutdown

        public void shutdown()
        Default shutdown method, which should be called by the node's shutdown method; This method currently just calls the FtpTransportSession objects' shutdown methods.