public abstract class FtpTransportHandler
extends java.lang.Object
Upon instantiation, there should be ftp configuration settings available in the form of a config file. This class handles configuration settings related to:
Modifier and Type | Field and Description |
---|---|
protected Config |
config
Node configuration file.
|
protected Config |
ftpConfig
Ftp configuration file.
|
protected java.lang.Thread[] |
ftpThreads
Ftp threads, used to run the FtpTransportSession objects.
|
protected java.lang.String[] |
hosts
IP Addresses of remote ftp hosts.
|
protected java.io.File |
localDir
Local directory, where the transferred files should be put.
|
protected Logger |
logger
Event/Alarm logger.
|
protected java.lang.String[] |
loginStrs
Login strings.
|
protected java.awt.event.ActionListener |
processObj
Object notified when a ftp transfer is completed.
|
protected java.lang.String[] |
pwStrs
Password strings.
|
protected int |
totalHosts
Number of remote ftp hosts.
|
protected FtpTransportSession[] |
transports
Ftp transport session objects, used to connect to a specific
ftp host.
|
Constructor and Description |
---|
FtpTransportHandler(Config c,
java.io.File ld,
java.awt.event.ActionListener listener,
Logger l) |
Modifier and Type | Method and Description |
---|---|
protected void |
getFtpConfig()
Get some common ftp-related settings from the ftp config file;
See the class comments for more details.
|
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.
|
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 |
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.
|
protected Config ftpConfig
protected Config config
protected java.lang.Thread[] ftpThreads
protected FtpTransportSession[] transports
protected java.io.File localDir
protected int totalHosts
protected java.lang.String[] hosts
protected java.lang.String[] loginStrs
protected java.lang.String[] pwStrs
protected java.awt.event.ActionListener processObj
protected Logger logger
public FtpTransportHandler(Config c, java.io.File ld, java.awt.event.ActionListener listener, Logger l)
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.protected void getFtpConfig()
protected abstract void getSpecificFtpConfig()
public abstract void startRetrieval()
public void shutdown()