Package com.metasolv.nm.collector.file
Class FtpEIManager
java.lang.Object
com.metasolv.nm.collector.file.FtpEIManager
This class is based on the FtpEITransportHandler class.
The FtpEIManager class is responsible for initializing and managing a set
of FTP threads. It will parse the node's configuration object to determine
how many FTP servers were configured, and it will start one FtpEIThread thread
for each of them. It will also instantiate the FtpFileTracker object that is
used by the threads in order keep track of the files that they have retrieved
from the remote servers.
An example of the required ftp config file is:
#
# Comment lines begin with '#'...
#
NumberOfHosts 2
DelayTime 1
DelayTimeUnits Hours
DeleteFiles false
RenameFiles false
### Host0 ###
FtpType0 Regular
RemoteHost0 132.l23.204.39
RemoteDir0 /SYSTEM/DCLOG/
Mode0 simple
Prefix0
Suffix0 .txt
RegularExpression0
Login0 someUsername
Password0 somePassword
### Host1 ###
FtpType1 Regular
RemoteHost1 132.l23.204.40
RemoteDir1 /tmp
Mode1 regularexpression
Prefix1
Suffix1
RegularExpression1 .+\.txt
Login1 someUsername
Password1 somePassword
Use the '/' as the path separator, as this is the path separator
recognized by FTP servers regardless of the operating system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigIfcfinal Stringstatic final Stringprotected static final intprotected intprotected booleanprotected SynchronizedDirectoryprotected DCNodeprotected final intprotected Configprotected FtpFileTrackerprotected FtpEIThread[]protected String[]protected String[]protected static final intfinal Stringprotected final intprotected intprotected com.nt.common.util.SMGLockprotected booleanprotected Stringprotected LoggerIfcprotected String[]final Stringprotected static final intprotected String[]protected String[]protected String[]protected String[]protected String[]protected booleanprotected String[]protected int -
Constructor Summary
ConstructorsConstructorDescriptionFtpEIManager(SynchronizedDirectory localDir, String lSuffix, DCNode node) FtpEIManager(SynchronizedDirectory localDir, String lSuffix, DCNode node, FtpFileTracker tracker) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintbooleanvoidsetBinaryTransferMode(boolean isBinaryTransferMode) voidsetInterruptTimeDelay(int interruptTimeDelay) voidsetIOLock(com.nt.common.util.SMGLock lock) voidshutdown()void
-
Field Details
-
MIN
-
HR
-
DAYS
-
DAYS_TO_TRACK
- See Also:
-
MINUTES2SECS
protected static final int MINUTES2SECS- See Also:
-
HOURS2SECS
protected static final int HOURS2SECS- See Also:
-
DAYS2SECS
protected static final int DAYS2SECS- See Also:
-
FTP_DEFAULT_DELAY_TIME
protected final int FTP_DEFAULT_DELAY_TIME- See Also:
-
INTERRUPT_TIME_DELAY
protected final int INTERRUPT_TIME_DELAY- See Also:
-
dir
-
einode
-
config
-
logger
-
localSuffix
-
isBinaryTransferMode
protected boolean isBinaryTransferMode -
totalHosts
protected int totalHosts -
delayTime
protected int delayTime -
deleteFlag
protected boolean deleteFlag -
renameFlag
protected boolean renameFlag -
ftpType
-
hosts
-
remoteFileDirs
-
modes
-
prefixes
-
suffixes
-
regExps
-
loginStrs
-
pwStrs
-
ftpConfig
-
ftpFileTracker
-
ftpThreads
-
interruptTimeDelay
protected int interruptTimeDelay -
ioLock
protected com.nt.common.util.SMGLock ioLock
-
-
Constructor Details
-
FtpEIManager
public FtpEIManager(SynchronizedDirectory localDir, String lSuffix, DCNode node) throws NodeStartException - Throws:
NodeStartException
-
FtpEIManager
public FtpEIManager(SynchronizedDirectory localDir, String lSuffix, DCNode node, FtpFileTracker tracker) throws NodeStartException - Throws:
NodeStartException
-
-
Method Details
-
setBinaryTransferMode
public void setBinaryTransferMode(boolean isBinaryTransferMode) -
getFtpConfig
- Throws:
NodeStartException
-
startRetrieval
public void startRetrieval() -
shutdown
public void shutdown() -
isHealthy
public boolean isHealthy() -
getInterruptTimeDelay
public int getInterruptTimeDelay() -
setInterruptTimeDelay
public void setInterruptTimeDelay(int interruptTimeDelay) -
setIOLock
public void setIOLock(com.nt.common.util.SMGLock lock)
-