Qore ConnectionProvider Module Reference  1.2
ConnectionProvider.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* ConnectionProvider.qm Copyright 2016 - 2018 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 
112 namespace ConnectionProvider {
115 
121  *string module;
122 
124  string class_name;
125 
127  *softlist<auto> args;
128 
130 
141 
143 
153  *string pre_processing;
154  };
155 
157  public struct ConnectionInfo {
158  string name;
159  string desc;
161  bool loopback;
162  bool monitor;
164  string status;
165  string type;
166  bool up = False;
168  string url;
170  bool enabled;
171  bool locked;
172  };
173 
175  public struct ConfigInfo {
176  string name;
177  string desc;
178  string url;
180  };
181 
183  public struct PingInfo {
184  string name;
185  string desc;
187  string url;
188  bool ok;
190  string info;
192  };
193 
195 
210  string get_connection_url(string str);
211 
212 
214 
229  AbstractConnection get_connection(string conn);
230 
231 
233 
248  *hash<string, AbstractConnection> get_connections(*bool verbose);
249 
250 
252 
267  *hash<string, hash<ConnectionInfo>> get_connection_hash(*bool verbose);
268 
269 }; // ConnectionProvider namespace
270 
271 // private, non-exported namespace
272 namespace Priv {
273  *hash priv_try_get_connections(string mod);
274 
275 
276  ConnectionProvider::AbstractConnection priv_try_get_connection(string mod, string conn);
277 
278 }; // Priv nsmrspace
*hash< string, AbstractConnection > get_connections(*bool verbose)
returns all known connections as a hash keyed by connection identifier; values are AbstractConnection...
date date(date dt)
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:179
information that can be used to dynamically construct a connection object
Definition: ConnectionProvider.qm.dox.h:119
*date last_check
the date/time value of the last connection check (or NOTHING if not checked)
Definition: ConnectionProvider.qm.dox.h:160
string name
the connection name
Definition: ConnectionProvider.qm.dox.h:158
string class_name
the name of the constructor&#39;s class
Definition: ConnectionProvider.qm.dox.h:124
string status
a string giving the connection&#39;s status
Definition: ConnectionProvider.qm.dox.h:164
bool locked
a boolean value indicating whether the connection is locked or not. This flag does not affect anythin...
Definition: ConnectionProvider.qm.dox.h:171
string info
a string giving the result of the ping ("OK" or an error message)
Definition: ConnectionProvider.qm.dox.h:190
*string pre_processing
code to execute before construction to preprocess the constructor arguments
Definition: ConnectionProvider.qm.dox.h:153
string url
the full URL (including any username & password)
Definition: ConnectionProvider.qm.dox.h:178
AbstractConnection get_connection(string conn)
returns an AbstractConnection object if the identifier is known to a registered connection provider ...
*date updated
the date/time value of the update (or NOTHING if not updated)
Definition: ConnectionProvider.qm.dox.h:167
bool up
a boolean vaue indicating the connection is known to be up (will be False if not checked) ...
Definition: ConnectionProvider.qm.dox.h:166
const False
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:31
*softlist< auto > args
the constructor arguments
Definition: ConnectionProvider.qm.dox.h:127
ping response info as returned by AbstractConnection::ping()
Definition: ConnectionProvider.qm.dox.h:183
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:176
*string post_processing
code to execute after construction
Definition: ConnectionProvider.qm.dox.h:140
string type
the connection type
Definition: ConnectionProvider.qm.dox.h:165
string url
a safe version of the URL (without passwords)
Definition: ConnectionProvider.qm.dox.h:187
bool monitor
a boolean vaue indicating if the connection should be monitored or not
Definition: ConnectionProvider.qm.dox.h:162
*hash opts
the options set on the connection
Definition: ConnectionProvider.qm.dox.h:186
config informaton as returned by AbstractConnection::getConfigHash()
Definition: ConnectionProvider.qm.dox.h:175
hash url_hash
a hash of URL information as returned by parse_url()
Definition: ConnectionProvider.qm.dox.h:169
bool loopback
a boolean vaue indicating if the connection is a loopback connection
Definition: ConnectionProvider.qm.dox.h:161
string desc
the description
Definition: ConnectionProvider.qm.dox.h:177
date time
a relative date/time value giving the elapsed time of the ping operation
Definition: ConnectionProvider.qm.dox.h:189
*hash opts
the original options used to create the object
Definition: ConnectionProvider.qm.dox.h:163
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:168
string desc
the description
Definition: ConnectionProvider.qm.dox.h:185
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:170
string name
the name of the connection
Definition: ConnectionProvider.qm.dox.h:184
Definition: ConnectionProvider.qm.dox.h:272
string get_connection_url(string str)
returns a URL string for the given identifier if the identifier is known to a registered connection p...
connection information hash as returned by AbstractConnection::getInfo()
Definition: ConnectionProvider.qm.dox.h:157
bool ok
a boolean value giving the result of the ping
Definition: ConnectionProvider.qm.dox.h:188
*hash< string, hash< ConnectionInfo > > get_connection_hash(*bool verbose)
returns a hash of connection information keyed by connection identifier; values are ConnectionInfo ha...
*hash ping_info
an optional free-form hash giving additional info regarding ping operation or the remote system ...
Definition: ConnectionProvider.qm.dox.h:191
hash hash(object obj)
string desc
the connection description
Definition: ConnectionProvider.qm.dox.h:159
*string module
any module required to be loaded for the constructor call
Definition: ConnectionProvider.qm.dox.h:121
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:27