Qore ConnectionProvider Module Reference 2.0.1
Loading...
Searching...
No Matches
ConnectionSchemeCache.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
27namespace ConnectionProvider {
29public hashdecl ConnectionOptionInfo {
32
34 string short_desc;
35
37 string desc;
38
40 string type;
41
43 bool sensitive = False;
44
47
49 *softlist<hash<Util::AllowedValueInfo>> allowed_values;
50
53
55 *softlist<hash<Util::AllowedValueInfo>> element_allowed_values;
56
59
62
64 bool subst_env_vars = False;
65
67 bool freeform = False;
68
71};
72
74public hashdecl ConnectionSchemeInfo {
77
79 string short_desc;
80
82 string desc;
83
85
87 hash<string, bool> schemes;
88
90 hash<string, string> base_scheme_map;
91
93 Class cls;
94
96 *hash<string, hash<ConnectionOptionInfo>> options;
97
99 *hash<string, bool> sensitive_options;
100
102 bool auto_url = False;
103
105
111};
112
115
116public:
118 const SchemeMap = ...;
119
120
121protected:
123 static hash<string, hash<ConnectionSchemeInfo>> cache = {
126
129
132 };
133
135 static hash<string, code> initmap;
136
138 static Mutex lck();
139
141 static bool load_all;
142
143public:
144
146
149 static registerPendingScheme(string scheme, code init);
150
152
158 static bool registerScheme(string scheme, hash<ConnectionSchemeInfo> entry);
159
161
169 static *hash<ConnectionSchemeInfo> deregisterScheme(string scheme);
170
172 static hash<string, hash<ConnectionSchemeInfo>> getLoadAll();
173
175 static hash<string, hash<ConnectionSchemeInfo>> get();
176
178 static int size();
179
181 static bool empty();
182
184
186 static *list<string> listSchemes();
187
189
194 static *hash<ConnectionSchemeInfo> getScheme(string scheme);
195
197
203 static hash<ConnectionSchemeInfo> getSchemeEx(string scheme);
204
206
217 static *hash<ConnectionSchemeInfo> getSchemeImpl(string scheme, bool throw_exception, *code scheme_loader);
218
220
228 static *hash<auto> getDefaultOptionValues(string scheme);
229
231
237 static *hash<auto> getDefaultOptionValues(hash<ConnectionSchemeInfo> scheme_info);
238
240
251 static hash<auto> validateConnectionOptions(string conn_name, string scheme, hash<auto> options, bool check_required = True);
252
254
265 static hash<auto> validateConnectionOptions(string conn_name, hash<ConnectionSchemeInfo> scheme_info, hash<auto> options, bool check_required = True);
266
268protected:
269 static bool tryLoadModule(string mod, bool throw_exception);
270public:
271
272
274
276private:
277 static deregisterSchemeIntern(string scheme);
278public:
279
280};
281};
Connection provider type cache class.
Definition ConnectionSchemeCache.qc.dox.h:114
static *list< string > listSchemes()
Returns a list of all cached schemes.
static *hash< ConnectionSchemeInfo > getScheme(string scheme)
Returns info for the given connection scheme or NOTHING if not present.
static hash< auto > validateConnectionOptions(string conn_name, hash< ConnectionSchemeInfo > scheme_info, hash< auto > options, bool check_required=True)
Checks and returns options.
static bool tryLoadModule(string mod, bool throw_exception)
Try to load the given module.
static *hash< ConnectionSchemeInfo > deregisterScheme(string scheme)
Removes a scheme.
static registerPendingScheme(string scheme, code init)
Registers a scheme for deferred initialization / initialization on demand.
static *hash< ConnectionSchemeInfo > getSchemeImpl(string scheme, bool throw_exception, *code scheme_loader)
Returns info for the given connection scheme; either throws an exception if not present or returns NO...
static *hash< auto > getDefaultOptionValues(string scheme)
Returns default option values for the given connection scheme.
static hash< auto > validateConnectionOptions(string conn_name, string scheme, hash< auto > options, bool check_required=True)
Checks and returns options.
static hash< ConnectionSchemeInfo > getSchemeEx(string scheme)
Returns info for the given connection scheme or throws an exception if not present.
const SchemeMap
Map of known connection schemes to modules.
Definition ConnectionSchemeCache.qc.dox.h:118
static deregisterSchemeIntern(string scheme)
Deregisters a scheme in case module intiialization fails for the module that registered it.
static hash< string, hash< ConnectionSchemeInfo > > get()
Returns the entire cache.
static hash< string, hash< ConnectionSchemeInfo > > cache
Connection provider cache.
Definition ConnectionSchemeCache.qc.dox.h:123
static hash< string, code > initmap
Pending connection provider init handler map: scheme -> init handler.
Definition ConnectionSchemeCache.qc.dox.h:135
static bool registerScheme(string scheme, hash< ConnectionSchemeInfo > entry)
Register a new connection provider in the cache.
static bool load_all
Load all flag.
Definition ConnectionSchemeCache.qc.dox.h:141
static int size()
Returns the number of types in the cache.
static hash< string, hash< ConnectionSchemeInfo > > getLoadAll()
Loads all possible schemes and returns the entire cache.
static bool empty()
Returns True if the cache is empty, False if not.
static Mutex lck()
Connection provider cache lock.
static *hash< auto > getDefaultOptionValues(hash< ConnectionSchemeInfo > scheme_info)
Returns default option values for the given connection scheme.
const ConnectionScheme
Connection entry info.
Definition FilesystemConnection.qc.dox.h:40
const ConnectionScheme
Connection entry info.
Definition FtpConnection.qc.dox.h:37
const ConnectionScheme
Connection entry info.
Definition HttpConnection.qc.dox.h:63
The ConnectionProvider namespace.
Definition AbstractConnection.qc.dox.h:28
Connection option information.
Definition ConnectionSchemeCache.qc.dox.h:29
*bool allowed_values_creatable
Does the option accept values not defined in allowed_values too?
Definition ConnectionSchemeCache.qc.dox.h:52
string short_desc
Option short description in plain text.
Definition ConnectionSchemeCache.qc.dox.h:34
bool subst_env_vars
Do environment variable substitution on the value?
Definition ConnectionSchemeCache.qc.dox.h:64
auto default_value
Any default value.
Definition ConnectionSchemeCache.qc.dox.h:61
*softlist< hash< Util::AllowedValueInfo > > element_allowed_values
List of allowed values for elements of list types (enum)
Definition ConnectionSchemeCache.qc.dox.h:55
string type
Option value type.
Definition ConnectionSchemeCache.qc.dox.h:40
string desc
Description with markdown formatting.
Definition ConnectionSchemeCache.qc.dox.h:37
bool freeform
Modifier for the "file-as-string" type; can a freeform location option be returned?
Definition ConnectionSchemeCache.qc.dox.h:67
bool multiselect
Are allowed values elements of the list's element type that indicate what values the list can have?
Definition ConnectionSchemeCache.qc.dox.h:46
*bool element_allowed_values_creatable
Does the option accept element values not defined in element_allowed_values too?
Definition ConnectionSchemeCache.qc.dox.h:58
auto example_value
Optional example option value.
Definition ConnectionSchemeCache.qc.dox.h:70
string display_name
Option display name.
Definition ConnectionSchemeCache.qc.dox.h:31
bool sensitive
Is the value sensitive? (password or other authentication info)
Definition ConnectionSchemeCache.qc.dox.h:43
*softlist< hash< Util::AllowedValueInfo > > allowed_values
List of allowed values (enum)
Definition ConnectionSchemeCache.qc.dox.h:49
Connection provider information.
Definition ConnectionSchemeCache.qc.dox.h:74
string desc
Connection type / scheme description with markdown formatting.
Definition ConnectionSchemeCache.qc.dox.h:82
*string required_options
Required option string.
Definition ConnectionSchemeCache.qc.dox.h:110
*hash< string, hash< ConnectionOptionInfo > > options
Connection options: name -> option info.
Definition ConnectionSchemeCache.qc.dox.h:96
hash< string, string > base_scheme_map
Base URL scheme map; base scheme -> connection scheme.
Definition ConnectionSchemeCache.qc.dox.h:90
bool auto_url
URL provided automatically?
Definition ConnectionSchemeCache.qc.dox.h:102
hash< string, bool > schemes
Connection scheme set; scheme -> True.
Definition ConnectionSchemeCache.qc.dox.h:87
*hash< string, bool > sensitive_options
Set of sensitive options: name -> True.
Definition ConnectionSchemeCache.qc.dox.h:99
string display_name
Connection type / scheme display name.
Definition ConnectionSchemeCache.qc.dox.h:76
string short_desc
Connection type / scheme short description in plain text.
Definition ConnectionSchemeCache.qc.dox.h:79
Class cls
The connection class.
Definition ConnectionSchemeCache.qc.dox.h:93