Qore DataProvider Module Reference
1.0
DataProvider.qc.dox.h
1
// -*- mode: c++; indent-tabs-mode: nil -*-
3
25
// minimum required Qore version
26
// assume local scope for variables, do not use "$" signs
27
// require type definitions everywhere
29
// enable all warnings
30
31
33
namespace
DataProvider
{
35
class
DataProvider
{
36
37
public
:
39
const
FactoryMap = {
40
"db"
:
"DbDataProvider"
,
41
"swagger"
:
"SwaggerDataProvider"
,
42
"csvread"
:
"CsvUtil"
,
43
"csvwrite"
:
"CsvUtil"
,
44
"fixedlengthread"
:
"FixedLengthUtil"
,
45
"fixedlengthwrite"
:
"FixedLengthUtil"
,
46
"salesforcerest"
:
"SalesforceRestDataProvider"
,
47
// provided by the xml module
48
"soap"
:
"SoapDataProvider"
,
49
};
50
52
const
TypeMap = {
53
"qore/ftp"
:
"FtpPollerUtil"
,
54
"qore/sftp"
:
"SftpPollerUtil"
,
55
"qore/fsevents"
:
"FsEventPollerUtil"
,
56
};
57
59
const
FactoryModuleList = keys (map {$1:
True
}, FactoryMap.iterator());
60
// "map" is used above to ensure that the values only appear once in the final list
61
62
protected
:
64
static
hash<string, AbstractDataProviderFactory>
factory_cache
;
65
67
static
hash<string, string>
factory_module_map
;
68
70
static
Mutex factory_cache_lock();
71
73
static
DataProviderTypeEntry
type_cache();
74
76
static
hash<string, string>
type_module_map
;
77
79
static
Mutex type_cache_lock();
80
82
84
static
bool
allow_env_config =
False
;
85
87
static
bool
env_config_locked =
False
;
88
89
public
:
90
92
96
static
registerFactory(
AbstractDataProviderFactory
factory);
97
99
static
*
AbstractDataProviderFactory
getFactory(
string
name);
100
102
108
static
AbstractDataProviderFactory
getFactoryEx(
string
name);
109
111
116
static
AbstractDataProvider
getFactoryObject(
string
path, *hash<auto> options);
117
119
126
static
AbstractDataProvider
getFactoryObjectFromString(
string
name);
127
129
static
*list<string> listFactories();
130
132
140
static
registerType(
string
path,
AbstractDataProviderType
type
);
141
143
150
static
*
AbstractDataProviderType
getType(
string
path);
151
153
162
static
AbstractDataProviderType
getTypeEx(
string
path);
163
165
static
DataProviderTypeEntry
getTypeRoot();
166
168
172
static
*list<string> listTypes();
173
175
static
registerKnownFactories();
176
178
static
loadProvidersFromEnvironment();
179
181
static
registerKnownTypes();
182
184
static
loadTypesFromEnvironment();
185
187
static
hash<auto> getInfoAsData(hash<auto> info0);
188
190
194
static
setAutoConfig();
195
197
static
bool
getAutoConfig();
198
200
static
list<string> getPathList(
string
path);
201
203
216
protected
:
217
static
*
AbstractDataProviderType
getTypeIntern(
string
path,
bool
throw_exception);
218
public
:
219
220
222
237
protected
:
238
static
*
AbstractDataProviderType
getTypeFromFields(
string
path,
AbstractDataProviderType
type
, list<string> type_path,
bool
throw_exception);
239
public
:
240
241
243
protected
:
244
static
checkRequest();
245
public
:
246
247
249
protected
:
250
static
*
string
tryGetFactoryModuleName(
string
name);
251
public
:
252
253
255
protected
:
256
static
*
string
tryGetTypeModuleName(
string
name);
257
public
:
258
259
261
protected
:
262
static
*
string
tryGetModuleName(
string
name,
string
func,
string
type
);
263
public
:
264
265
267
protected
:
268
static
*
DataProviderTypeEntry
tryLoadTypeFromPath(list<string> type_path);
269
public
:
270
271
273
protected
:
274
static
bool
tryLoad(
string
module_str, *
bool
verbose);
275
public
:
276
277
279
protected
:
280
static
loadFromEnvironment(
string
func,
string
type
);
281
public
:
282
283
285
protected
:
286
static
bool
checkInjection(
object
obj, hash<string, string> module_map);
287
public
:
288
289
};
290
};
DataProvider::AbstractDataProviderFactory
Data provider factory class.
Definition:
AbstractDataProviderFactory.qc.dox.h:34
DataProvider::AbstractDataProviderType
describes a data type
Definition:
AbstractDataProviderType.qc.dox.h:161
type
string type(auto arg)
DataProvider::DataProvider::type_module_map
static hash< string, string > type_module_map
data provider type module map
Definition:
DataProvider.qc.dox.h:76
DataProvider::DataProvider::factory_cache
static hash< string, AbstractDataProviderFactory > factory_cache
data provider factory cache
Definition:
DataProvider.qc.dox.h:64
True
const True
DataProvider
Qore AbstractDataField class definition.
Definition:
AbstractDataField.qc.dox.h:32
DataProvider::AbstractDataProvider
The AbstractDataProvider class.
Definition:
AbstractDataProvider.qc.dox.h:194
DataProvider::DataProviderTypeEntry
the DataProviderTypeEntry class
Definition:
DataProviderTypeEntry.qc.dox.h:50
False
const False
DataProvider::DataProvider::factory_module_map
static hash< string, string > factory_module_map
data provider factory module map
Definition:
DataProvider.qc.dox.h:67