Qore ConnectionProvider Module Reference  1.7
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 
163 
165 namespace ConnectionProvider {
167 
173  *string module;
174 
176  string class_name;
177 
179  *softlist<auto> args;
180 
182 
193 
195 
205  *string pre_processing;
206 };
207 
209 
211 public struct ConnectionInfo {
213  string name;
214 
216  string desc;
217 
220 
222  bool loopback;
223 
225  bool monitor;
226 
229 
231  string status;
232 
234  string type;
235 
237  bool up = False;
238 
241 
243 
245  string url;
246 
249 
251 
253  bool enabled;
254 
256 
258  bool locked;
259 
261 
264 
266  hash<auto> tags;
267 
270 
273 
276 
279 
282 };
283 
285 
287 public struct ConfigInfo {
288  string name;
289  string desc;
290  string url;
292 };
293 
295 
297 public struct PingInfo {
298  string name;
300 
301  string desc;
303 
306 
307  string url;
309 
310  bool ok;
312 
315 
316  string info;
318 
321 
323  *hash<ExceptionInfo> ex;
324 };
325 
327 
342  string get_connection_url(string str);
343 
344 
346 
362 
363 
365 
380  *hash<string, AbstractConnection> get_connections(*bool verbose);
381 
382 
384 
399  *hash<string, hash<ConnectionInfo>> get_connection_hash(*bool verbose);
400 
401 }; // ConnectionProvider namespace
402 
403 // private, non-exported namespace
404 namespace Priv {
405 *hash priv_try_get_connections(string mod);
406 
407 
408 ConnectionProvider::AbstractConnection priv_try_get_connection(string mod, string conn);
409 
410 }; // Priv nsmrspace
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:34
const False
date date(date dt)
hash< auto > hash(object obj)
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...
*hash< string, hash< ConnectionInfo > > get_connection_hash(*bool verbose)
returns a hash of connection information keyed by connection identifier; values are ConnectionInfo ha...
AbstractConnection get_connection(string conn)
returns an AbstractConnection object if the identifier is known to a registered connection provider
config informaton
Definition: ConnectionProvider.qm.dox.h:287
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:291
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:288
string desc
the description
Definition: ConnectionProvider.qm.dox.h:289
string url
the full URL (including any username & password)
Definition: ConnectionProvider.qm.dox.h:290
information that can be used to dynamically construct a connection object
Definition: ConnectionProvider.qm.dox.h:171
string class_name
the name of the constructor's class
Definition: ConnectionProvider.qm.dox.h:176
*string module
any module required to be loaded for the constructor call
Definition: ConnectionProvider.qm.dox.h:173
*string pre_processing
code to execute before construction to preprocess the constructor arguments
Definition: ConnectionProvider.qm.dox.h:205
*string post_processing
code to execute after construction
Definition: ConnectionProvider.qm.dox.h:192
*softlist< auto > args
the constructor arguments
Definition: ConnectionProvider.qm.dox.h:179
connection information hash
Definition: ConnectionProvider.qm.dox.h:211
hash< auto > tags
user-defined key-value pairs associated with the connection
Definition: ConnectionProvider.qm.dox.h:266
bool children_can_support_records
if the data provider or any of its children support records
Definition: ConnectionProvider.qm.dox.h:275
bool loopback
a boolean vaue indicating if the connection is a loopback connection
Definition: ConnectionProvider.qm.dox.h:222
bool has_provider
if the connection supports the data provider API
Definition: ConnectionProvider.qm.dox.h:269
*date last_check
the date/time value of the last connection check (or NOTHING if not checked)
Definition: ConnectionProvider.qm.dox.h:219
*hash opts
the original options used to create the object
Definition: ConnectionProvider.qm.dox.h:228
bool children_can_support_apis
if the data provider or any of its children support requests (APIs)
Definition: ConnectionProvider.qm.dox.h:272
bool monitor
a boolean vaue indicating if the connection should be monitored or not
Definition: ConnectionProvider.qm.dox.h:225
bool up
a boolean vaue indicating the connection is known to be up (will be False if not checked)
Definition: ConnectionProvider.qm.dox.h:237
bool children_can_support_messages
if the data provider or any of its children support messages
Definition: ConnectionProvider.qm.dox.h:281
bool locked
a boolean value indicating whether the connection is locked or not
Definition: ConnectionProvider.qm.dox.h:258
string name
the connection name
Definition: ConnectionProvider.qm.dox.h:213
string type
the connection type
Definition: ConnectionProvider.qm.dox.h:234
*date updated
the date/time value of the update (or NOTHING if not updated)
Definition: ConnectionProvider.qm.dox.h:240
bool enabled
a boolean value indicating if the connection should be enabled or not
Definition: ConnectionProvider.qm.dox.h:253
bool debug_data
a boolean value indicating whether the connection should be subject to data debugging
Definition: ConnectionProvider.qm.dox.h:263
bool children_can_support_observers
if the data provider or any of its children support events
Definition: ConnectionProvider.qm.dox.h:278
string status
a string giving the connection's status
Definition: ConnectionProvider.qm.dox.h:231
string desc
the connection description
Definition: ConnectionProvider.qm.dox.h:216
string url
the URL for the connection including the password
Definition: ConnectionProvider.qm.dox.h:245
hash url_hash
a hash of URL information as returned by parse_url()
Definition: ConnectionProvider.qm.dox.h:248
ping response info
Definition: ConnectionProvider.qm.dox.h:297
date time
a relative date/time value giving the elapsed time of the ping operation
Definition: ConnectionProvider.qm.dox.h:313
string desc
the description
Definition: ConnectionProvider.qm.dox.h:301
*hash ping_info
an optional free-form hash giving additional info regarding ping operation or the remote system
Definition: ConnectionProvider.qm.dox.h:319
bool ok
a boolean value giving the result of the ping
Definition: ConnectionProvider.qm.dox.h:310
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:304
string url
a safe version of the URL (without passwords)
Definition: ConnectionProvider.qm.dox.h:307
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:298
string info
a string giving the result of the ping ("OK" or an error message)
Definition: ConnectionProvider.qm.dox.h:316