| Qore ConnectionProvider Module Reference 1.5

ConnectionProvider.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
4 /* ConnectionProvider.qm Copyright 2016 - 2021 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
135 namespace ConnectionProvider {
138
142 public struct ConnectionConstructorInfo {
144 *string module;
145
147 string class_name;
148
150 *softlist<auto> args;
151
153
163 *string post_processing;
164
166
176 *string pre_processing;
177 };
178
180 public struct ConnectionInfo {
181 string name;
182 string desc;
183 *date last_check;
184 bool loopback;
185 bool monitor;
186 *hash opts;
187 string status;
188 string type;
189 bool up = False;
190 *date updated;
191 string url;
192 hash url_hash;
193 bool enabled;
194 bool locked;
195 bool debug_data;
196 hash<auto> tags;
197 bool has_provider = False;
198 };
199
201 public struct ConfigInfo {
202 string name;
203 string desc;
204 string url;
205 *hash opts;
206 };
207
209 public struct PingInfo {
210 string name;
211 string desc;
212 *hash opts;
213 string url;
214 bool ok;
215 date time;
216 string info;
217 *hash ping_info;
218 *hash<ExceptionInfo> ex;
219 };
220
222
237 string get_connection_url(string str);
238
239
241
256 AbstractConnection get_connection(string conn);
257
258
260
275 *hash<string, AbstractConnection> get_connections(*bool verbose);
276
277
279
294 *hash<string, hash<ConnectionInfo>> get_connection_hash(*bool verbose);
295
296 }; // ConnectionProvider namespace
297
298 // private, non-exported namespace
299 namespace Priv {
300 *hash priv_try_get_connections(string mod);
301
302
303 ConnectionProvider::AbstractConnection priv_try_get_connection(string mod, string conn);
304
305 }; // Priv nsmrspace
ConnectionProvider::get_connections
*hash< string, AbstractConnection > get_connections(*bool verbose)
returns all known connections as a hash keyed by connection identifier; values are AbstractConnection...
date
date date(date dt)
ConnectionProvider::ConfigInfo::opts
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:205
ConnectionProvider::ConnectionConstructorInfo
information that can be used to dynamically construct a connection object
Definition: ConnectionProvider.qm.dox.h:142
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:183
ConnectionProvider::ConnectionInfo::name
string name
the connection name
Definition: ConnectionProvider.qm.dox.h:181
ConnectionProvider::ConnectionConstructorInfo::class_name
string class_name
the name of the constructor&#39;s class
Definition: ConnectionProvider.qm.dox.h:147
ConnectionProvider::ConnectionInfo::status
string status
a string giving the connection&#39;s status
Definition: ConnectionProvider.qm.dox.h:187
ConnectionProvider::ConnectionInfo::locked
bool locked
a boolean value indicating whether the connection is locked or not. This flag does not affect anythin...
Definition: ConnectionProvider.qm.dox.h:194
ConnectionProvider::PingInfo::info
string info
a string giving the result of the ping ("OK" or an error message)
Definition: ConnectionProvider.qm.dox.h:216
ConnectionProvider::ConnectionConstructorInfo::pre_processing
*string pre_processing
code to execute before construction to preprocess the constructor arguments
Definition: ConnectionProvider.qm.dox.h:176
ConnectionProvider::ConfigInfo::url
string url
the full URL (including any username & password)
Definition: ConnectionProvider.qm.dox.h:204
ConnectionProvider::get_connection
AbstractConnection get_connection(string conn)
returns an AbstractConnection object if the identifier is known to a registered connection provider ...
ConnectionProvider::ConnectionInfo::updated
*date updated
the date/time value of the update (or NOTHING if not updated)
Definition: ConnectionProvider.qm.dox.h:190
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:189
ConnectionProvider::PingInfo::ex
*hash< ExceptionInfo > ex
if an exception occured, all exception info will be returned here
Definition: ConnectionProvider.qm.dox.h:218
False
const False
ConnectionProvider::AbstractConnection
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:32
ConnectionProvider::ConnectionConstructorInfo::args
*softlist< auto > args
the constructor arguments
Definition: ConnectionProvider.qm.dox.h:150
ConnectionProvider::PingInfo
ping response info as returned by AbstractConnection::ping()
Definition: ConnectionProvider.qm.dox.h:209
ConnectionProvider::ConfigInfo::name
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:202
ConnectionProvider::ConnectionConstructorInfo::post_processing
*string post_processing
code to execute after construction
Definition: ConnectionProvider.qm.dox.h:163
ConnectionProvider::ConnectionInfo::type
string type
the connection type
Definition: ConnectionProvider.qm.dox.h:188
ConnectionProvider::PingInfo::url
string url
a safe version of the URL (without passwords)
Definition: ConnectionProvider.qm.dox.h:213
ConnectionProvider::ConnectionInfo::monitor
bool monitor
a boolean vaue indicating if the connection should be monitored or not
Definition: ConnectionProvider.qm.dox.h:185
ConnectionProvider::PingInfo::opts
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:212
ConnectionProvider::ConfigInfo
config informaton as returned by AbstractConnection::getConfigHash()
Definition: ConnectionProvider.qm.dox.h:201
ConnectionProvider::ConnectionInfo::debug_data
bool debug_data
a boolean value indicating whether the connection should be subject to data debugging. This flag does not affect anything by default, it is for user re-implementations
Definition: ConnectionProvider.qm.dox.h:195
ConnectionProvider::ConnectionInfo::url_hash
hash url_hash
a hash of URL information as returned by parse_url()
Definition: ConnectionProvider.qm.dox.h:192
ConnectionProvider::ConnectionInfo::loopback
bool loopback
a boolean vaue indicating if the connection is a loopback connection
Definition: ConnectionProvider.qm.dox.h:184
ConnectionProvider::ConfigInfo::desc
string desc
the description
Definition: ConnectionProvider.qm.dox.h:203
ConnectionProvider::PingInfo::time
date time
a relative date/time value giving the elapsed time of the ping operation
Definition: ConnectionProvider.qm.dox.h:215
ConnectionProvider::ConnectionInfo::opts
*hash opts
the original options used to create the object
Definition: ConnectionProvider.qm.dox.h:186
ConnectionProvider::ConnectionInfo::url
string url
the URL for the connection including the password (if any present and the with_password argument is T...
Definition: ConnectionProvider.qm.dox.h:191
ConnectionProvider::PingInfo::desc
string desc
the description
Definition: ConnectionProvider.qm.dox.h:211
hash
hash< auto > hash(object obj)
ConnectionProvider::ConnectionInfo::enabled
bool enabled
a boolean value indicating if the connection should be enabled or not. This flag does not affect anyt...
Definition: ConnectionProvider.qm.dox.h:193
ConnectionProvider::ConnectionInfo::tags
hash< auto > tags
user-defined key-value pairs associated with the connection
Definition: ConnectionProvider.qm.dox.h:196
ConnectionProvider::PingInfo::name
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:210
Priv
Definition: ConnectionProvider.qm.dox.h:299
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::ConnectionInfo
connection information hash as returned by AbstractConnection::getInfo()
Definition: ConnectionProvider.qm.dox.h:180
ConnectionProvider::PingInfo::ok
bool ok
a boolean value giving the result of the ping
Definition: ConnectionProvider.qm.dox.h:214
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::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:217
ConnectionProvider::ConnectionInfo::desc
string desc
the connection description
Definition: ConnectionProvider.qm.dox.h:182
ConnectionProvider::ConnectionConstructorInfo::module
*string module
any module required to be loaded for the constructor call
Definition: ConnectionProvider.qm.dox.h:144
ConnectionProvider
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:26
ConnectionProvider::ConnectionInfo::has_provider
bool has_provider
if the connection supports the data provider API
Definition: ConnectionProvider.qm.dox.h:197