| Qore ConnectionProvider Module Reference 2.0.1

Loading...
Searching...
No Matches
ConnectionSchemeCache.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
24
25
27 namespace ConnectionProvider {
29 public struct ConnectionOptionInfo {
31 string display_name;
32
34 string short_desc;
35
37 string desc;
38
40 string type;
41
43 bool sensitive = False;
44
46 bool multiselect;
47
49 *softlist<hash<Util::AllowedValueInfo>> allowed_values;
50
52 *bool allowed_values_creatable;
53
55 *softlist<hash<Util::AllowedValueInfo>> element_allowed_values;
56
58 *bool element_allowed_values_creatable;
59
61 auto default_value;
62
64 bool subst_env_vars = False;
65
67 bool freeform = False;
68
70 auto example_value;
71
73 *hash<string, bool> ignore_types;
74};
75
77 public struct ConnectionSchemeInfo {
79 string display_name;
80
82 string short_desc;
83
85 string desc;
86
88
90 hash<string, bool> schemes;
91
93 hash<string, string> base_scheme_map;
94
96 Class cls;
97
99 *hash<string, hash<ConnectionOptionInfo>> options;
100
102 *hash<string, bool> sensitive_options;
103
105 bool auto_url = False;
106
108
113 *string required_options;
114};
115
117 class ConnectionSchemeCache {
118
119 public:
121 const SchemeMap = ...;
122
123
124 protected:
126 static hash<string, hash<ConnectionSchemeInfo>> cache = {
127 "ftp": FtpConnection::ConnectionScheme,
128 "ftps": FtpConnection::ConnectionScheme,
129
130 "dir": FilesystemConnection::ConnectionScheme,
131 "file": FilesystemConnection::ConnectionScheme,
132
133 "http": HttpConnection::ConnectionScheme,
134 "https": HttpConnection::ConnectionScheme,
135 };
136
138 static hash<string, code> initmap;
139
141 static Mutex lck();
142
144 static bool load_all;
145
146 public:
147
149
152 static registerPendingScheme(string scheme, code init);
153
155
161 static bool registerScheme(string scheme, hash<ConnectionSchemeInfo> entry);
162
164
172 static *hash<ConnectionSchemeInfo> deregisterScheme(string scheme);
173
175 static hash<string, hash<ConnectionSchemeInfo>> getLoadAll();
176
178 static hash<string, hash<ConnectionSchemeInfo>> get();
179
181 static int size();
182
184 static bool empty();
185
187
189 static *list<string> listSchemes();
190
192
197 static *hash<ConnectionSchemeInfo> getScheme(string scheme);
198
200
206 static hash<ConnectionSchemeInfo> getSchemeEx(string scheme);
207
209
220 static *hash<ConnectionSchemeInfo> getSchemeImpl(string scheme, bool throw_exception, *code scheme_loader);
221
223
231 static *hash<auto> getDefaultOptionValues(string scheme);
232
234
240 static *hash<auto> getDefaultOptionValues(hash<ConnectionSchemeInfo> scheme_info);
241
243
254 static hash<auto> validateConnectionOptions(string conn_name, string scheme, hash<auto> options, bool check_required = True);
255
257
268 static hash<auto> validateConnectionOptions(string conn_name, hash<ConnectionSchemeInfo> scheme_info, hash<auto> options, bool check_required = True);
269
271 protected:
272 static bool tryLoadModule(string mod, bool throw_exception);
273 public:
274
275
277
279 private:
280 static deregisterSchemeIntern(string scheme);
281 public:
282
283};
284};
ConnectionProvider::ConnectionSchemeCache
Connection provider type cache class.
Definition ConnectionSchemeCache.qc.dox.h:117
ConnectionProvider::ConnectionSchemeCache::listSchemes
static *list< string > listSchemes()
Returns a list of all cached schemes.
ConnectionProvider::ConnectionSchemeCache::getScheme
static *hash< ConnectionSchemeInfo > getScheme(string scheme)
Returns info for the given connection scheme or NOTHING if not present.
ConnectionProvider::ConnectionSchemeCache::validateConnectionOptions
static hash< auto > validateConnectionOptions(string conn_name, hash< ConnectionSchemeInfo > scheme_info, hash< auto > options, bool check_required=True)
Checks and returns options.
ConnectionProvider::ConnectionSchemeCache::tryLoadModule
static bool tryLoadModule(string mod, bool throw_exception)
Try to load the given module.
ConnectionProvider::ConnectionSchemeCache::deregisterScheme
static *hash< ConnectionSchemeInfo > deregisterScheme(string scheme)
Removes a scheme.
ConnectionProvider::ConnectionSchemeCache::registerPendingScheme
static registerPendingScheme(string scheme, code init)
Registers a scheme for deferred initialization / initialization on demand.
ConnectionProvider::ConnectionSchemeCache::getSchemeImpl
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...
ConnectionProvider::ConnectionSchemeCache::getDefaultOptionValues
static *hash< auto > getDefaultOptionValues(string scheme)
Returns default option values for the given connection scheme.
ConnectionProvider::ConnectionSchemeCache::validateConnectionOptions
static hash< auto > validateConnectionOptions(string conn_name, string scheme, hash< auto > options, bool check_required=True)
Checks and returns options.
ConnectionProvider::ConnectionSchemeCache::getSchemeEx
static hash< ConnectionSchemeInfo > getSchemeEx(string scheme)
Returns info for the given connection scheme or throws an exception if not present.
ConnectionProvider::ConnectionSchemeCache::SchemeMap
const SchemeMap
Map of known connection schemes to modules.
Definition ConnectionSchemeCache.qc.dox.h:121
ConnectionProvider::ConnectionSchemeCache::deregisterSchemeIntern
static deregisterSchemeIntern(string scheme)
Deregisters a scheme in case module intiialization fails for the module that registered it.
ConnectionProvider::ConnectionSchemeCache::get
static hash< string, hash< ConnectionSchemeInfo > > get()
Returns the entire cache.
ConnectionProvider::ConnectionSchemeCache::cache
static hash< string, hash< ConnectionSchemeInfo > > cache
Connection provider cache.
Definition ConnectionSchemeCache.qc.dox.h:126
ConnectionProvider::ConnectionSchemeCache::initmap
static hash< string, code > initmap
Pending connection provider init handler map: scheme -> init handler.
Definition ConnectionSchemeCache.qc.dox.h:138
ConnectionProvider::ConnectionSchemeCache::registerScheme
static bool registerScheme(string scheme, hash< ConnectionSchemeInfo > entry)
Register a new connection provider in the cache.
ConnectionProvider::ConnectionSchemeCache::load_all
static bool load_all
Load all flag.
Definition ConnectionSchemeCache.qc.dox.h:144
ConnectionProvider::ConnectionSchemeCache::size
static int size()
Returns the number of types in the cache.
ConnectionProvider::ConnectionSchemeCache::getLoadAll
static hash< string, hash< ConnectionSchemeInfo > > getLoadAll()
Loads all possible schemes and returns the entire cache.
ConnectionProvider::ConnectionSchemeCache::empty
static bool empty()
Returns True if the cache is empty, False if not.
ConnectionProvider::ConnectionSchemeCache::lck
static Mutex lck()
Connection provider cache lock.
ConnectionProvider::ConnectionSchemeCache::getDefaultOptionValues
static *hash< auto > getDefaultOptionValues(hash< ConnectionSchemeInfo > scheme_info)
Returns default option values for the given connection scheme.
ConnectionProvider::FilesystemConnection::ConnectionScheme
const ConnectionScheme
Connection entry info.
Definition FilesystemConnection.qc.dox.h:40
ConnectionProvider::FtpConnection::ConnectionScheme
const ConnectionScheme
Connection entry info.
Definition FtpConnection.qc.dox.h:37
ConnectionProvider::HttpConnection::ConnectionScheme
const ConnectionScheme
Connection entry info.
Definition HttpConnection.qc.dox.h:63
ConnectionProvider
The ConnectionProvider namespace.
Definition AbstractConnection.qc.dox.h:28
ConnectionProvider::ConnectionOptionInfo
Connection option information.
Definition ConnectionSchemeCache.qc.dox.h:29
ConnectionProvider::ConnectionOptionInfo::allowed_values_creatable
*bool allowed_values_creatable
Does the option accept values not defined in allowed_values too?
Definition ConnectionSchemeCache.qc.dox.h:52
ConnectionProvider::ConnectionOptionInfo::short_desc
string short_desc
Option short description in plain text.
Definition ConnectionSchemeCache.qc.dox.h:34
ConnectionProvider::ConnectionOptionInfo::subst_env_vars
bool subst_env_vars
Do environment variable substitution on the value?
Definition ConnectionSchemeCache.qc.dox.h:64
ConnectionProvider::ConnectionOptionInfo::default_value
auto default_value
Any default value.
Definition ConnectionSchemeCache.qc.dox.h:61
ConnectionProvider::ConnectionOptionInfo::element_allowed_values
*softlist< hash< Util::AllowedValueInfo > > element_allowed_values
List of allowed values for elements of list types (enum)
Definition ConnectionSchemeCache.qc.dox.h:55
ConnectionProvider::ConnectionOptionInfo::type
string type
Option value type.
Definition ConnectionSchemeCache.qc.dox.h:40
ConnectionProvider::ConnectionOptionInfo::desc
string desc
Description with markdown formatting.
Definition ConnectionSchemeCache.qc.dox.h:37
ConnectionProvider::ConnectionOptionInfo::freeform
bool freeform
Modifier for the "file-as-string" type; can a freeform location option be returned?
Definition ConnectionSchemeCache.qc.dox.h:67
ConnectionProvider::ConnectionOptionInfo::multiselect
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
ConnectionProvider::ConnectionOptionInfo::element_allowed_values_creatable
*bool element_allowed_values_creatable
Does the option accept element values not defined in element_allowed_values too?
Definition ConnectionSchemeCache.qc.dox.h:58
ConnectionProvider::ConnectionOptionInfo::example_value
auto example_value
Optional example option value.
Definition ConnectionSchemeCache.qc.dox.h:70
ConnectionProvider::ConnectionOptionInfo::ignore_types
*hash< string, bool > ignore_types
Ignore types for backwards compatibility when an option changes type.
Definition ConnectionSchemeCache.qc.dox.h:73
ConnectionProvider::ConnectionOptionInfo::display_name
string display_name
Option display name.
Definition ConnectionSchemeCache.qc.dox.h:31
ConnectionProvider::ConnectionOptionInfo::sensitive
bool sensitive
Is the value sensitive? (password or other authentication info)
Definition ConnectionSchemeCache.qc.dox.h:43
ConnectionProvider::ConnectionOptionInfo::allowed_values
*softlist< hash< Util::AllowedValueInfo > > allowed_values
List of allowed values (enum)
Definition ConnectionSchemeCache.qc.dox.h:49
ConnectionProvider::ConnectionSchemeInfo
Connection provider information.
Definition ConnectionSchemeCache.qc.dox.h:77
ConnectionProvider::ConnectionSchemeInfo::desc
string desc
Connection type / scheme description with markdown formatting.
Definition ConnectionSchemeCache.qc.dox.h:85
ConnectionProvider::ConnectionSchemeInfo::required_options
*string required_options
Required option string.
Definition ConnectionSchemeCache.qc.dox.h:113
ConnectionProvider::ConnectionSchemeInfo::options
*hash< string, hash< ConnectionOptionInfo > > options
Connection options: name -> option info.
Definition ConnectionSchemeCache.qc.dox.h:99
ConnectionProvider::ConnectionSchemeInfo::base_scheme_map
hash< string, string > base_scheme_map
Base URL scheme map; base scheme -> connection scheme.
Definition ConnectionSchemeCache.qc.dox.h:93
ConnectionProvider::ConnectionSchemeInfo::auto_url
bool auto_url
URL provided automatically?
Definition ConnectionSchemeCache.qc.dox.h:105
ConnectionProvider::ConnectionSchemeInfo::schemes
hash< string, bool > schemes
Connection scheme set; scheme -> True.
Definition ConnectionSchemeCache.qc.dox.h:90
ConnectionProvider::ConnectionSchemeInfo::sensitive_options
*hash< string, bool > sensitive_options
Set of sensitive options: name -> True.
Definition ConnectionSchemeCache.qc.dox.h:102
ConnectionProvider::ConnectionSchemeInfo::display_name
string display_name
Connection type / scheme display name.
Definition ConnectionSchemeCache.qc.dox.h:79
ConnectionProvider::ConnectionSchemeInfo::short_desc
string short_desc
Connection type / scheme short description in plain text.
Definition ConnectionSchemeCache.qc.dox.h:82
ConnectionProvider::ConnectionSchemeInfo::cls
Class cls
The connection class.
Definition ConnectionSchemeCache.qc.dox.h:96