| Qore ConnectionProvider Module Reference 1.7.1

ConnectionProvider.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
4 /* ConnectionProvider.qm Copyright 2016 - 2022 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
167
169 namespace ConnectionProvider {
171
175 public struct ConnectionConstructorInfo {
177 *string module;
178
180 string class_name;
181
183 *softlist<auto> args;
184
186
196 *string post_processing;
197
199
209 *string pre_processing;
210 };
211
213
215 public struct ConnectionInfo {
217 string name;
218
220 string desc;
221
223 *date last_check;
224
226 bool loopback;
227
229 bool monitor;
230
232 *hash opts;
233
235 string status;
236
238 string type;
239
241 bool up = False;
242
244 *date updated;
245
247
249 string url;
250
252 hash url_hash;
253
255
257 bool enabled;
258
260
262 bool locked;
263
265
267 bool debug_data;
268
270 hash<auto> tags;
271
273 bool has_provider = False;
274
276 bool children_can_support_apis = False;
277
279 bool children_can_support_records = False;
280
282 bool children_can_support_observers = False;
283
285 bool children_can_support_messages = False;
286 };
287
289
291 public struct ConfigInfo {
292 string name;
293 string desc;
294 string url;
295 *hash opts;
296 };
297
299
301 public struct PingInfo {
302 string name;
304
305 string desc;
307
308 *hash opts;
310
311 string url;
313
314 bool ok;
316
317 date time;
319
320 string info;
322
323 *hash ping_info;
325
327 *hash<ExceptionInfo> ex;
328 };
329
331
346 string get_connection_url(string str);
347
348
350
365 AbstractConnection get_connection(string conn);
366
367
369
384 *hash<string, AbstractConnection> get_connections(*bool verbose);
385
386
388
403 *hash<string, hash<ConnectionInfo>> get_connection_hash(*bool verbose);
404
405 }; // ConnectionProvider namespace
406
407 // private, non-exported namespace
408 namespace Priv {
409 *hash priv_try_get_connections(string mod);
410
411
412 ConnectionProvider::AbstractConnection priv_try_get_connection(string mod, string conn);
413
414 }; // Priv nsmrspace
ConnectionProvider::AbstractConnection
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:34
False
const False
date
date date(date dt)
hash
hash< auto > hash(object obj)
ConnectionProvider
The ConnectionProvider namespace.
Definition: AbstractConnection.qc.dox.h:28
ConnectionProvider::get_connection_url
string get_connection_url(string str)
returns a URL string for the given identifier if the identifier is known to a registered connection p...
ConnectionProvider::get_connections
*hash< string, AbstractConnection > get_connections(*bool verbose)
returns all known connections as a hash keyed by connection identifier; values are AbstractConnection...
ConnectionProvider::get_connection_hash
*hash< string, hash< ConnectionInfo > > get_connection_hash(*bool verbose)
returns a hash of connection information keyed by connection identifier; values are ConnectionInfo ha...
ConnectionProvider::get_connection
AbstractConnection get_connection(string conn)
returns an AbstractConnection object if the identifier is known to a registered connection provider
ConnectionProvider::ConfigInfo
config informaton
Definition: ConnectionProvider.qm.dox.h:291
ConnectionProvider::ConfigInfo::opts
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:295
ConnectionProvider::ConfigInfo::name
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:292
ConnectionProvider::ConfigInfo::desc
string desc
the description
Definition: ConnectionProvider.qm.dox.h:293
ConnectionProvider::ConfigInfo::url
string url
the full URL (including any username & password)
Definition: ConnectionProvider.qm.dox.h:294
ConnectionProvider::ConnectionConstructorInfo
information that can be used to dynamically construct a connection object
Definition: ConnectionProvider.qm.dox.h:175
ConnectionProvider::ConnectionConstructorInfo::class_name
string class_name
the name of the constructor's class
Definition: ConnectionProvider.qm.dox.h:180
ConnectionProvider::ConnectionConstructorInfo::module
*string module
any module required to be loaded for the constructor call
Definition: ConnectionProvider.qm.dox.h:177
ConnectionProvider::ConnectionConstructorInfo::pre_processing
*string pre_processing
code to execute before construction to preprocess the constructor arguments
Definition: ConnectionProvider.qm.dox.h:209
ConnectionProvider::ConnectionConstructorInfo::post_processing
*string post_processing
code to execute after construction
Definition: ConnectionProvider.qm.dox.h:196
ConnectionProvider::ConnectionConstructorInfo::args
*softlist< auto > args
the constructor arguments
Definition: ConnectionProvider.qm.dox.h:183
ConnectionProvider::ConnectionInfo
connection information hash
Definition: ConnectionProvider.qm.dox.h:215
ConnectionProvider::ConnectionInfo::tags
hash< auto > tags
user-defined key-value pairs associated with the connection
Definition: ConnectionProvider.qm.dox.h:270
ConnectionProvider::ConnectionInfo::children_can_support_records
bool children_can_support_records
if the data provider or any of its children support records
Definition: ConnectionProvider.qm.dox.h:279
ConnectionProvider::ConnectionInfo::loopback
bool loopback
a boolean vaue indicating if the connection is a loopback connection
Definition: ConnectionProvider.qm.dox.h:226
ConnectionProvider::ConnectionInfo::has_provider
bool has_provider
if the connection supports the data provider API
Definition: ConnectionProvider.qm.dox.h:273
ConnectionProvider::ConnectionInfo::last_check
*date last_check
the date/time value of the last connection check (or NOTHING if not checked)
Definition: ConnectionProvider.qm.dox.h:223
ConnectionProvider::ConnectionInfo::opts
*hash opts
the original options used to create the object
Definition: ConnectionProvider.qm.dox.h:232
ConnectionProvider::ConnectionInfo::children_can_support_apis
bool children_can_support_apis
if the data provider or any of its children support requests (APIs)
Definition: ConnectionProvider.qm.dox.h:276
ConnectionProvider::ConnectionInfo::monitor
bool monitor
a boolean vaue indicating if the connection should be monitored or not
Definition: ConnectionProvider.qm.dox.h:229
ConnectionProvider::ConnectionInfo::up
bool up
a boolean vaue indicating the connection is known to be up (will be False if not checked)
Definition: ConnectionProvider.qm.dox.h:241
ConnectionProvider::ConnectionInfo::children_can_support_messages
bool children_can_support_messages
if the data provider or any of its children support messages
Definition: ConnectionProvider.qm.dox.h:285
ConnectionProvider::ConnectionInfo::locked
bool locked
a boolean value indicating whether the connection is locked or not
Definition: ConnectionProvider.qm.dox.h:262
ConnectionProvider::ConnectionInfo::name
string name
the connection name
Definition: ConnectionProvider.qm.dox.h:217
ConnectionProvider::ConnectionInfo::type
string type
the connection type
Definition: ConnectionProvider.qm.dox.h:238
ConnectionProvider::ConnectionInfo::updated
*date updated
the date/time value of the update (or NOTHING if not updated)
Definition: ConnectionProvider.qm.dox.h:244
ConnectionProvider::ConnectionInfo::enabled
bool enabled
a boolean value indicating if the connection should be enabled or not
Definition: ConnectionProvider.qm.dox.h:257
ConnectionProvider::ConnectionInfo::debug_data
bool debug_data
a boolean value indicating whether the connection should be subject to data debugging
Definition: ConnectionProvider.qm.dox.h:267
ConnectionProvider::ConnectionInfo::children_can_support_observers
bool children_can_support_observers
if the data provider or any of its children support events
Definition: ConnectionProvider.qm.dox.h:282
ConnectionProvider::ConnectionInfo::status
string status
a string giving the connection's status
Definition: ConnectionProvider.qm.dox.h:235
ConnectionProvider::ConnectionInfo::desc
string desc
the connection description
Definition: ConnectionProvider.qm.dox.h:220
ConnectionProvider::ConnectionInfo::url
string url
the URL for the connection including the password
Definition: ConnectionProvider.qm.dox.h:249
ConnectionProvider::ConnectionInfo::url_hash
hash url_hash
a hash of URL information as returned by parse_url()
Definition: ConnectionProvider.qm.dox.h:252
ConnectionProvider::PingInfo
ping response info
Definition: ConnectionProvider.qm.dox.h:301
ConnectionProvider::PingInfo::time
date time
a relative date/time value giving the elapsed time of the ping operation
Definition: ConnectionProvider.qm.dox.h:317
ConnectionProvider::PingInfo::desc
string desc
the description
Definition: ConnectionProvider.qm.dox.h:305
ConnectionProvider::PingInfo::ping_info
*hash ping_info
an optional free-form hash giving additional info regarding ping operation or the remote system
Definition: ConnectionProvider.qm.dox.h:323
ConnectionProvider::PingInfo::ok
bool ok
a boolean value giving the result of the ping
Definition: ConnectionProvider.qm.dox.h:314
ConnectionProvider::PingInfo::opts
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:308
ConnectionProvider::PingInfo::url
string url
a safe version of the URL (without passwords)
Definition: ConnectionProvider.qm.dox.h:311
ConnectionProvider::PingInfo::name
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:302
ConnectionProvider::PingInfo::info
string info
a string giving the result of the ping ("OK" or an error message)
Definition: ConnectionProvider.qm.dox.h:320