129 *
bool opt_enabled = remove
opts.enabled;
130 hash<auto> attributes = {
132 "enabled":
enabled ?? opt_enabled ?? True,
155 constructor(
string name,
string description,
string url, hash<auto> attributes = {}, hash<auto> options = {});
195 hash<PingInfo>
ping(
bool throw_exception = False);
211 hash<ConnectionInfo>
getInfo(
bool with_password = False);
260 object get(
bool connect = True, *hash<auto> rtopts);
438 abstract
object getImpl(
bool connect = True, *hash<auto> rtopts);
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:34
string desc
connection description
Definition: AbstractConnection.qc.dox.h:41
bool locked
locked/unlocked flag
Definition: AbstractConnection.qc.dox.h:83
string getName()
Returns the connection name.
pingImpl()
performs the internal ping
hash< ConnectionInfo > getInfo(*hash< auto > opts)
returns a ConnectionInfo hash of information about the connection
hash< ConnectionInfo > getInfo(bool with_password=False)
returns a ConnectionInfo hash of information about the connection
bool hasDataProvider()
returns True if the connection returns a data provider with the getDataProvider() method
bool children_can_support_transactions
if the data provider or any of its children support transaction management
Definition: AbstractConnection.qc.dox.h:104
*hash< auto > opts
connection options
Definition: AbstractConnection.qc.dox.h:53
object getPollImpl()
Returns an unconnected object for a non-blocking poll operation.
object get(bool connect=True, *hash< auto > rtopts)
returns the underlying connection object
auto getTagEx(string tag)
returns the value of the given tag or throws an exception if the tag is not set with a value
hash< auto > internal_info
internal tags
Definition: AbstractConnection.qc.dox.h:107
*hash< auto > orig_opts
original connection options
Definition: AbstractConnection.qc.dox.h:50
*hash< auto > getRuntimeOptions()
returns runtime options
string url
connection URL (potentially with password info)
Definition: AbstractConnection.qc.dox.h:44
bool children_can_support_messages
if the data provider or any of its children support messages
Definition: AbstractConnection.qc.dox.h:101
hash< auto > getExtendedInfo(*hash< auto > opts)
Returns connection info plus any extended information returned by the connection.
bool monitor
monitoring flag
Definition: AbstractConnection.qc.dox.h:68
string safe_url
"safe" URL (password information removed)
Definition: AbstractConnection.qc.dox.h:47
setChildCapabilities()
Override to set child data provider capabilities once per child class.
Qore::AbstractPollOperation startPollConnect()
Called to start the connection polling operation.
hash< auto > tags
connection tags; user-defined key-value pairs
Definition: AbstractConnection.qc.dox.h:89
string getSafeUrl(hash< auto > urlh)
creates a "safe" URL string with password information removed
bool enabled
enabled/disabled indicator flag
Definition: AbstractConnection.qc.dox.h:80
AbstractDataProvider getDataProvider()
returns a data provider object for this connection, if supported
date last_check
date/time of last check/ping
Definition: AbstractConnection.qc.dox.h:59
bool up
connection status flag; set by monitoring or explicit pings/connections
Definition: AbstractConnection.qc.dox.h:65
hash< auto > validateOptions(hash< auto > options)
performs options validation in the constructor
string getDescription()
Returns the connection description.
hash< ConnectionSchemeInfo > getConnectionSchemeInfo()
Returns a default ConnectionSchemeInfo hash.
hash< PingInfo > pingIntern(hash< PingInfo > rv)
performs the ping by executing get(); returns a PingInfo hash
bool supportsPollingApi()
returns True if the connection supports the Qore Socket-based polling API
bool debug_data
debug data flag; to be used an an indication for a higher-level implementation
Definition: AbstractConnection.qc.dox.h:86
constructorInit(string name, string description, string url, hash< auto > attributes, hash< auto > options)
Common construtor implementation.
string name
connection name
Definition: AbstractConnection.qc.dox.h:38
hash< UrlInfo > parseUrl(string url)
Parse the URL to a hash.
hash< ConfigInfo > getConfigHash()
returns a ConfigInfo hash of static configuration information about the connection
*hash< auto > getOptions()
returns static / initialization options
hash< auto > getTags()
returns all tags associated with the connection
abstract object getImpl(bool connect=True, *hash< auto > rtopts)
this method must return the connection object corresponding to the object's configuration
deprecated constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh, *string safe_url, *bool enabled)
creates the AbstractConnection object
Definition: AbstractConnection.qc.dox.h:120
handlePingFailed(date delta, hash< ExceptionInfo > ex)
Handles a failed ping operation on the connection.
string getSafeUrl()
Returns the connection safe URL (without password info)
string getUrl()
Returns the connection URL.
*hash< auto > getDefaultOptions()
returns default options
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the AbstractConnection object
auto getTag(string tag)
returns the value of the given tag or NOTHING if not present
string status
status string; in case of a connection error this string will be the error string
Definition: AbstractConnection.qc.dox.h:62
parseTextOptions()
this method is called when parsing connection file definitions from text files when loading into the ...
date updated
date/time of last update
Definition: AbstractConnection.qc.dox.h:71
bool children_can_support_apis
if the data provider or any of its children support requests (APIs)
Definition: AbstractConnection.qc.dox.h:92
static *code post_processing
optional code for default post-processing of objects created by getImpl(); must take the connection o...
Definition: AbstractConnection.qc.dox.h:77
bool loopback
set to True for loopback connections
Definition: AbstractConnection.qc.dox.h:74
bool children_can_support_observers
if the data provider or any of its children support events
Definition: AbstractConnection.qc.dox.h:98
bool children_can_support_records
if the data provider or any of its children support records
Definition: AbstractConnection.qc.dox.h:95
abstract string getType()
returns the string type name for the connection object
handlePingFailed(date delta, string err)
Handles a failed ping operation on the connection.
hash< auto > urlh
broken down URL hash (as returned by Qore::parse_url())
Definition: AbstractConnection.qc.dox.h:56
hash< PingInfo > ping(bool throw_exception=False)
returns a hash with the results of the ping operation
*hash< auto > getRealOptions()
returns options for saving the connection's configuration information
handlePingSuccess(date delta)
Handles a successful ping operation on the connection.
The ConnectionProvider namespace.
Definition: AbstractConnection.qc.dox.h:28