Qore ConnectionProvider Module Reference  1.5
ConnectionSchemeCache.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
27 namespace ConnectionProvider {
29 public struct AllowedValueInfo {
31  auto value;
32 
34  string desc;
35 };
36 
38 public struct ConnectionOptionInfo {
40  string type;
41 
43  string desc;
44 
46  bool sensitive = False;
47 
49  *softlist<hash<AllowedValueInfo>> allowed_values;
50 
53 
56 };
57 
59 public struct ConnectionSchemeInfo {
61  Class cls;
62 
64  *hash<string, hash<ConnectionOptionInfo>> options;
65 
67 
73 };
74 
77 
78 public:
80  const SchemeMap = {
81  "rest": "RestClient",
82  "rests": "RestClient",
83 
84  "billwerkrest": "BillwerkRestClient",
85  "billwerkrests": "BillwerkRestClient",
86 
87  "sewiorest": "SewioRestClient",
88  "sewiorests": "SewioRestClient",
89 
90  "sfrests": "SalesforceRestClient",
91 
92  "sap4hanarests": "Sap4HanaRestClient",
93 
94  "awsrests": "AwsRestClient",
95 
96  "cdsrests": "CdsRestClient",
97 
98  "zeyosrest": "ZeyosRestClient",
99  "zeyosrests": "ZeyosRestClient",
100 
101  "smtp": "SmtpClient",
102  "smtps": "SmtpClient",
103  "smtptls": "SmtpClient",
104  "esmtp": "SmtpClient",
105  "esmtps": "SmtpClient",
106  "esmtptls": "SmtpClient",
107 
108  "pop3": "Pop3Client",
109  "pop3s": "Pop3Client",
110 
111  "telnet": "TelnetClient",
112 
113  "ws": "WebSocketClient",
114  "wss": "WebSocketClient",
115 
116  "sewiows": "SewioWebSocketClient",
117  "sewiowss": "SewioWebSocketClient",
118 
119  "soap": "SoapClient",
120  "soaps": "SoapClient",
121 
122  "sfsoap": "SalesforceSoapClient",
123  "sfsoaps": "SalesforceSoapClient",
124 
125  "sftp": "Ssh2Connections",
126 
127  "snrests": "ServiceNowRestClient",
128 
129  "ssh": "Ssh2Connections",
130 
131  "jsonrpc": "JsonRpcClient",
132  "jsonrpcs": "JsonRpcClient",
133 
134  "xmlrpc": "XmlRpcClient",
135  "xmlrpcs": "XmlRpcClient",
136 
137  "yamlrpc": "YamlRpcClient",
138  "yamlrpcs": "YamlRpcClient",
139  };
140 
141 protected:
143  static hash<string, hash<ConnectionSchemeInfo>> cache = {
146 
149 
152  };
153 
155  static Mutex lck();
156 
157 public:
158 
160 
166  static bool registerScheme(string scheme, hash<ConnectionSchemeInfo> entry);
167 
169  static hash<string, hash<ConnectionSchemeInfo>> get();
170 
172  static int size();
173 
175  static bool empty();
176 
178 
180  static *list<string> listSchemes();
181 
183 
188  static *hash<ConnectionSchemeInfo> getScheme(string scheme);
189 
191 
197  static hash<ConnectionSchemeInfo> getSchemeEx(string scheme);
198 
200 
211  static *hash<ConnectionSchemeInfo> getSchemeImpl(string scheme, bool throw_exception, *code scheme_loader);
212 
214 protected:
215  static bool tryLoadModule(string mod, bool throw_exception);
216 public:
217 
218 };
219 };
Connection provider type cache class.
Definition: ConnectionSchemeCache.qc.dox.h:76
static bool tryLoadModule(string mod, bool throw_exception)
Try to load the given module.
static hash< ConnectionSchemeInfo > getSchemeEx(string scheme)
Returns info for the given connection scheme or throws an exception if not present.
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.
const SchemeMap
Map of known connection schemes to modules.
Definition: ConnectionSchemeCache.qc.dox.h:80
static hash< string, hash< ConnectionSchemeInfo > > get()
Returns the entire cache.
static hash< string, hash< ConnectionSchemeInfo > > cache
Connection provider cache.
Definition: ConnectionSchemeCache.qc.dox.h:143
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 bool registerScheme(string scheme, hash< ConnectionSchemeInfo > entry)
Register a new connection provider in the cache.
static int size()
Returns the number of types in the cache.
static bool empty()
Returns True if the cache is empty, False if not.
static Mutex lck()
Connection provider cache lock.
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:52
const False
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:26
Allowed value hash.
Definition: ConnectionSchemeCache.qc.dox.h:29
string desc
Description for the value.
Definition: ConnectionSchemeCache.qc.dox.h:34
auto value
The value.
Definition: ConnectionSchemeCache.qc.dox.h:31
Connection option information.
Definition: ConnectionSchemeCache.qc.dox.h:38
bool subst_env_vars
Do environment variable substitution on the value?
Definition: ConnectionSchemeCache.qc.dox.h:55
auto default_value
Any default value.
Definition: ConnectionSchemeCache.qc.dox.h:52
string type
Option value type.
Definition: ConnectionSchemeCache.qc.dox.h:40
string desc
Description.
Definition: ConnectionSchemeCache.qc.dox.h:43
*softlist< hash< AllowedValueInfo > > allowed_values
List of allowed values (enum)
Definition: ConnectionSchemeCache.qc.dox.h:49
bool sensitive
Is the value sensitive? (password or other authentication info)
Definition: ConnectionSchemeCache.qc.dox.h:46
Connection provider information.
Definition: ConnectionSchemeCache.qc.dox.h:59
*string required_options
Required option string.
Definition: ConnectionSchemeCache.qc.dox.h:72
*hash< string, hash< ConnectionOptionInfo > > options
Connection options: name -> option info.
Definition: ConnectionSchemeCache.qc.dox.h:64
Class cls
The connection class.
Definition: ConnectionSchemeCache.qc.dox.h:61