Qore ConnectionProvider Module Reference 1.9.1
Loading...
Searching...
No Matches
ConnectionProvider.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* ConnectionProvider.qm Copyright 2016 - 2023 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum required Qore module
26
27
28
29
200
202namespace ConnectionProvider {
204
210 *string module;
211
214
216 *softlist<auto> args;
217
219
230
232
243};
244
246
248public hashdecl ConnectionInfo {
250 string name;
251
253 string desc;
254
257
260
263
265 *hash opts;
266
268 string status;
269
271 string type;
272
274 bool up = False;
275
277 *date updated;
278
280
282 string url;
283
286
288
291
293
295 bool locked;
296
298
301
303 hash<auto> tags;
304
306 bool has_provider = False;
307
310
313
316
319
322};
323
325
327public hashdecl ConfigInfo {
328 string name;
329 string desc;
330 string url;
331 *hash opts;
332};
333
335
337public hashdecl PingInfo {
338 string name;
340
341 string desc;
343
344 *hash opts;
346
347 string url;
349
350 bool ok;
352
353 date time;
355
356 string info;
358
361
363 *hash<ExceptionInfo> ex;
364};
365
367
382 string get_connection_url(string str);
383
384
386
402
403
405
420 *hash<string, AbstractConnection> get_connections(*bool verbose);
421
422
424
439 *hash<string, hash<ConnectionInfo>> get_connection_hash(*bool verbose);
440
441}; // ConnectionProvider namespace
442
443// private, non-exported namespace
444namespace Priv {
445*hash priv_try_get_connections(string mod);
446
447
448ConnectionProvider::AbstractConnection priv_try_get_connection(string mod, string conn);
449
450}; // Priv nsmrspace
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:34
The ConnectionProvider namespace.
Definition: AbstractConnection.qc.dox.h:28
string get_connection_url(string str)
returns a URL string for the given identifier if the identifier is known to a registered connection p...
*hash< string, AbstractConnection > get_connections(*bool verbose)
returns all known connections as a hash keyed by connection identifier; values are AbstractConnection...
AbstractConnection get_connection(string conn)
returns an AbstractConnection object if the identifier is known to a registered connection provider
*hash< string, hash< ConnectionInfo > > get_connection_hash(*bool verbose)
returns a hash of connection information keyed by connection identifier; values are ConnectionInfo ha...
config informaton
Definition: ConnectionProvider.qm.dox.h:327
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:331
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:328
string desc
the description
Definition: ConnectionProvider.qm.dox.h:329
string url
the full URL (including any username & password)
Definition: ConnectionProvider.qm.dox.h:330
information that can be used to dynamically construct a connection object
Definition: ConnectionProvider.qm.dox.h:208
string class_name
the name of the constructor's class
Definition: ConnectionProvider.qm.dox.h:213
*string module
any module required to be loaded for the constructor call
Definition: ConnectionProvider.qm.dox.h:210
*string pre_processing
code to execute before construction to preprocess the constructor arguments
Definition: ConnectionProvider.qm.dox.h:242
*string post_processing
code to execute after construction
Definition: ConnectionProvider.qm.dox.h:229
*softlist< auto > args
the constructor arguments
Definition: ConnectionProvider.qm.dox.h:216
connection information hash
Definition: ConnectionProvider.qm.dox.h:248
hash< auto > tags
user-defined key-value pairs associated with the connection
Definition: ConnectionProvider.qm.dox.h:303
bool children_can_support_records
if the data provider or any of its children support records
Definition: ConnectionProvider.qm.dox.h:312
bool loopback
a boolean vaue indicating if the connection is a loopback connection
Definition: ConnectionProvider.qm.dox.h:259
bool has_provider
if the connection supports the data provider API
Definition: ConnectionProvider.qm.dox.h:306
*date last_check
the date/time value of the last connection check (or NOTHING if not checked)
Definition: ConnectionProvider.qm.dox.h:256
*hash opts
the original options used to create the object
Definition: ConnectionProvider.qm.dox.h:265
bool children_can_support_apis
if the data provider or any of its children support requests (APIs)
Definition: ConnectionProvider.qm.dox.h:309
bool monitor
a boolean vaue indicating if the connection should be monitored or not
Definition: ConnectionProvider.qm.dox.h:262
bool up
a boolean vaue indicating the connection is known to be up (will be False if not checked)
Definition: ConnectionProvider.qm.dox.h:274
bool children_can_support_messages
if the data provider or any of its children support messages
Definition: ConnectionProvider.qm.dox.h:318
bool locked
a boolean value indicating whether the connection is locked or not
Definition: ConnectionProvider.qm.dox.h:295
string name
the connection name
Definition: ConnectionProvider.qm.dox.h:250
bool children_can_support_transactions
if the data provider or any of its children support transaction management
Definition: ConnectionProvider.qm.dox.h:321
string type
the connection type
Definition: ConnectionProvider.qm.dox.h:271
*date updated
the date/time value of the update (or NOTHING if not updated)
Definition: ConnectionProvider.qm.dox.h:277
bool enabled
a boolean value indicating if the connection should be enabled or not
Definition: ConnectionProvider.qm.dox.h:290
bool debug_data
a boolean value indicating whether the connection should be subject to data debugging
Definition: ConnectionProvider.qm.dox.h:300
bool children_can_support_observers
if the data provider or any of its children support events
Definition: ConnectionProvider.qm.dox.h:315
string status
a string giving the connection's status
Definition: ConnectionProvider.qm.dox.h:268
string desc
the connection description
Definition: ConnectionProvider.qm.dox.h:253
string url
the URL for the connection including the password
Definition: ConnectionProvider.qm.dox.h:282
hash url_hash
a hash of URL information as returned by parse_url()
Definition: ConnectionProvider.qm.dox.h:285
ping response info
Definition: ConnectionProvider.qm.dox.h:337
date time
a relative date/time value giving the elapsed time of the ping operation
Definition: ConnectionProvider.qm.dox.h:353
string desc
the description
Definition: ConnectionProvider.qm.dox.h:341
*hash ping_info
an optional free-form hash giving additional info regarding ping operation or the remote system
Definition: ConnectionProvider.qm.dox.h:359
bool ok
a boolean value giving the result of the ping
Definition: ConnectionProvider.qm.dox.h:350
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:344
string url
a safe version of the URL (without passwords)
Definition: ConnectionProvider.qm.dox.h:347
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:338
string info
a string giving the result of the ping ("OK" or an error message)
Definition: ConnectionProvider.qm.dox.h:356