Qorus Integration Engine  3.0.4.p7
OMQ::AbstractConnection Class Referenceabstract

abstract base class for user connection type More...

Inheritance diagram for OMQ::AbstractConnection:
OMQ::FilesystemConnection OMQ::FtpConnection OMQ::HttpConnection OMQ::JsonRpcConnection OMQ::Pop3Connection OMQ::RestConnection OMQ::SftpConnection OMQ::SmtpConnection OMQ::SoapConnection OMQ::TelnetConnection OMQ::UserWebSocketConnection OMQ::XmlRpcConnection OMQ::YamlRpcConnection

Public Member Functions

 constructor (string $name, string $desc, string $url, bool $monitor, *hash $opts, hash $urlh, *string $safe_url)
 creates the AbstractConnection object More...
 
hash ping (bool $throw_exception=False)
 returns a hash with the connection status with "ok" and "info" keys
 
hash getInfo (bool $with_password=False)
 returns a hash of information about the connection More...
 
*hash getOptions ()
 returns static / initialization options
 
*hash getRuntimeOptions ()
 returns runtime options
 
object get (bool $connect=True, *hash $rtopts)
 returns the underlying connection object More...
 
 parseTextOptions ()
 this method is called when parsing connection file definitions from text files when loading into the database More...
 

Public Attributes

string name
 connection name
 
string desc
 connection description
 
string url
 connection URL (potentially with password info)
 
string safe_url
 "safe" URL (password information removed)
 
bool monitor
 monitoring flag
 
*hash opts
 connection options
 
hash urlh
 broken down URL hash (as returned by Qore::parse_url())
 
date last_check
 date/time of last check/ping
 
date updated
 date/time of last status update
 
string status = "not checked"
 status string; in case of a connection error this string will be the error string
 
bool up = False
 connection status flag; set by monitoring or explicit pings/connections
 
bool loopback = False
 set to True for loopback connections
 

Private Member Functions

private doEnvOptions ()
 helper method for post-processing options for environment variable substitution; can be called in subclasses' constructor methods with a list of options to have environment variable substitution performed on them
 
abstract private object getImpl (bool $connect=True, *hash $rtopts)
 this method must return the connection object corresponding to the object's configuration More...
 
abstract string getType ()
 returns the string type name for the connection object
 

Static Private Member Functions

static private string getSafeUrl (hash $urlh)
 creates a "safe" URL string with password information removed More...
 

Detailed Description

abstract base class for user connection type

this class can be specialized in user modules to provide for user-defined connection types

See also
Since
Qorus 3.0.0

Member Function Documentation

OMQ::AbstractConnection::constructor ( string  $name,
string  $desc,
string  $url,
bool  $monitor,
*hash  $opts,
hash  $urlh,
*string  $safe_url 
)
inline

creates the AbstractConnection object

Parameters
namethe name of the connection
descconnection description
urlconnection URL (potentially with password info)
monitormonitoring flag
optsconnection options
urlhbroken down URL hash (as returned by Qore::parse_url())
safe_url"safe" URL (password information removed); if not set this will be set automatically by calling getSafeUrl()
object OMQ::AbstractConnection::get ( bool  $connect = True,
*hash  $rtopts 
)
inline

returns the underlying connection object

calls getImpl() to actually acquire the connection object

abstract private object OMQ::AbstractConnection::getImpl ( bool  $connect = True,
*hash  $rtopts 
)
privatepure virtual

this method must return the connection object corresponding to the object's configuration

Parameters
connectif True then the connection should be returned connected (and if possible a round-trip "ping" of the server should be made)
rtoptsif the object acquisition requires any runtime options, then these are passed here
Returns
the connection object

Implemented in OMQ::JsonRpcConnection, OMQ::XmlRpcConnection, OMQ::YamlRpcConnection, OMQ::UserWebSocketConnection, OMQ::UserWebSocketConnection, OMQ::RestConnection, OMQ::SoapConnection, OMQ::SoapConnection, OMQ::TelnetConnection, OMQ::TelnetConnection, OMQ::SftpConnection, OMQ::SftpConnection, OMQ::Pop3Connection, OMQ::Pop3Connection, OMQ::SmtpConnection, OMQ::SmtpConnection, OMQ::FilesystemConnection, OMQ::HttpConnection, and OMQ::FtpConnection.

hash OMQ::AbstractConnection::getInfo ( bool  $with_password = False)
inline

returns a hash of information about the connection

Parameters
with_passworddetermines if the password is returned or not
Returns
a hash of information about the connection
static private string OMQ::AbstractConnection::getSafeUrl ( hash  $urlh)
inlinestaticprivate

creates a "safe" URL string with password information removed

Parameters
urlhbroken down URL hash (as returned by Qore::parse_url())
Returns
a "safe" URL string with password information removed
OMQ::AbstractConnection::parseTextOptions ( )
inline

this method is called when parsing connection file definitions from text files when loading into the database

reimplement this method in subclasses to parse the option hash as set from a text file if needed (for special option formats, etc)


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