185 const DefaultDescription =
"n/a; update connection to use the `AbstractConnectionWithInfo` class instead";
233 deprecated
constructor(
string name,
string description,
string url, hash<auto> attributes = {}, hash<auto> options = {}, *LoggerInterface logger) ;
329 hash<PingInfo>
ping(
bool throw_exception);
339 hash<PingInfo>
ping(
int ping_flags = 0);
365 hash<ConnectionInfo>
getInfo(
bool with_password = False);
467 object get(
bool connect = True, *hash<auto> rtopts);
537 AbstractDataProvider
getDataProvider(
string subtype, *hash<auto> constructor_options);
614 static string getRealUrl(
string url, hash<ConnectionSchemeInfo> info,
string type);
671 *hash<auto>
getSubtypeOptions(*hash<
string, hash<DataProviderOptionInfo>> subtype_options, *hash<auto> constructor_options);
792 abstract
object getImpl(
bool connect = True, *hash<auto> rtopts);
Abstract base class for connections.
Definition AbstractConnection.qc.dox.h:69
string desc
Connection description with markdown formatting.
Definition AbstractConnection.qc.dox.h:82
bool locked
locked/unlocked flag
Definition AbstractConnection.qc.dox.h:138
string display_name
Display name.
Definition AbstractConnection.qc.dox.h:76
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
const DefaultDescription
Default option description.
Definition AbstractConnection.qc.dox.h:185
bool children_can_support_transactions
if the data provider or any of its children support transaction management
Definition AbstractConnection.qc.dox.h:159
*hash< auto > opts
connection options
Definition AbstractConnection.qc.dox.h:97
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
const CF_LOGGER
Connection feature: Logger support.
Definition AbstractConnection.qc.dox.h:173
*hash< string, hash< DataProviderOptionInfo > > getDataProviderConstructorOptionsImpl()
Returns a hash of data provider constructor option info, if applicable.
auto getTagEx(string tag)
returns the value of the given tag or throws an exception if the tag is not set with a value
const CommonConnectionKeys
Connection info keys mapped 1:1 to DataProviderOptionInfo keys.
Definition AbstractConnection.qc.dox.h:188
bool needsAuth()
Returns True if the connection requires OAuth2 authorization before it can be used.
hash< auto > internal_info
internal tags (serializable)
Definition AbstractConnection.qc.dox.h:162
*hash< auto > orig_opts
original connection options
Definition AbstractConnection.qc.dox.h:94
*hash< auto > getRuntimeOptions()
returns runtime options
string url
Connection URL (potentially with password info)
Definition AbstractConnection.qc.dox.h:85
bool children_can_support_messages
if the data provider or any of its children support messages
Definition AbstractConnection.qc.dox.h:156
AbstractDataProvider getDataProvider(string subtype, *hash< auto > constructor_options)
Returns a data provider object for the connection and subtype passed as an argument.
*hash< string, bool > getFeaturesImpl()
Returns a hash of connection-defined features.
hash< auto > getExtendedInfo(*hash< auto > opts)
Returns connection info plus any extended information returned by the connection.
Qore::AbstractPollOperation startPollConnect(*Logger::LoggerInterface logger)
Called to start the connection polling operation.
bool monitor
monitoring flag
Definition AbstractConnection.qc.dox.h:112
string safe_url
"safe" URL (password information removed)
Definition AbstractConnection.qc.dox.h:88
static hash< ConnectionOptionInfo > getConnectionOptionInfo(hash< DataProviderOptionInfo > dinfo)
Returns a ConnectionOptionInfo hash from a DataProviderOptionInfo hash.
static string getRealUrl(string url, hash< ConnectionSchemeInfo > info, string type)
Returns the real URL for a connection URL.
setChildCapabilities()
Override to set child data provider capabilities once per child class.
hash< auto > tags
connection tags; user-defined key-value pairs
Definition AbstractConnection.qc.dox.h:144
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:135
hash< PingInfo > ping(bool throw_exception)
returns a hash with the results of the ping operation
string real_url
A string containing the real URL using a non-abstract / technical scheme.
Definition AbstractConnection.qc.dox.h:91
*hash< auto > getConnectionOptions(*hash< auto > rtopts)
returns options for creating a new connection
bool up
connection status flag; set by monitoring or explicit pings/connections
Definition AbstractConnection.qc.dox.h:109
string getDescription()
Returns the connection description.
hash< ConnectionSchemeInfo > getConnectionSchemeInfo()
Returns a default ConnectionSchemeInfo hash.
static hash< string, hash< ConnectionOptionInfo > > getConnectionOptionInfo(hash< string, hash< DataProviderOptionInfo > > dinfo)
Returns a hash of ConnectionOptionInfo hashes from a hash of DataProviderOptionInfo hashes.
const CF_UPDATE_OPTIONS
Connection feature: Update Options support.
Definition AbstractConnection.qc.dox.h:182
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Override in subclasses to return a native 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
string customization_status
Customization status.
Definition AbstractConnection.qc.dox.h:124
hash< PingInfo > ping(int ping_flags=0)
returns a hash with the results of the ping operation
bool debug_data
debug data flag; to be used an an indication for a higher-level implementation
Definition AbstractConnection.qc.dox.h:141
string name
Connection name.
Definition AbstractConnection.qc.dox.h:73
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< string, *hash< string, hash< DataProviderOptionInfo > > > getDataProviderSubtypesImpl()
Returns a hash of supported data provider subtypes.
startCustomization(*bool restart)
Starts customization for the object.
setRealUrl(*string url)
Called by the constructor to set the real URL.
transient hash< auto > transient_info
internal transient tags (non-serializable)
Definition AbstractConnection.qc.dox.h:168
deprecated constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={}, *LoggerInterface logger)
creates the AbstractConnection object
*string getAppName()
Returns the data provider application name this connection serves, if any.
*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
handlePingFailed(date delta, hash< ExceptionInfo > ex)
Handles a failed ping operation on the connection.
hash< auto > validateOptions(hash< auto > options, bool check_required=True)
performs options validation in the constructor
string getSafeUrl()
Returns the connection safe URL (without password info)
constructorInit(hash< auto > config, *hash< auto > attr)
Common construtor implementation.
string getUrl()
Returns the connection URL.
*hash< auto > getDefaultOptions()
returns default options
auto getTag(string tag)
returns the value of the given tag or NOTHING if not present
string getShortDescription()
Returns the connection short description.
AbstractDataProvider getDataProviderImpl(string subtype, *hash< auto > constructor_options)
returns a data provider object for the connection and subtype passed as an argument
string status
status string; in case of a connection error this string will be the error string
Definition AbstractConnection.qc.dox.h:106
parseTextOptions()
this method is called when parsing connection file definitions from text files when loading into the ...
hash< ConnectionDataInfo > getInfoAsData(*hash< auto > opts)
Returns a ConnectionDataInfo hash of information about the connection.
date updated
date/time of last update
Definition AbstractConnection.qc.dox.h:115
string getDisplayName()
Returns the connection display name.
bool children_can_support_apis
if the data provider or any of its children support requests (APIs)
Definition AbstractConnection.qc.dox.h:147
static *code post_processing
optional code for default post-processing of objects created by getImpl()
Definition AbstractConnection.qc.dox.h:132
bool loopback
set to True for loopback connections
Definition AbstractConnection.qc.dox.h:118
bool children_can_support_observers
if the data provider or any of its children support events
Definition AbstractConnection.qc.dox.h:153
*date customization_timestamp
Customization timestamp.
Definition AbstractConnection.qc.dox.h:127
bool children_can_support_records
if the data provider or any of its children support records
Definition AbstractConnection.qc.dox.h:150
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.
bool supports_customization
Customization support?
Definition AbstractConnection.qc.dox.h:121
hash< auto > urlh
broken down URL hash (as returned by Qore::parse_url())
Definition AbstractConnection.qc.dox.h:100
*hash< string, hash< DataProviderOptionInfo > > getDataProviderConstructorOptions()
Returns a hash of data provider constructor option info, if applicable.
constructor(hash< auto > config, *hash< auto > attr)
creates the AbstractConnection object
startCustomizationImpl()
Starts customization for the object.
*hash< auto > getSubtypeOptions(*hash< string, hash< DataProviderOptionInfo > > subtype_options, *hash< auto > constructor_options)
Returns options for each data provider subtype.
*string short_desc
Connection short description in plain text.
Definition AbstractConnection.qc.dox.h:79
*hash< auto > getRealOptions()
returns options for saving the connection's configuration information
hash< auto > getExtendedInfoAsData(*hash< auto > opts)
Returns connection info plus any extended information returned by the connection.
AbstractDataProvider getDataProvider(*hash< auto > constructor_options)
returns a data provider object for this connection, if supported
*hash< string, *hash< string, hash< DataProviderOptionInfo > > > getDataProviderSubtypes()
Returns a hash of supported data provider subtypes and constructor option info.
*hash< string, bool > getFeatures()
Returns a list of connection-defined features.
bool disable_automatic_pings
If automatic pings are disabled.
Definition AbstractConnection.qc.dox.h:165
handlePingSuccess(date delta)
Handles a successful ping operation on the connection.
*date last_check
date/time of last check/ping
Definition AbstractConnection.qc.dox.h:103
Class with helper methods to options in a hash.
Definition OptionHelper.qc.dox.h:30
const CCS_IN_PROGRESS
Customization status: in-progress.
Definition AbstractConnection.qc.dox.h:56
const CCS_CUSTOMIZED
Customization status: customized.
Definition AbstractConnection.qc.dox.h:61
const CCS_UNSUPPORTED
Definition AbstractConnection.qc.dox.h:46
const CCS_UNCUSTOMIZED
Customization status: uncustomized.
Definition AbstractConnection.qc.dox.h:51
const PF_THROW_EXCEPTION
Definition AbstractConnection.qc.dox.h:33
const PF_AUTOMATIC_PING
Ping flag: automatic / scheduled ping.
Definition AbstractConnection.qc.dox.h:39
The ConnectionProvider namespace.
Definition AbstractConnection.qc.dox.h:28