Qorus Integration Engine®
4.0.3.p2_git
|
this class is used to customize and control the behavior of Qorus FTP servers attached to services More...
Public Member Methods | |
constructor (*string v_root, bool v_bin=False, HttpServer::AbstractAuthenticator v_auth=new DefaultQorusRBACAuthenticator()) | |
creates the object with the given arguments More... | |
addListener (int port) | |
adds a listener from a port number; listener will start up on all interfaces on the given port More... | |
addListener (string bind) | |
adds a listener from a bind string in the format: "address:port" (ex: "192.168.20.1:8011" ) More... | |
addListeners (list l) | |
adds a list of listeners; each element should be either a bind string in the format: "address:port" (ex: "192.168.20.1:8011" ) or an integer port, meaning to bind on all interfaces on that port More... | |
*string | authReceiveFile (string cwd, string orig, reference< string > path) |
this method is run when the server receives a "STOR" command from the client but before the server opens the data channel to receive the file; return no value if the server should accept the file, otherwise return a string that will be passed back to the client with a 500 error code rejecting the "STOR" request More... | |
fileDataReceived (string path, data data) | |
this method is called when the server has received a file and no root directory is set More... | |
fileReceived (string path) | |
this method is called when the server has received a file More... | |
*string | authSendFile (string cwd, string orig, reference path) |
this method is run when the server receives a "RETR" command from the client but before the server opens the data channel to receive the file; return no value if the server should accept the file, otherwise return a string that will be passed back to the client with a 500 error code rejecting the request More... | |
data | sendFile (string path) |
this method is called when the server should send a file More... | |
*string | size (string v_cwd, string v_orig, string v_path, reference< int > v_size) |
this method is called when the "SIZE" command is received More... | |
*string | modifiedTime (string v_cwd, string v_orig, string v_path, reference< date > v_date) |
this method is called when the "MDTM" command is received More... | |
fileSent (string path) | |
this method is called when the server has sent a file More... | |
*string | authChangeDir (string v_cwd, string v_orig, reference< string > v_path) |
this method is run when the server receives a "CWD" command from the client but before the server updates the current working directory; return no value if the server should accept the change directory request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the "CWD" request More... | |
*string | authRename (string v_cwd, string v_orig, reference< string > v_path) |
this method is run when the server receives a "RNFR" command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the "RNFR" request More... | |
*string | rename (string v_cwd, string v_orig_to, string v_from, string v_to) |
this method is run when the server receives a "RNTO" command from the client; return no value if the server should accept the request (and thie method has already effected the rename of the file), otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
*string | list (string v_cwd, *string v_path, reference< string > v_output) |
this method is run when the server receives a "LIST" command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
*string | nlst (string v_cwd, *string v_path, reference< string > v_output) |
this method is run when the server receives a "NLST" command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
*string | machineListFile (string v_cwd, *string v_orig, string v_path, reference< string > v_output) |
this method is run when the server receives a "LIST" command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
*string | machineListDir (string v_cwd, *string v_orig, string v_path, reference v_output, reference< bool > v_isdir) |
this method is run when the server receives a "LIST" command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
string | getTargetPath (string v_path) |
returns the real path on the filesystem for the given virtual path | |
*string | makeDir (string v_cwd, string v_orig, string v_path) |
this method is run when the server receives a "MKD" command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
*string | removeDir (string v_cwd, string v_orig, string v_path) |
this method is run when the server receives a "RMD" command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
*string | deleteFile (string v_cwd, string v_orig, string v_path) |
this method is run when the server receives a "DELE" command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request More... | |
Public Attributes | |
*string | root |
the root directory for file-based FTP servers; if no value is set, then the file data will be passed to the fileDataReceived() method instead | |
bool | bin |
if False (the default), then files are received as strings, if True, then as binary objects; this only affects how file data is passed to the fileDataReceived() method | |
list< auto > | listeners = () |
list of listener info; do not write to this list directly, use AbstractFtpHandler::addListener() instead (the internal format may change) | |
HttpServer::AbstractAuthenticator | auth |
authentication object | |
this class is used to customize and control the behavior of Qorus FTP servers attached to services
OMQ::AbstractFtpHandler::addListener | ( | int | port | ) |
adds a listener from a port number; listener will start up on all interfaces on the given port
port | the port number to listen on; the listener will start up on all interfaces on the given port |
OMQ::AbstractFtpHandler::addListener | ( | string | bind | ) |
adds a listener from a bind string in the format: "address:port"
(ex: "192.168.20.1:8011"
)
bind | the address:port string to bind the listener to |
OMQ::AbstractFtpHandler::addListeners | ( | list | l | ) |
adds a list of listeners; each element should be either a bind string in the format: "address:port"
(ex: "192.168.20.1:8011"
) or an integer port, meaning to bind on all interfaces on that port
l | list of listeners; each element should be either a bind string in the format: "address:port" (ex: "192.168.20.1:8011" ) or an integer port, meaning to bind on all interfaces on that port |
*string OMQ::AbstractFtpHandler::authChangeDir | ( | string | v_cwd, |
string | v_orig, | ||
reference< string > | v_path | ||
) |
this method is run when the server receives a "CWD"
command from the client but before the server updates the current working directory; return no value if the server should accept the change directory request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the "CWD"
request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a reference to a string giving the normalized version of the directory name sent by the client (normalized means that it is a complete path from "/" without any references to ".." or "."); the actual directory name can be changed by this method by modifying the value of the reference (and returning NOTHING to authorize the change directory command) |
*string OMQ::AbstractFtpHandler::authReceiveFile | ( | string | cwd, |
string | orig, | ||
reference< string > | path | ||
) |
this method is run when the server receives a "STOR"
command from the client but before the server opens the data channel to receive the file; return no value if the server should accept the file, otherwise return a string that will be passed back to the client with a 500 error code rejecting the "STOR"
request
cwd | the current working directory |
orig | the original literal argument passed by the client |
path | a reference to a string giving the normalized path for the file that the client would like to send to the server; the actual file name can be changed by this method by modifying the value of the reference (and returning NOTHING to authorize the receipt of the file) |
"STOR"
request; note that the default is to return no value and therefore accept the file from the client*string OMQ::AbstractFtpHandler::authRename | ( | string | v_cwd, |
string | v_orig, | ||
reference< string > | v_path | ||
) |
this method is run when the server receives a "RNFR"
command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the "RNFR"
request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a reference to a string giving the normalized version of the path (normalized means that it is a complete path from "/" without any references to ".." or "."); the actual path can be changed by this method by modifying the value of the reference (and returning NOTHING to authorize the command) |
this method is run when the server receives a "RETR"
command from the client but before the server opens the data channel to receive the file; return no value if the server should accept the file, otherwise return a string that will be passed back to the client with a 500 error code rejecting the request
cwd | the current working directory |
orig | the original literal argument passed by the client |
path | a reference to a string giving the normalized path for the file that the client would like to receive from the server; the actual file name can be changed by this method by modifying the value of the reference (and returning NOTHING to authorize sending of the file) |
"STOR"
request; note that the default is to return no value and therefore accept the file from the client OMQ::AbstractFtpHandler::constructor | ( | *string | v_root, |
bool | v_bin = False , |
||
HttpServer::AbstractAuthenticator | v_auth = new DefaultQorusRBACAuthenticator() |
||
) |
creates the object with the given arguments
v_root | the root directory for file-based FTP handlers; if this argument is not set, then the filesystem is not directly accessed by this object; instead data will be provided or requested directly (see fileDataReceived()) |
v_bin | if True then each file received will be read in as a binary object (only has an effect when no root directory is set) |
v_auth | the HttpServer::AbstractAuthenticator for the object; if no argument is passed, then the system RBAC authenticator is used; meaning that Qorus application users are required to connect, and the users must have the OMQ::QR_LOGIN role to connect as well |
this method is run when the server receives a "DELE"
command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a string giving the normalized version of the path (normalized means that it is a complete path from "/" without any references to ".." or ".") |
OMQ::AbstractFtpHandler::fileDataReceived | ( | string | path, |
data | data | ||
) |
this method is called when the server has received a file and no root directory is set
path | the complete path of the file including the current working directory (starting from default "/" if the client did not issue any CWD commands) with the filename as given by the FTP client |
data | the file data; will be a string if bin is False, otherwise it will be a binary object |
OMQ::AbstractFtpHandler::fileReceived | ( | string | path | ) |
this method is called when the server has received a file
path | the complete path of the file that was saved to the filesystem including the current working directory (starting from default "/" if the client did not issue any CWD commands) with the filename as given by the FTP client; the path does not include the FTP handler base directory, so a path of "/" is based in the top-level directory of root |
OMQ::AbstractFtpHandler::fileSent | ( | string | path | ) |
this method is called when the server has sent a file
path | the complete path of the file that was sent including the current working directory (starting from default "/") with the filename as given by the FTP client; the path does not include the FTP handler base directory, so a path of "/" is based in the top-level directory of root |
*string OMQ::AbstractFtpHandler::list | ( | string | v_cwd, |
*string | v_path, | ||
reference< string > | v_output | ||
) |
this method is run when the server receives a "LIST"
command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_path | the original literal argument passed by the client |
v_output | assign an output string to this reference for the output to be returned to the client |
*string OMQ::AbstractFtpHandler::machineListDir | ( | string | v_cwd, |
*string | v_orig, | ||
string | v_path, | ||
reference | v_output, | ||
reference< bool > | v_isdir | ||
) |
this method is run when the server receives a "LIST"
command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a string giving the normalized version of the path argument (normalized means that it is a complete path from "/" without any references to ".." or ".") |
v_output | assign an output string to this reference for the output to be returned to the client |
v_isdir | if False on output and there is an error response, then a 501 code will be generated instead of a 550 code |
*string OMQ::AbstractFtpHandler::machineListFile | ( | string | v_cwd, |
*string | v_orig, | ||
string | v_path, | ||
reference< string > | v_output | ||
) |
this method is run when the server receives a "LIST"
command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a string giving the normalized version of the path argument (normalized means that it is a complete path from "/" without any references to ".." or ".") |
v_output | assign an output string to this reference for the output to be returned to the client |
this method is run when the server receives a "MKD"
command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a string giving the normalized version of the path (normalized means that it is a complete path from "/" without any references to ".." or ".") |
*string OMQ::AbstractFtpHandler::modifiedTime | ( | string | v_cwd, |
string | v_orig, | ||
string | v_path, | ||
reference< date > | v_date | ||
) |
this method is called when the "MDTM"
command is received
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | the complete path of the file including the current working directory (starting from default "/") with the filename as given by the FTP client |
v_date | a reference to a date for the last modified date of the file (output variable) |
*string OMQ::AbstractFtpHandler::nlst | ( | string | v_cwd, |
*string | v_path, | ||
reference< string > | v_output | ||
) |
this method is run when the server receives a "NLST"
command from the client; return no value and set the v_output reference if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_path | the original literal argument passed by the client |
v_output | assign an output string to this reference for the output to be returned to the client |
this method is run when the server receives a "RMD"
command from the client; return no value if the server should accept the request, otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | a string giving the normalized version of the path (normalized means that it is a complete path from "/" without any references to ".." or ".") |
*string OMQ::AbstractFtpHandler::rename | ( | string | v_cwd, |
string | v_orig_to, | ||
string | v_from, | ||
string | v_to | ||
) |
this method is run when the server receives a "RNTO"
command from the client; return no value if the server should accept the request (and thie method has already effected the rename of the file), otherwise return a string that will be passed back to the client with a 550 error code rejecting the request
v_cwd | the current working directory |
v_orig_to | the original literal argument passed by the client |
v_from | a string giving the normalized version of the "from" (source) path (normalized means that it is a complete path from "/" without any references to ".." or ".") |
v_to | a string giving the normalized version of the "to" (target) path (normalized means that it is a complete path from "/" without any references to ".." or ".") |
data OMQ::AbstractFtpHandler::sendFile | ( | string | path | ) |
this method is called when the server should send a file
path | the complete path of the file including the current working directory (starting from default "/") with the filename as given by the FTP client |
*string OMQ::AbstractFtpHandler::size | ( | string | v_cwd, |
string | v_orig, | ||
string | v_path, | ||
reference< int > | v_size | ||
) |
this method is called when the "SIZE"
command is received
v_cwd | the current working directory |
v_orig | the original literal argument passed by the client |
v_path | the complete path of the file including the current working directory (starting from default "/") with the filename as given by the FTP client |
v_size | a reference to an int for the file size (output variable) |