| Qore ConnectionProvider Module Reference 1.4

ConnectionSchemeCache.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
25 //%requires Util
26
28 namespace ConnectionProvider {
30 public struct AllowedValueInfo {
32 auto value;
33
35 string desc;
36 };
37
39 public struct ConnectionOptionInfo {
41 string type;
42
44 string desc;
45
47 bool sensitive = False;
48
50 *softlist<hash<AllowedValueInfo>> allowed_values;
51
53 auto default_value;
54 };
55
57 public struct ConnectionSchemeInfo {
59 Class cls;
60
62 *hash<string, hash<ConnectionOptionInfo>> options;
63
65
70 *string required_options;
71 };
72
74 class ConnectionSchemeCache {
75
76 public:
78 const SchemeMap = ...;
79
80
81 protected:
83 static hash<string, hash<ConnectionSchemeInfo>> cache = {
84 "ftp": FtpConnection::ConnectionScheme,
85 "ftps": FtpConnection::ConnectionScheme,
86
87 "dir": FilesystemConnection::ConnectionScheme,
88 "file": FilesystemConnection::ConnectionScheme,
89
90 "http": HttpConnection::ConnectionScheme,
91 "https": HttpConnection::ConnectionScheme,
92 };
93
95 static Mutex lck();
96
97 public:
98
100
106 static bool registerScheme(string scheme, hash<ConnectionSchemeInfo> entry);
107
109 static hash<string, hash<ConnectionSchemeInfo>> get();
110
112 static int size();
113
115 static bool empty();
116
118
120 static *list<string> listSchemes();
121
123
128 static *hash<ConnectionSchemeInfo> getScheme(string scheme);
129
131
137 static hash<ConnectionSchemeInfo> getSchemeEx(string scheme);
138
140
151 static *hash<ConnectionSchemeInfo> getSchemeImpl(string scheme, bool throw_exception, *code scheme_loader);
152
154 protected:
155 static bool tryLoadModule(string mod, bool throw_exception);
156 public:
157
158 };
159 };
ConnectionProvider
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:26
ConnectionProvider::ConnectionSchemeCache::SchemeMap
const SchemeMap
Map of known connection schemes to modules.
Definition: ConnectionSchemeCache.qc.dox.h:78
ConnectionProvider::ConnectionSchemeInfo::cls
Class cls
The connection class.
Definition: ConnectionSchemeCache.qc.dox.h:59
ConnectionProvider::ConnectionSchemeCache::cache
static hash< string, hash< ConnectionSchemeInfo > > cache
Connection provider cache.
Definition: ConnectionSchemeCache.qc.dox.h:83
ConnectionProvider::ConnectionSchemeInfo
Connection provider information.
Definition: ConnectionSchemeCache.qc.dox.h:57
ConnectionProvider::ConnectionSchemeCache::getSchemeEx
static hash< ConnectionSchemeInfo > getSchemeEx(string scheme)
Returns info for the given connection scheme or throws an exception if not present.
ConnectionProvider::ConnectionOptionInfo::allowed_values
*softlist< hash< AllowedValueInfo > > allowed_values
List of allowed values (enum)
Definition: ConnectionSchemeCache.qc.dox.h:50
ConnectionProvider::ConnectionSchemeCache::get
static hash< string, hash< ConnectionSchemeInfo > > get()
Returns the entire cache.
ConnectionProvider::ConnectionSchemeCache::listSchemes
static *list< string > listSchemes()
Returns a list of all cached schemes.
ConnectionProvider::ConnectionOptionInfo::default_value
auto default_value
Any default value.
Definition: ConnectionSchemeCache.qc.dox.h:53
ConnectionProvider::ConnectionSchemeCache::tryLoadModule
static bool tryLoadModule(string mod, bool throw_exception)
Try to load the given module.
ConnectionProvider::ConnectionSchemeCache
Connection provider type cache class.
Definition: ConnectionSchemeCache.qc.dox.h:74
ConnectionProvider::ConnectionOptionInfo
Connection option information.
Definition: ConnectionSchemeCache.qc.dox.h:39
ConnectionProvider::ConnectionSchemeCache::lck
static Mutex lck()
Connection provider cache lock.
ConnectionProvider::FtpConnection::ConnectionScheme
const ConnectionScheme
Connection entry info.
Definition: FtpConnection.qc.dox.h:37
ConnectionProvider::FilesystemConnection::ConnectionScheme
const ConnectionScheme
Connection entry info.
Definition: FilesystemConnection.qc.dox.h:39
ConnectionProvider::ConnectionSchemeInfo::required_options
*string required_options
Required option string.
Definition: ConnectionSchemeCache.qc.dox.h:70
ConnectionProvider::ConnectionSchemeInfo::options
*hash< string, hash< ConnectionOptionInfo > > options
Connection options: name -> option info.
Definition: ConnectionSchemeCache.qc.dox.h:62
ConnectionProvider::ConnectionSchemeCache::registerScheme
static bool registerScheme(string scheme, hash< ConnectionSchemeInfo > entry)
Register a new connection provider in the cache.
ConnectionProvider::ConnectionOptionInfo::desc
string desc
Description.
Definition: ConnectionSchemeCache.qc.dox.h:44
ConnectionProvider::ConnectionOptionInfo::sensitive
bool sensitive
Is the value sensitive? (password or other authentication info)
Definition: ConnectionSchemeCache.qc.dox.h:47
ConnectionProvider::ConnectionSchemeCache::size
static int size()
Returns the number of types in the cache.
ConnectionProvider::ConnectionSchemeCache::empty
static bool empty()
Returns True if the cache is empty, False if not.
ConnectionProvider::AllowedValueInfo::value
auto value
The value.
Definition: ConnectionSchemeCache.qc.dox.h:32
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::HttpConnection::ConnectionScheme
const ConnectionScheme
Connection entry info.
Definition: HttpConnection.qc.dox.h:52
False
const False
ConnectionProvider::AllowedValueInfo::desc
string desc
Description for the value.
Definition: ConnectionSchemeCache.qc.dox.h:35
ConnectionProvider::ConnectionOptionInfo::type
string type
Option value type.
Definition: ConnectionSchemeCache.qc.dox.h:41
ConnectionProvider::ConnectionSchemeCache::getScheme
static *hash< ConnectionSchemeInfo > getScheme(string scheme)
Returns info for the given connection scheme or NOTHING if not present.
ConnectionProvider::AllowedValueInfo
Allowed value hash.
Definition: ConnectionSchemeCache.qc.dox.h:30