|
| constructor (hash< auto > nconf) |
| creates the FtpPoller object from the configuration hash argument passed
|
|
| constructor (Qore::FtpClient n_ftp, hash< auto > nconf) |
| creates the FtpPoller object from the FtpClient argument and configuration hash argument passed
|
|
| destructor () |
| stops the polling operation if in progress and destroys the object
|
|
*bool | fileEvent (list< hash< FtpPollerFileEventInfo > > l) |
| called for each poll with a list of all files matched before transfer
|
|
binary | getFile (string path) |
| retrieves a binary file and returns the file's contents
|
|
list< hash< FtpPollerFileEventInfo > > | getFiles (string subdir, int sort=FtpPoller::SortNone, int order=FtpPoller::OrderAsc) |
| returns a list of regular file hashes matching any file name mask set for the object
|
|
int | getPollCount () |
| returns the current poll count
|
|
hash< FtpPollerFileEventInfo > | getRemoteFileData (hash< FtpPollerFileEventInfo > event) |
| Retrieves remote file data and adds it to the event data.
|
|
| getStoreFile (string remote_path, string local_path) |
| retrieves a remote file and stores it to a local path
|
|
string | getTextFile (string path) |
| retrieves a text file and returns the file's contents
|
|
abstract | postSingleFileEvent (hash< FtpPollerFileEventInfo > event) |
| called after singleFileEvent() for each matching file individually
|
|
| removeFile (string fn) |
| deletes a file on the server
|
|
| rename (string old, string nnew) |
| renames a file on the server
|
|
bool | runOnce () |
| runs a single poll (useful for checking for errors inline before starting a background thread)
|
|
abstract | singleFileEvent (hash< FtpPollerFileEventInfo > event) |
| called for each matching file individually whenever matching files are polled
|
|
int | start () |
| starts polling in the background; returns the thread ID of the polling thread
|
|
| startInline () |
| starts the polling operation inline (not in a background thread)
|
|
| stop () |
| stops the polling operation, returns when the polling operation has been stopped
|
|
| stopNoWait () |
| stops the polling operation, returns immediately
|
|
| updateOptions (FtpClient ftp) |
| Updates options.
|
|
| waitStop () |
| waits indefinitely for the polling operation to stop
|
|
|
| ftpSleep (softint secs) |
| sleeps for the specificed number of seconds
|
|
| logDebug (string fmt,...) |
| calls the "log_debug" closure or call reference with verbose debugging information
|
|
| logDetail (string fmt,...) |
| calls the "log_detail" closure or call reference with detail information
|
|
| logInfo (string fmt,...) |
| calls the "log_info" closure or call reference with important information
|
|
Mutex | m () |
| start mutex
|
|
hash< FtpPollerFileEventInfo > | retrieveFile (hash< FtpPollerFileEventInfo > event) |
| Retrieves the remote file to local_dir directly.
|
|
hash< FtpPollerFileEventInfo > | retrieveTempFile (hash< FtpPollerFileEventInfo > event) |
| Retrieves the remote file to local_dir using a temporary file.
|
|
| run () |
| starts the polling operation
|
|
Counter | sc () |
| stop counter
|
|
| setMask () |
| converts a glob mask into a regex
|
|
|
bool | atomic_transfer |
| Atomic transfer flag for use with local_dir .
|
|
bool | delete_remote_file |
| Delete file on remote FTP server after processing?
|
|
bool | fatal = False |
| internal fatal error flag
|
|
Qore::FtpClient | ftp |
| FtpClient object.
|
|
bool | get_files |
| internal "get files" flag
|
|
string | host |
| host or address name
|
|
string | local_dir |
| Local directory to transfer file.
|
|
*code | log_debug |
| optional debug log closure
|
|
*code | log_detail |
| optional detail log closure
|
|
*code | log_info |
| optional info log closure
|
|
*string | mask |
| file glob name mask (ignored if "regex_mask" also set)
|
|
*softint | minage |
| minimum file age
|
|
*string | move_remote_file |
| Remote target directory for moving the file on the remote FTP server after processing.
|
|
FtpClient | new_ftp |
| Connection to update while polling.
|
|
*string | pass |
| password
|
|
softlist< string > | path = "." |
| path(s) to poll
|
|
int | poll_interval |
| poll interval in seconds
|
|
int | pollcnt = 0 |
| internal poll counter
|
|
int | port |
| port
|
|
string | protocol |
| Protocol ("ftp" or "ftps")
|
|
int | reopts = 0 |
| file matching regex options
|
|
string | rootFtpPath |
| path after connecting to Ftp server
|
|
bool | runflag = False |
| run flag
|
|
*code | sleep |
| optional sleep closure
|
|
*code | start_thread |
| optional start thread closure
|
|
string | tempfile_template |
| The temporary filename template when local_dir is set.
|
|
int | tid |
| polling tid
|
|
timeout | timeout |
| timeout in ms
|
|
string | url |
| url
|
|
hash< UrlInfo > | urlh |
| url hash
|
|
string | user |
| user
|
|
FtpPoller client class implementation.
See the constructor options for information on how to configure this object; note that either
delete_remote_file
or
move_remote_file
must be set, or FTP files polled will remain where they are in the remote FTP server, unless they are removed or moved during polling processing.
Only one of these options may be set at one time; setting both will result in an error
abstract FtpPoller::FtpPoller::postSingleFileEvent |
( |
hash< FtpPollerFileEventInfo > | event | ) |
|
called after singleFileEvent() for each matching file individually
If any error occurs here, the polling operation stops
This method would normally delete / rename / move files processed by singleFileEvent() so that they would not be polled a second time. If an error occurs in this operation, then the polling event will stop since continuing after failing to delete, rename, or move a file already processed would cause the file to be processed more than once.
- Parameters
-