Qorus Integration Engine®  4.0.3_git
OMQ::AbstractFsRemoteReceive Class Referenceabstract

A class for inbound/reading data from the remote instance's filesystem. More...

Inheritance diagram for OMQ::AbstractFsRemoteReceive:
DataStreamClient::DataStreamRecvMessage

Public Member Methods

 constructor (string remote, string path, string streamType=TYPE_FILE, *hash options)
 Creates the object and starts receiving file data immediately. More...
 
 constructor (string remote, string conn, string path, string streamType=TYPE_FILE, *hash options)
 Creates the object and starts receiving file data immediately. More...
 
 constructor (QorusSystemRestHelper remote, string path, string streamType=TYPE_FILE, *hash options)
 Creates the object and starts receiving file data immediately. More...
 
 constructor (QorusSystemRestHelper remote, string conn, string path, string streamType=TYPE_FILE, *hash options)
 Creates the object and starts receiving file data immediately. More...
 
 receive ()
 receive reimplementation
 
abstract nothing recvDataImpl (auto row)
 An abstract method to handle incoming data/. More...
 
OMQ::StreamConfig config ()
 returns the configuration object
 
nothing rename (string target, softbool man=False)
 rename/move currently operated file given in path in constructor More...
 
nothing del (*string target)
 delete currently operated file given in path in constructor or any other file name More...
 
nothing delete (*string target)
 delete currently operated file given in path in constructor or any other file name More...
 

Public Attributes

const TYPE_FILE = "get-file"
 Raw file transfer.
 
const TYPE_CSV = "get-csv-data"
 Receive CSV data.
 
const TYPE_XML = "get-xml-data"
 Receive XML data.
 

Private Attributes

*string m_connection
 optional name of the user connection. It can be NOTHING if the non-connection methods should be called
 
bool complete
 flag indicating that all data has been taken from the Queue
 
FsReceiveStreamConfig m_config
 stream configuration
 

Detailed Description

A class for inbound/reading data from the remote instance's filesystem.

An abstract class to receive a file from remote Qorus instance.

The user has to reimplement the the recvDataImpl() method to handle incoming data.

Data are received in AbstractFsRemoteReceive_formats

Note
This class does not create a background thread.

AbstractFsRemoteReceive File Fomats
See also
AbstractFsRemoteReceive::recvDataImpl

AbstractFsRemoteReceive Options

Member Function Documentation

◆ constructor() [1/4]

OMQ::AbstractFsRemoteReceive::constructor ( string  remote,
string  path,
string  streamType = TYPE_FILE,
*hash  options 
)

Creates the object and starts receiving file data immediately.

Parameters
remotea string with a remote Qorus connection name as defined in Qorus to Qorus Connections
patha source (remote) file path
streamTypea string with AbstractFsRemoteReceive_formats
optionsoptional Streaming API Constructor Options with additional AbstractFsRemoteReceive_options

◆ constructor() [2/4]

OMQ::AbstractFsRemoteReceive::constructor ( string  remote,
string  conn,
string  path,
string  streamType = TYPE_FILE,
*hash  options 
)

Creates the object and starts receiving file data immediately.

Parameters
remotea string with a remote Qorus connection name as defined in Qorus to Qorus Connections
conna remote filesystem based user connection name
patha source (remote) file path, relative to the conn root
streamTypea string with AbstractFsRemoteReceive_formats
optionsoptional Streaming API Constructor Options with additional AbstractFsRemoteReceive_options

◆ constructor() [3/4]

OMQ::AbstractFsRemoteReceive::constructor ( QorusSystemRestHelper  remote,
string  path,
string  streamType = TYPE_FILE,
*hash  options 
)

Creates the object and starts receiving file data immediately.

Parameters
remotea QorusSystemRestHelper object
patha source (remote) file path
streamTypea string with AbstractFsRemoteReceive_formats
optionsoptional Streaming API Constructor Options with additional AbstractFsRemoteReceive_options

◆ constructor() [4/4]

OMQ::AbstractFsRemoteReceive::constructor ( QorusSystemRestHelper  remote,
string  conn,
string  path,
string  streamType = TYPE_FILE,
*hash  options 
)

Creates the object and starts receiving file data immediately.

Parameters
remotea string with a remote Qorus connection name as defined in Qorus to Qorus Connections
conna remote filesystem based user connection name
patha source (remote) file path, relative to the conn root
streamTypea string with AbstractFsRemoteReceive_formats
optionsoptional Streaming API Constructor Options with additional AbstractFsRemoteReceive_options

◆ del()

nothing OMQ::AbstractFsRemoteReceive::del ( *string  target)

delete currently operated file given in path in constructor or any other file name

Parameters
targetan optional new path with filename. Relative to user connection if the user connection constructor is used. If it's empty (NOTHING) the path specified in constructor is used. Otherwise any file name given to this method will be deleted.

◆ delete()

nothing OMQ::AbstractFsRemoteReceive::delete ( *string  target)

delete currently operated file given in path in constructor or any other file name

Parameters
targetan optional new path with filename. Relative to user connection if the user connection constructor is used. If it's empty (NOTHING) the path specified in constructor is used. Otherwise any file name given to this method will be deleted.

◆ recvDataImpl()

abstract nothing OMQ::AbstractFsRemoteReceive::recvDataImpl ( auto  row)
pure virtual

An abstract method to handle incoming data/.

Data are comming in a form regarding the stream type:

  • TYPE_FILE: string or binary
  • TYPE_CSV: list of hashes. See CsvUtil module for reference
  • TYPE_XML: list of hashes. XML serialized hashes.

◆ rename()

nothing OMQ::AbstractFsRemoteReceive::rename ( string  target,
softbool  man = False 
)

rename/move currently operated file given in path in constructor

Parameters
targeta new path with filename. Relative to user connection if the user connection constructor is used.
manrename the file manually by copying the file's data and then deleting the source file, this is sometimes necessary on some OSes when renaming files across filesystem boundaries
Warning
The original file after the rename does not exist anymore if man is set to True. Any additional append() call will result in an exception.
Note
do not call this method before all data have been received

The documentation for this class was generated from the following file: