Package com.nt.udc.ndk.util
Class OIFtpPusher
java.lang.Object
java.lang.Thread
com.nt.udc.ndk.util.AbstractOIFtpPusher
com.nt.udc.ndk.util.OIFtpPusher
- All Implemented Interfaces:
Runnable
This class is intended to be used as a 'plug-in' module for OI Transports
to handle the transfer of completed files to a remote host. Once the
completed file has been successfully transferred, one of the following
will occur:
1) If this object is constructed with a 'transferred' file extension,
the file will be renamed with the given extension to indicated it
has already been transferred. It will be the responsibility of the
node (perhaps in the backup() method) or a process outside of the UDC
application to manage the files locally.
2) If a 'transferred' file extension is not provided at the time of
this object's construction, the local file will be deleted.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class com.nt.udc.ndk.util.AbstractOIFtpPusher
bFailed, DEFAULT_FTP_PORT, DEFAULT_SFTP_PORT, delay, errMesg, filesToFTP, ftpClient, ftpDirectory, ftpExtension, ftpFileType, ftpFilter, ftpHost, ftpPasswd, ftpPort, ftpRunning, ftpTimeInterval, ftpUser, hostsFile, interruptDelay, localDirectory, logger, oinode, passiveMode, sftpUsed, SSH_KNOWN_HOSTS_FILE
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionOIFtpPusher
(LoggerIfc lgr, String localdir, String ftphost, int ftpport, String ftpuser, String ftppasswd, String ftpdir, String ftpext, boolean sftpUsed, String hostsFile) Construct a newOIFtpPusher
to be used within anOITransport
object.OIFtpPusher
(LoggerIfc lgr, String localdir, String ftphost, String ftpuser, String ftppasswd, String ftpdir, String ftpext, boolean sftpUsed, String hostsFile) Construct a newOIFtpPusher
to be used within anOITransport
object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
transfer the files in this method.void
setInterestedObject
(FTPTransferNotificationIfc interestedObject) Methods inherited from class com.nt.udc.ndk.util.AbstractOIFtpPusher
enablePassiveMode, getFileMode, getFiles, getFtpDirectory, getFtpExtension, getFtpHost, getFtpLogin, getFtpPassword, getFtpPort, getFtpTimeInterval, getLocalDirectory, isHealthy, run, setAsciiFileMode, setBinaryFileMode, setFiles, setFtpDirectory, setFtpExtension, setFtpHost, setFtpLogin, setFtpPassword, setFtpPort, setFtpTimeInterval, setLocalDirectory, shutdown
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
OIFtpPusher
public OIFtpPusher(LoggerIfc lgr, String localdir, String ftphost, String ftpuser, String ftppasswd, String ftpdir, String ftpext, boolean sftpUsed, String hostsFile) throws NodeStartException Construct a newOIFtpPusher
to be used within anOITransport
object. The file transfers will occur based upon the provided configuration parameters.- Parameters:
lgr
- Reference to the log methods of the nodelocaldir
- Local directory containing the files to be transferredftphost
- Name/IP address of the remote ftp hostftpuser
- Name used to login to the remote hostftppasswd
- Password used to login to the remote hostftpdir
- Remote directory in which to place the filesftpext
- File extension used to tag the local files as having been transferred. If this parameter is null or zero-length, the local files will be deleted rather than renamed.sftpUsed
- If Sftp is usedhostsFile
- If Sftp is used, need to specify the hosts file which contains the server finger prints.- Throws:
NodeStartException
-
OIFtpPusher
public OIFtpPusher(LoggerIfc lgr, String localdir, String ftphost, int ftpport, String ftpuser, String ftppasswd, String ftpdir, String ftpext, boolean sftpUsed, String hostsFile) throws NodeStartException Construct a newOIFtpPusher
to be used within anOITransport
object. The file transfers will occur based upon the provided configuration parameters.- Parameters:
lgr
- Reference to the log methods of the nodelocaldir
- Local directory containing the files to be transferredftphost
- Name/IP address of the remote ftp hostftpport
- FTP port number, default is 21ftpuser
- Name used to login to the remote hostftppasswd
- Password used to login to the remote hostftpdir
- Remote directory in which to place the filesftpext
- File extension used to tag the local files as having been transferred. If this parameter is null or zero-length, the local files will be deleted rather than renamed.sftpUsed
- If Sftp is usedhostsFile
- If Sftp is used, need to specify the hosts file which contains the server finger prints.- Throws:
NodeStartException
-
-
Method Details
-
doTransfer
Description copied from class:AbstractOIFtpPusher
transfer the files in this method. The client has already logged into the server and cd to the remote directory- Specified by:
doTransfer
in classAbstractOIFtpPusher
- Throws:
IOException
-
setInterestedObject
-