Qore DataProvider Module Reference 3.0
Loading...
Searching...
No Matches
DataProvider::DataProviderActionCatalog Class Reference

DataProvider action and application catalog class. More...

#include <DataProviderActionCatalog.qc.dox.h>

Static Public Member Methods

static int compareActions (hash< DataProviderActionInfo > act0, hash< DataProviderActionInfo > act1)
 Compares two actions for equality.
 
static int compareBaseTypes (*Type t0, *Type t1)
 Compares two types for equality.
 
static int compareOptions (*hash< string, hash< ActionOptionInfo > > opt0, *hash< string, hash< ActionOptionInfo > > opt1)
 Compares two option hashes for equality.
 
static *hash< string, hash< DataProviderActionInfo > > getActionHash (string app)
 Returns a hash of all actions for the given application.
 
static *hash< string, hash< DataProviderActionInfo > > getActionHashEx (string app)
 Returns a hash of all actions for the given application.
 
static hash< string, hash< ActionOptionInfo > > getActionOptionFromFields (hash< auto > fields, *hash< auto > additional_fields)
 Converts field definitions into option descriptions.
 
static *list< hash< DataProviderActionInfo > > getActions (string app)
 Returns all actions for the given application.
 
static list< hash< DataProviderActionInfo > > getActionsEx (string app)
 Returns all actions for the given application; throws an exception if the app is not registered.
 
static *list< hash< DataProviderActionInfo > > getActionsForScheme (string scheme)
 Returns all actions for a particular connection scheme.
 
static *list< hash< DataProviderActionInfo > > getAllActions ()
 Returns all actions in the cache.
 
static *list< hash< DataProviderAppInfo > > getAllApps ()
 Returns all applications in the cache.
 
static *hash< DataProviderAppInfogetApp (string app)
 Returns the application definition for the given application name.
 
static *hash< DataProviderActionInfogetAppAction (string app, string action)
 Returns the action definition for the given application and action.
 
static hash< DataProviderActionInfogetAppActionEx (string app, string action)
 Returns the application definition for the given application name.
 
static hash< DataProviderAppInfogetAppEx (string app)
 Returns the application definition for the given application name.
 
static AbstractDataProvider getDataProviderForAction (hash< DataProviderActionInfo > action, *reference< hash< auto > > options)
 Returns a data provider option for the given action and options.
 
static registerAction (hash< DataProviderActionInfo > action)
 Registers a data provider action.
 
static registerApp (hash< DataProviderAppInfo > app)
 Registers a data provider application.
 
static *list< hash< DataProviderActionInfo > > searchActionRegex (string regex_pattern, int regex_options=RE_Caseless)
 Searches for actions whose descriptions match a regular expression pattern.
 
static *list< hash< DataProviderActionInfo > > searchActionSubstr (string substr, bool ignore_case=True)
 Searches for actions whose descriptions match a substring.
 
static *list< hash< DataProviderActionInfo > > searchAppActionRegex (string app, string regex_pattern, int regex_options=RE_Caseless)
 Searches for application actions whose descriptions match a regular expression pattern.
 
static *list< hash< DataProviderActionInfo > > searchAppActionRegexEx (string app, string regex_pattern, int regex_options=RE_Caseless)
 Searches for application actions whose descriptions match a regular expression pattern.
 
static *list< hash< DataProviderActionInfo > > searchAppActionSubstr (string app, string substr, bool ignore_case=True)
 Searches for application actions whose descriptions match a substring.
 
static *list< hash< DataProviderActionInfo > > searchAppActionSubstrEx (string app, string substr, bool ignore_case=True)
 Searches for application actions whose descriptions match a substring.
 
static *list< hash< DataProviderAppInfo > > searchAppRegex (string regex_pattern, int regex_options=RE_Caseless)
 Searches for applications whose names or descriptions match a regular expression pattern.
 
static *list< hash< DataProviderAppInfo > > searchAppSubstr (string substr, bool ignore_case=True)
 Searches for applications whose names or descriptions match a substring.
 

Public Attributes

const RequiredActionKeys = ...
 Required action key set (without action_code and path_vars, which are checked separately)
 
const RequiredAppKeys = ...
 Required application key set.
 

Static Private Member Methods

static deregisterApp (string name)
 Deregisters an app and all its actions if an exception occurs during the other module's initialization.
 
static Mutex lck ()
 Mutex for atomic operations.
 
static string normalizePath (string path)
 Returns a normalized path to ensure that comparisons always work.
 
static resolveOutputTypes ()
 Resolves output fypes in actions.
 

Private Attributes

const DefaultDescription = "no description provided"
 Default description.
 

Static Private Attributes

static hash< string, hash< string, hash< DataProviderActionInfo > > > app_actionmap
 Action cache, the key is the application key, the second key is the action string.
 
static hash< string, hash< DataProviderAppInfo > > appcache
 Top-level master application cache keyed by application name.
 
static hash< string, hash< string, bool > > resolve_output_types
 Set of actions requiring output type resolution; app -> action -> True.
 
static hash< string, list< hash< DataProviderActionInfo > > > smap
 Scheme map; keys are connection schemes.
 
static hash< string, hash< DataProviderActionInfo > > top_actionmap
 Master action cache, the key <app>/<action>
 

Detailed Description

DataProvider action and application catalog class.

Member Function Documentation

◆ compareActions()

static int DataProvider::DataProviderActionCatalog::compareActions ( hash< DataProviderActionInfo act0,
hash< DataProviderActionInfo act1 
)
static

Compares two actions for equality.

Returns
0 for equal, -1 for not equal

◆ compareOptions()

static int DataProvider::DataProviderActionCatalog::compareOptions ( *hash< string, hash< ActionOptionInfo > >  opt0,
*hash< string, hash< ActionOptionInfo > >  opt1 
)
static

Compares two option hashes for equality.

Returns
0 for equal, -1 for not equal

◆ getActionHash()

static *hash< string, hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::getActionHash ( string  app)
static

Returns a hash of all actions for the given application.

Parameters
appthe data provider application
Returns
a hash of actions keyed by action name for the given application
See also
getActionHashEx()

◆ getActionHashEx()

static *hash< string, hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::getActionHashEx ( string  app)
static

Returns a hash of all actions for the given application.

Parameters
appthe data provider application
Returns
a hash of actions keyed by action name for the given application
Exceptions
APP-ERRORthe given application is not registered
See also
getActionHash()

◆ getActions()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::getActions ( string  app)
static

Returns all actions for the given application.

Parameters
appthe data provider application
Returns
a list of actions for the given application
See also
getActionsEx()

◆ getActionsEx()

static list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::getActionsEx ( string  app)
static

Returns all actions for the given application; throws an exception if the app is not registered.

Parameters
appthe data provider application
Returns
a list of actions for the given application
Exceptions
APP-ERRORthe given application is not registered
See also
getActions()

◆ getActionsForScheme()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::getActionsForScheme ( string  scheme)
static

Returns all actions for a particular connection scheme.

Parameters
schemethe connection scheme
Returns
a list of actions associated with the given scheme

◆ getAllActions()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::getAllActions ( )
static

Returns all actions in the cache.

Returns
all actions in the cache

◆ getAllApps()

static *list< hash< DataProviderAppInfo > > DataProvider::DataProviderActionCatalog::getAllApps ( )
static

Returns all applications in the cache.

Returns
all applications in the cache

◆ getApp()

static *hash< DataProviderAppInfo > DataProvider::DataProviderActionCatalog::getApp ( string  app)
static

Returns the application definition for the given application name.

Parameters
appthe app name
Returns
the application definition for the given application name or NOTHING if not present
See also
getAppEx()

◆ getAppAction()

static *hash< DataProviderActionInfo > DataProvider::DataProviderActionCatalog::getAppAction ( string  app,
string  action 
)
static

Returns the action definition for the given application and action.

Parameters
appthe app name
actionthe action name
Returns
the action definition for the given application name and action or NOTHING if not present
See also
getAppActionEx()

◆ getAppActionEx()

static hash< DataProviderActionInfo > DataProvider::DataProviderActionCatalog::getAppActionEx ( string  app,
string  action 
)
static

Returns the application definition for the given application name.

Parameters
appthe app name
actionthe action name
Returns
the action definition for the given application name and action; throws an exception if the app is not registered
Exceptions
APP-ERRORthe given application is not registered
ACTION-ERRORthe given action is not registered
See also
getAppAction()

◆ getAppEx()

static hash< DataProviderAppInfo > DataProvider::DataProviderActionCatalog::getAppEx ( string  app)
static

Returns the application definition for the given application name.

Parameters
appthe app name
Returns
the application definition for the given application name; throws an exception if the app is not registered
Exceptions
APP-ERRORthe given application is not registered
See also
getApp()

◆ getDataProviderForAction()

static AbstractDataProvider DataProvider::DataProviderActionCatalog::getDataProviderForAction ( hash< DataProviderActionInfo action,
*reference< hash< auto > >  options 
)
static

Returns a data provider option for the given action and options.

Parameters
actionthe action to use to return the data provider
optionsa reference to options where constructor options will be taken from
Returns
a data provider option for the given action and options

◆ registerAction()

static DataProvider::DataProviderActionCatalog::registerAction ( hash< DataProviderActionInfo action)
static

Registers a data provider action.

Parameters
actionthe action to register
Exceptions
ACTION-ERRORmissing or invalid attributes, action already registered

The app and action attributes must be unique for every action registered

◆ registerApp()

static DataProvider::DataProviderActionCatalog::registerApp ( hash< DataProviderAppInfo app)
static

Registers a data provider application.

Parameters
appthe application to register
Exceptions
APP-ERRORmissing or invalid attributes, app already registered

◆ searchActionRegex()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::searchActionRegex ( string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches for actions whose descriptions match a regular expression pattern.

Parameters
regex_patternA regular expression pattern to match in the short_desc and desc fields
regex_optionsRegular expression options; a case-insensitive match is performed by default
Returns
All actions that match the regular expression pattern in the short_desc or desc fields

◆ searchActionSubstr()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::searchActionSubstr ( string  substr,
bool  ignore_case = True 
)
static

Searches for actions whose descriptions match a substring.

Parameters
substrA substring to match in the short_desc and desc fields
ignore_caseIgnore case when searching
Returns
All actions that match the substring argument in the short_desc or desc fields

◆ searchAppActionRegex()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::searchAppActionRegex ( string  app,
string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches for application actions whose descriptions match a regular expression pattern.

Parameters
appThe application to search for actions in
regex_patternA regular expression pattern to match in the short_desc and desc fields
regex_optionsRegular expression options; a case-insensitive match is performed by default
Returns
All actions that match the regular expression pattern in the short_desc or desc fields
Note
If the application does not exist, no results are returned

◆ searchAppActionRegexEx()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::searchAppActionRegexEx ( string  app,
string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches for application actions whose descriptions match a regular expression pattern.

Parameters
appThe application to search for actions in
regex_patternA regular expression pattern to match in the short_desc and desc fields
regex_optionsRegular expression options; a case-insensitive match is performed by default
Returns
All actions that match the regular expression pattern in the short_desc or desc fields
Exceptions
APP-ERRORthe given application is not registered
Note
If the application does not exist, an exception is thrown

◆ searchAppActionSubstr()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::searchAppActionSubstr ( string  app,
string  substr,
bool  ignore_case = True 
)
static

Searches for application actions whose descriptions match a substring.

Parameters
appThe application to search for actions in
substrA substring to match in the short_desc and desc fields
ignore_caseIgnore case when searching
Returns
All actions that match the substring argument in the short_desc or desc fields
Note
If the application does not exist, no results are returned

◆ searchAppActionSubstrEx()

static *list< hash< DataProviderActionInfo > > DataProvider::DataProviderActionCatalog::searchAppActionSubstrEx ( string  app,
string  substr,
bool  ignore_case = True 
)
static

Searches for application actions whose descriptions match a substring.

Parameters
appThe application to search for actions in
substrA substring to match in the short_desc and desc fields
ignore_caseIgnore case when searching
Returns
All actions that match the substring argument in the short_desc or desc fields
Exceptions
APP-ERRORthe given application is not registered
Note
If the application does not exist, an exception is thrown

◆ searchAppRegex()

static *list< hash< DataProviderAppInfo > > DataProvider::DataProviderActionCatalog::searchAppRegex ( string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches for applications whose names or descriptions match a regular expression pattern.

Parameters
regex_patternA regular expression pattern to match in the name and desc fields
regex_optionsRegular expression options; a case-insensitive match is performed by default
Returns
All applications that match the regular expression pattern in the name or desc fields

◆ searchAppSubstr()

static *list< hash< DataProviderAppInfo > > DataProvider::DataProviderActionCatalog::searchAppSubstr ( string  substr,
bool  ignore_case = True 
)
static

Searches for applications whose names or descriptions match a substring.

Parameters
substrA substring to match in the name and desc fields
ignore_caseIgnore case when searching
Returns
All applications that match the substring argument in the name or desc fields