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 ConfigIfc
final String
static final String
protected static final int
protected int
protected boolean
protected SynchronizedDirectory
protected DCNode
protected final int
protected Config
protected FtpFileTracker
protected FtpEIThread[]
protected String[]
protected String[]
protected static final int
final String
protected final int
protected int
protected com.nt.common.util.SMGLock
protected boolean
protected String
protected LoggerIfc
protected String[]
final String
protected static final int
protected String[]
protected String[]
protected String[]
protected String[]
protected String[]
protected boolean
protected 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 void
int
boolean
void
setBinaryTransferMode
(boolean isBinaryTransferMode) void
setInterruptTimeDelay
(int interruptTimeDelay) void
setIOLock
(com.nt.common.util.SMGLock lock) void
shutdown()
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)
-