Qore ProviderIndexUtil Module Reference 1.0
Loading...
Searching...
No Matches
ProviderIndexUtil::ProviderIndexUtil Class Reference

The main utility class. More...

#include <ProviderIndexUtil.qc.dox.h>

Static Public Member Methods

static addActionToCache (hash< auto > action)
 Adds the given app and actions to the cache.
 
static addAppToCache (hash< auto > app)
 Adds the given app and actions to the cache.
 
static bool checkAppModule (string app)
 Try to ensure that any required modules are loaded for the given data provider application.
 
static bool checkFactoryModule (string factory)
 Try to ensure that any required module is loaded for the given factory.
 
static bool checkSchemeModule (string scheme)
 Try to ensure that any required modules are loaded for the given connection scheme.
 
static *list< string > getAllAppModulesToLoad ()
 Returns a list of all app modules that have not been returned by a call to this method yet and are not loaded.
 
static *list< hash< auto > > getAllCachedActions ()
 Returns all cached actions.
 
static *list< hash< auto > > getCachedApps ()
 Returns a list of cached app info.
 
static *LoggerInterface getGlobalLogger ()
 Returns the global data provider logger.
 
static string getIndexPath (string type)
 Returns the index path for the given type.
 
static log (Qore::Logger::LoggerLevel level, string fmt,...)
 Log a message to the global logger if possible.
 
static logArgs (Qore::Logger::LoggerLevel level, string fmt, *softlist< auto > args)
 Log a message to the global logger if possible.
 
static *hash< DataProviderIndexInforeadDataProviderIndex ()
 Reads the data provider index from the configured directory.
 
static bool removeCachedApp (string app)
 Removes the given app and all its actions from the cache.
 
static *list< hash< auto > > searchCachedActionRegex (string regex_pattern, int regex_options=RE_Caseless)
 Searches for cached actions whose descriptions match a regular expression pattern.
 
static *list< hash< auto > > searchCachedActionSubstr (string substr, bool ignore_case=True)
 Searches for cached actions whose descriptions match a substring.
 
static *list< hash< auto > > searchCachedAppActionRegex (string app, string regex_pattern, int regex_options=RE_Caseless)
 Searches for cached application actions whose descriptions match a regular expression pattern.
 
static *list< hash< auto > > searchCachedAppActionSubstr (string app, string substr, bool ignore_case=True)
 Searches for cached application actions whose descriptions match a substring.
 
static *list< hash< auto > > searchCachedAppRegex (string regex_pattern, int regex_options=RE_Caseless)
 Searches the app info cache for applications whose names or descriptions match a regular expression pattern.
 
static *list< hash< auto > > searchCachedAppSubstr (string substr, bool ignore_case=True)
 Searches for cachde applications whose names or descriptions match a substring.
 
static setEnvironmentVariable (string dir)
 Sets the environment variable.
 
static setGlobalLogger (*LoggerInterface logger)
 Sets or clears the global logger.
 
static *hash< auto > tryGetAppInfo (string app)
 Try to return any cached app info for the given app.
 
static *list< hash< auto > > tryGetApproximateActionsForApp (string app)
 Try to return any cached approximate app action list for the given app.
 
static *hash< auto > tryGetApproximateAppAction (string app, string action)
 Try to return any cached approximate app action for the given app and action.
 
static *string tryGetIndexDir (*bool throw_exception)
 Try to get the index directory from the environment variable.
 
static bool tryLoadModule (string mod)
 Tries to load the given module or path to the module.
 
static hash< ProviderIndexInfowriteDataProviderIndex (*hash< DataProviderIndexInfo > h, date delta, hash< auto > summary)
 Writes the data provider index to the configured directory.
 

Static Private Member Methods

static checkDataIndex ()
 Checks if the data provider index has been populated.
 
static hash< auto > deserializeActions (hash< string, hash< string, hash< auto > > > actioninfomap, TypedHash action_info_th, TypedHash option_info_th, TypedHash path_vars_th, hash< auto > type_map)
 Deserialize action options.
 
static Mutex m ()
 Global mutex.
 
static *hash< auto > readIndex (string type)
 Reads the index from the configured directory.
 
static hash< ProviderIndexInfowriteIndex (*hash< auto > h, string type, date delta, hash< auto > summary)
 Writes the index to the configured directory.
 

Static Private Attributes

static bool apps_loaded
 All apps loaded flag.
 
static *hash< DataProviderIndexInfoindex
 Global data provider index.
 
static bool initialized
 Initialized flag.
 
static *LoggerInterface logger
 Global logger.
 

Detailed Description

The main utility class.

Member Function Documentation

◆ checkAppModule()

static bool ProviderIndexUtil::ProviderIndexUtil::checkAppModule ( string  app)
static

Try to ensure that any required modules are loaded for the given data provider application.

Parameters
appthe data provider application
Returns
True if at lease one required module was loaded, False if was not

◆ checkFactoryModule()

static bool ProviderIndexUtil::ProviderIndexUtil::checkFactoryModule ( string  factory)
static

Try to ensure that any required module is loaded for the given factory.

Parameters
factorythe data provider factory name
Returns
True if the module was loaded, False if it was not

◆ checkSchemeModule()

static bool ProviderIndexUtil::ProviderIndexUtil::checkSchemeModule ( string  scheme)
static

Try to ensure that any required modules are loaded for the given connection scheme.

Parameters
schemethe scheme
Returns
True if at lease one required module was loaded, False if was not

◆ getAllCachedActions()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::getAllCachedActions ( )
static

Returns all cached actions.

Returns
all cached actions

◆ getGlobalLogger()

static *LoggerInterface ProviderIndexUtil::ProviderIndexUtil::getGlobalLogger ( )
static

Returns the global data provider logger.

Returns
the global data provider logger

◆ searchCachedActionRegex()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::searchCachedActionRegex ( string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches for cached 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 cached actions that match the regular expression pattern in the short_desc or desc fields

◆ searchCachedActionSubstr()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::searchCachedActionSubstr ( string  substr,
bool  ignore_case = True 
)
static

Searches for cached 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 cached actions that match the substring argument in the short_desc or desc fields

◆ searchCachedAppActionRegex()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::searchCachedAppActionRegex ( string  app,
string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches for cached 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 cached actions that match the regular expression pattern in the short_desc or desc fields
Note
If the application is not cached, no results are returned

◆ searchCachedAppActionSubstr()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::searchCachedAppActionSubstr ( string  app,
string  substr,
bool  ignore_case = True 
)
static

Searches for cached 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 is not cached, no results are returned

◆ searchCachedAppRegex()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::searchCachedAppRegex ( string  regex_pattern,
int  regex_options = RE_Caseless 
)
static

Searches the app info cache 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 cached applications that match the regular expression pattern in the name or desc fields

◆ searchCachedAppSubstr()

static *list< hash< auto > > ProviderIndexUtil::ProviderIndexUtil::searchCachedAppSubstr ( string  substr,
bool  ignore_case = True 
)
static

Searches for cachde applications whose names or descriptions match a substring.

Parameters
substrA substring to match in the name and desc fields; pending apps only are matched with the name
ignore_caseIgnore case when searching
Returns
All cached applications that match the substring argument in the name or desc fields

◆ setGlobalLogger()

static ProviderIndexUtil::ProviderIndexUtil::setGlobalLogger ( *LoggerInterface  logger)
static

Sets or clears the global logger.

Parameters
loggerthe global data provider logger

◆ tryLoadModule()

static bool ProviderIndexUtil::ProviderIndexUtil::tryLoadModule ( string  mod)
static

Tries to load the given module or path to the module.

Parameters
modthe module to load
Returns
True if the module was loaded, False if it was not