Package com.nt.udc.util
Class FtpTransportHandler
java.lang.Object
com.nt.udc.util.FtpTransportHandler
This class defines some common members and methods used in starting and
maintaining FtpTransportSession classes.
number of hosts
ip addresses of hosts
login strings
password strings
Upon instantiation, there should be ftp configuration settings available in the form of a config file. This class handles configuration settings related to:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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.protected FtpTransportSession[]
Ftp transport session objects, used to connect to a specific ftp host. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
shutdown()
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.
-
Field Details
-
ftpConfig
Ftp configuration file. -
config
Node configuration file. -
ftpThreads
Ftp threads, used to run the FtpTransportSession objects. -
transports
Ftp transport session objects, used to connect to a specific ftp host. -
localDir
Local directory, where the transferred files should be put. -
totalHosts
protected int totalHostsNumber of remote ftp hosts. -
hosts
IP Addresses of remote ftp hosts. -
loginStrs
Login strings. -
pwStrs
Password strings. -
processObj
Object notified when a ftp transfer is completed. -
logger
Event/Alarm logger.
-
-
Constructor Details
-
FtpTransportHandler
- 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.
-