Qorus Integration Engine® Enterprise Edition 6.0.15_prod
Loading...
Searching...
No Matches
OMQ::QorusClientAPI Class Reference

This class implements the client interface to a Qorus server. More...

Inheritance diagram for OMQ::QorusClientAPI:
[legend]
Collaboration diagram for OMQ::QorusClientAPI:
[legend]

Public Member Methods

 constructor ()
 creates the object and parses the options file More...
 
Logger getClientLogger (Logger::LoggerLevel level=LoggerLevel::getLevelError())
 Returns a client "stdout" logger. More...
 
Logger getClientLogger (int level=LoggerLevel::ERROR)
 Returns a client "stdout" logger. More...
 
Connections getConnectionProvider (string type)
 returns the connection provider object More...
 
bool isLSB ()
 returns True if the installation is an LSB installation, False if not More...
 
string getOptionFileName ()
 returns the options file name More...
 
*hash< string, AbstractConnection > getUserConnections ()
 Returns a hash describing all defined user connections or NOTHING if no user connections are defined. More...
 
*hash< auto > getUserConnectionInfo ()
 Returns a hash describing all defined user connections or NOTHING if no user connections are defined. More...
 
ConnectionProvider::AbstractConnection getUserConnectionObject (string name)
 Returns a ConnectionProvider::AbstractConnection object corresponding to a defined user connection. More...
 
synchronized hash getUserConnectionInfo (string name)
 Returns a hash describing the given user connection. More...
 
string getUserConnectionUrl (string name)
 Returns the URL corresponding to a defined user connection. More...
 
object getUserConnection (string name, bool connect=True, *hash rtopts)
 Returns an object corresponding to a defined user connection. More...
 
 reloadUserConnections ()
 reloads user connections from the DB on the next request for a user connection More...
 
synchronized Datasource getDatasource (string name)
 returns a Datasource object for the given string if defined in Datasource Connections More...
 
Datasource getNewDatasource (string name)
 returns a new Datasource object for the given string if defined in Datasource Connections More...
 
string getDatasourceConnectionString (string name)
 returns the datasource connection string for the given datasource if defined in Datasource Connections More...
 
*hash< string, string > getDatasourceConnectionsAsHash ()
 returns a hash of datasource connections; keys are datasource names, values are connection strings More...
 
string getConfigDir ()
 returns the path to the configuration directory for this instance of Qorus More...
 
string getAppDir ()
 returns the path to the application root directory More...
 
synchronized DatasourcePool getDatasourcePool (string name, int min=0, int max=0)
 returns a DatasourcePool object for the given string if defined in Datasource Connections More...
 
DatasourcePool getNewDatasourcePool (string name, softint min=0, softint max=0)
 returns a new DatasourcePool object for the given string if defined in Datasource Connections More...
 
*hash< auto > getRemoteInfo ()
 returns a hash of remote connections keyed by remote connection name or NOTHING if no remote connections are defined More...
 
ConnectionProvider::AbstractConnection getRemoteConnectionObject (string name)
 returns a ConnectionProvider::AbstractConnection object for the given remote connection More...
 
hash getRemoteInfo (string name)
 returns a hash of the given remote connection More...
 
string getRemoteUrl (string name)
 returns the URL for a Qorus remote connection from the connection name More...
 
OMQ::Client::QorusSystemAPIHelper getRemote (string name)
 gets a remote connection based on connection parameters parsed in the Qorus to Qorus Connections More...
 
OMQ::Client::QorusSystemRestHelper getRemoteRest (string name, bool connect=True)
 returns a connection for RESTful communication with a remote Qorus server based on connection parameters parsed in the Qorus to Qorus Connections More...
 
hash< auto > getRemoteConfig (string name, bool with_password=True)
 returns a hash with connection parameters for a remote Qorus server based on connection parameters parsed in the Qorus to Qorus Connections More...
 
hash< auto > getRemoteConfig (string name, hash< auto > opts)
 returns a hash with connection parameters for a remote Qorus server based on connection parameters parsed in the Qorus to Qorus Connections More...
 
string getLocalSystemAuthToken (*timeout expiry)
 Returns a token with internal system authentication for use with REST clients or throws an exception. More...
 
*string tryGetLocalSystemAuthToken (*timeout expiry)
 Returns a token with internal system authentication for use with REST clients if possible. More...
 
 updateOptionValue (string domain, string option, auto value)
 Update internal option value. More...
 
synchronized initOmqUser ()
 initializes the omquser variable
 
 setDatasourceFromText (string line)
 this method allows a datasource to be created or redefined from the text passed More...
 
hash< auto > getWorkflowInfoID (softint wfid)
 returns a hash of information about the given workflow based on the workflowid passed More...
 
hash< auto > getWorkflowInfoName (string name, string version)
 returns a hash of information about the given workflow based on the workflow name and version passed More...
 
hash getOriginalOptionHash ()
 returns a hash of options originally read form the options file
 
*string getKeyOption (string opt)
 returns the value of a system opion as a string
 
 preSchemaVerifySystem (bool quiet=False)
 actions to verify the state of an installed Qorus installation before the schema has potentially been created
 
 postSchemaVerifySystem (bool quiet=False)
 actions to verify the state of an installed Qorus installation after the schema has been verified
 
 checkAdminUser (bool quiet=False)
 check if any users exist in the system DB, if not create a superuser named admin with a random password
 
 checkNodeOption (bool quiet=False)
 create a "node" entry in System Options File if not already present
 
 generateKeys (bool quiet=False)
 create encryption key files if they don't exist and sets system options More...
 
string createWorkflowInstanceID (softint wfid, *softstring ext_order_id, *hash sdata, *hash ddata, *hash orderkeys, softint priority=OMQ::DefaultOrderPriority, *softint pwfiid)
 creates a workflow order data instance from the workflowid and order parameters and returns the workflow_instanceid More...
 
string createWorkflowInstanceName (string name, string version, *softstring ext_order_id, *hash sdata, *hash ddata, *hash orderkeys, softint priority=OMQ::DefaultOrderPriority, *softint pwfiid)
 creates a workflow order data instance from the workflow and version and order parameters and returns the workflow_instanceid More...
 
softstring getNextSequenceValue (string name)
 returns the next sequence value for the given sequence using the SQLInterface object (returned as a string)
 
int getNextSequenceValueInt (string name)
 returns the next sequence value for the given sequence using the SQLInterface object (returned as an int)
 
string getQorusSystemLogFilePrefix ()
 returns the system log file name prefix
 
string getWorkflowLogFileName (string name, string version, softint wfid=0)
 returns a string giving the workflow log file name corresponding to the arguments
 
string getServiceLogFileName (string type, string name, string version, softint svcid=0)
 returns a string giving the service log file name corresponding to the arguments
 
string getJobLogFileName (string name, string version, softint jobid=0)
 returns a string giving the service log file name corresponding to the arguments
 
- Public Member Methods inherited from OMQ::CryptoKeyHelper
binary serializeEncryptSensitiveData (hash< auto > data, binary iv, reference mac, string aad)
 returns a binary object encrypted with AES-256 for a sensitive data hash More...
 
hash< auto > deserializeDecryptSensitiveData (binary data, binary iv, binary mac, string aad)
 returns a decrypted sensitive data hash from the AES-256-encrypted binary object and other encryption arguments More...
 
string encodeEncryptSensitiveValue (string svalue)
 returns a string encrypted with Blowfish and subjected to base64 encoding for a sensitive data key value More...
 
string decodeDecryptSensitiveValue (string svalue)
 returns a decoded and decrypted sensitive data key value from the base64-encoded encrypted value More...
 
hash< auto > encryptOrderData (softint wfiid, string skey, string svalue, hash< auto > info, *hash< auto > meta)
 encrypt the data needed for a row in sensitive_order_data
 
abstract *string getKeyOption (string opt)
 returns the value of a system opion as a string
 

Static Public Member Methods

static ignoreWarnings (bool ignore_warnings=True)
 sets a flag to ignore warnings
 
static bool checkPid (int pid, string process_type)
 Returns True if the process is running, False if not.
 
static saveOptionsFile (string fn, hash options, string hdr="", string trl="")
 saves the hash given as the options file
 
static clientError (string msg, string desc)
 throws an exception with the given parameters
 
static clientWarning (string err, string msg)
 prints out a warning with the given parameters
 
static hash parseOptionsFile (string fn)
 parses the given file as a Qorus option file and returns a hash More...
 
static hash< auto > parse_ds (string str)
 parses a datasource string and returns the hash More...
 
static binary getRandomSalt (int size)
 returns a random salt from /dev/urandom (on UNIX) as a binary, arg: size in bytes
 
static int createRBACUser (Datasource ds, string user, string pass, string name, softlist roles, bool quiet=False, *string tag)
 creates an RBAC user with transaction management and duplicate user checking More...
 
static createRBACUserDB (Datasource ds, string user, string pass, string name, softlist roles, bool quiet=False, *string tag)
 creates an RBAC user More...
 
static auto parseToQoreValue (string arg)
 tries to convert a string (such as an argument given from the command-line) to a Qore value More...
 
- Static Public Member Methods inherited from OMQ::QorusClient
static init (*bool ignore_warnings)
 the client initialization function where any errors cause an error message to be displayed and exit() is called More...
 
static synchronized init2 (*bool ignore_warnings)
 the main client initialization method; other functions call this one to initialize the client library More...
 
static synchronized initFast (*bool ignore_warnings)
 fast client initialization method; other functions call this one to initialize the client library More...
 
static hash< auto > parseOptions (string domain)
 option-parsing function: parses the option file More...
 
static hash< auto > parseOptions ()
 option-parsing function: parses the option file More...
 
static int configureInterfaces (hash< auto > config, *bool silent, bool exit_on_error=True)
 set config items in the server More...
 
static int restGetCode (string uri_path, bool exit_if_down=True)
 Sends a REST GET request to the Qorus server and returns the HTTP status code. More...
 
static createPerm (string perm, string desc, *bool silent)
 Creates the given user permission if the permission does not exist. More...
 
static createRole (string role, string base_role, string desc, *softlist< string > groups, *bool silent)
 Creates the given role as a clone of an existing role if the new role does not exist. More...
 
static createRoleWithPerms (string role, string desc, hash< auto > role_info, *bool silent)
 Creates the given role with explicit permissions if the role does not exist. More...
 
static createUser (string user, string pass, softlist< string > roles, string desc, *bool silent)
 Creates the given user if the user does not exist. More...
 
static createUserConnection (string name, string desc, string url, *hash< auto > options, *bool silent)
 Creates a user connection if the connection does not exist. More...
 
static createGlobalError (string error, string desc, string status, *int retry_delay_secs, *bool silent)
 Creates the given global error configuration if it does not already exist. More...
 
static createOrUpdateWorkflowError (string workflow, string error, string desc, string status, *int retry_delay_secs, *bool silent)
 Aligns the given workflow error configuration according to the arguments. More...
 
static addDataProviderModuleOption (string mod)
 Adds the given module to the dataprovider-modules system option. More...
 
static addConnectionModuleOption (string mod)
 Adds the given module to the connection-modules system option. More...
 
static addModuleOption (string option, string mod)
 Adds the given module to the given module option. More...
 

Private Member Methods

synchronized initUserConnectionsIntern ()
 ensures that user connections have been initialized
 
string processSystemTemplate (string template)
 takes a template string and performs substitutions
 
- Private Member Methods inherited from OMQ::CryptoKeyHelper
 setupEncryption ()
 sets up encryption keys and verifies their state
 

Private:Internal Member Methods

*ZSocketDealer tryGetQorusCoreSocket ()
 Tries to return a ZSocket object for communicating with the local qorus-core instance.
 
internal getZContext ()
 Sets up the context for ZeroMQ messaging.
 
internal getLocalAddress ()
 Gets the local address and node name.
 
 setRemoteParams (OMQ::Client::QorusSystemAPIHelper ret, string name)
 sets up a QorusSystemAPIHelper to communicate with the given remote Qorus instance
 
string getConfigFile (string name, *string opt)
 returns a complete path for the configuration file given as an argument or an exception is thrown if the file does not exist More...
 
hash< auto > getOptions (string domain)
 returns the options from the given domain as a hash More...
 
hash< auto > getOptions ()
 returns the options from all domains as a hash of hashes More...
 
 setOption (string domain, string key, auto value)
 Allows an option value to be set temporarily.
 
SQLInterface getSQLIF ()
 returns an SQLInterface object using the system DatasourcePool object More...
 
SQLInterface getSQLIF (string dsn)
 returns an SQLInterface object using a DatasourcePool object for the datasource given as an argument More...
 
SQLInterface getSQLIF (DatasourcePool dsp)
 returns an SQLInterface object using the DatasourcePool object given as an argument More...
 
 resetSystemDatasource ()
 Resets the system datasource.
 
 initSystemDatasources ()
 initializes the system Datasource and DatasourcePool objects More...
 
synchronized initOmq (*bool ignore_errors)
 initializes the omq variable
 
internal init ()
 on-demand initialization
 
internal initInternalDb ()
 initalizes the omqp and sqlif members
 

Private:Internal Attributes

hash options
 internal options
 

Additional Inherited Members

- Public Attributes inherited from OMQ::QorusClient
const DefaultZmqTimeout = 5s
 Default client timeout for ZeroMQ messages to acquire an API token.
 

Detailed Description

This class implements the client interface to a Qorus server.

This class is in charge of parsing the options and providing other client-related services based on these files. This class is normally used from the omqclient object, a global variable initialized by calling qorus_client_init() (or qorus_client_init2()).

For example, retrieving Datasource or DatasourcePool objects:

qorus_client_init();
Datasource app2 = omqclient.getDatasource("app2");
DatasourcePool app2p = omqclient.getDatasourcePool("app2");

Member Function Documentation

◆ constructor()

OMQ::QorusClientAPI::constructor ( )

creates the object and parses the options file

uses the OMQ_DIR environment variable if set, otherwise tries to find the Qorus installation

◆ createRBACUser()

static int OMQ::QorusClientAPI::createRBACUser ( Datasource  ds,
string  user,
string  pass,
string  name,
softlist  roles,
bool  quiet = False,
*string  tag 
)
static

creates an RBAC user with transaction management and duplicate user checking

assumes auto-commit disabled for the passed datasource

◆ createRBACUserDB()

static OMQ::QorusClientAPI::createRBACUserDB ( Datasource  ds,
string  user,
string  pass,
string  name,
softlist  roles,
bool  quiet = False,
*string  tag 
)
static

creates an RBAC user

no transaction management, no checking for duplicate users or valid permissions, etc

◆ createWorkflowInstanceID()

string OMQ::QorusClientAPI::createWorkflowInstanceID ( softint  wfid,
*softstring  ext_order_id,
*hash  sdata,
*hash  ddata,
*hash  orderkeys,
softint  priority = OMQ::DefaultOrderPriority,
*softint  pwfiid 
)

creates a workflow order data instance from the workflowid and order parameters and returns the workflow_instanceid

Parameters
wfidthe workflow ID of the workflow order to create
ext_order_idthe optional external_order_instanceid of the workflow order to create
sdatathe static data for the order
ddatathe dynamic data for the order
orderkeysa hash giving the order keys for the order (key=value)
prioritygives the order priority (default OMQ::DefaultOrderPriority)
pwfiidthe loosely-coupled parent workflow instance ID
Returns
a string giving the new workflow_instanceid for the workflow order created
Exceptions
CREATE-ORDER-ERRORmissing both static data and external order instance ID arguments

◆ createWorkflowInstanceName()

string OMQ::QorusClientAPI::createWorkflowInstanceName ( string  name,
string  version,
*softstring  ext_order_id,
*hash  sdata,
*hash  ddata,
*hash  orderkeys,
softint  priority = OMQ::DefaultOrderPriority,
*softint  pwfiid 
)

creates a workflow order data instance from the workflow and version and order parameters and returns the workflow_instanceid

Parameters
namethe name of the workflow for the order to create
versionthe version of the workflow for the order to create
ext_order_idthe optional external_order_instanceid of the workflow order to create
sdatathe static data for the order
ddatathe dynamic data for the order
orderkeysa hash giving the order keys for the order (key=value)
prioritygives the order priority (default OMQ::DefaultOrderPriority)
pwfiidthe loosely-coupled parent workflow instance ID
Returns
a string giving the new workflow_instanceid for the workflow order created
Exceptions
CREATE-ORDER-ERRORmissing both static data and external order instance ID arguments

◆ generateKeys()

OMQ::QorusClientAPI::generateKeys ( bool  quiet = False)

create encryption key files if they don't exist and sets system options

If system options are changed, backs up the System Options File

◆ getAppDir()

string OMQ::QorusClientAPI::getAppDir ( )

returns the path to the application root directory

for LSB instances, always returns "/var/opt/qorus"

Returns
the path to the application root directory

◆ getClientLogger() [1/2]

Logger OMQ::QorusClientAPI::getClientLogger ( int  level = LoggerLevel::ERROR)

Returns a client "stdout" logger.

If the client logger has already been created before, then it is returned, and the level argument is ignored

Parameters
levelthe level for the logger, if it is created with this call
Returns
a client "stdout" logger
Since
Qorus 6.0

◆ getClientLogger() [2/2]

Logger OMQ::QorusClientAPI::getClientLogger ( Logger::LoggerLevel  level = LoggerLevel::getLevelError())

Returns a client "stdout" logger.

If the client logger has already been created before, then it is returned, and the level argument is ignored

Parameters
levelthe level for the logger, if it is created with this call
Returns
a client "stdout" logger
Since
Qorus 6.0

◆ getConfigDir()

string OMQ::QorusClientAPI::getConfigDir ( )

returns the path to the configuration directory for this instance of Qorus

Returns
the path to the configuration directory for this instance of Qorus

◆ getConfigFile()

string OMQ::QorusClientAPI::getConfigFile ( string  name,
*string  opt 
)
private:internal

returns a complete path for the configuration file given as an argument or an exception is thrown if the file does not exist

Parameters
namethe config file name without any directory component
optthe name of the option giving the file location (default: name + "-file")
Returns
a complete path for the configuration file given as an argument
Exceptions
MISSING-FILEthe given file cannot be located

◆ getConnectionProvider()

Connections OMQ::QorusClientAPI::getConnectionProvider ( string  type)

returns the connection provider object

Parameters
typeone of remote, connection, or datasource
Returns
the connection provider object corresponding to the argument
Exceptions
INVALID-CONNECTION-PROVIDERinvalid connection provider type
Since
Qorus 4.1.1

◆ getDatasource()

synchronized Datasource OMQ::QorusClientAPI::getDatasource ( string  name)

returns a Datasource object for the given string if defined in Datasource Connections

Example:
Datasource app2 = omqclient.getDatasource("app2");

An exception is thrown if the datasource is not known. The same Datasource object will always be returned from this method.

Parameters
namethe name of the datasource to retrieve
Returns
the Datasource object for the given string
Exceptions
INVALID-DATASOURCEunknown datasource
See also
QorusClientAPI::getNewDatasource()

◆ getDatasourceConnectionsAsHash()

*hash< string, string > OMQ::QorusClientAPI::getDatasourceConnectionsAsHash ( )

returns a hash of datasource connections; keys are datasource names, values are connection strings

Returns
a hash of datasource connections; keys are datasource names, values are connection strings
Since
Qorus 4.1

◆ getDatasourceConnectionString()

string OMQ::QorusClientAPI::getDatasourceConnectionString ( string  name)

returns the datasource connection string for the given datasource if defined in Datasource Connections

Example:
string connstr = omqclient.getDatasourceConnectionString("app2");

An exception is thrown if the datasource is not known

Parameters
namethe name of the datasource to retrieve
Returns
the datasource connection string for the given datasource
Exceptions
INVALID-DATASOURCEunknown datasource
See also
QorusClientAPI::getDatasource()
Since
Qorus 3.1.1

◆ getDatasourcePool()

synchronized DatasourcePool OMQ::QorusClientAPI::getDatasourcePool ( string  name,
int  min = 0,
int  max = 0 
)

returns a DatasourcePool object for the given string if defined in Datasource Connections

An exception is thrown if the datasource is not known. The same DatasourcePool object will always be returned from this method.

Parameters
namethe name of the datasource to use as a basis for creating the DatasourcePool object
minoverride the minimum connection setting
maxoverride the maximum connection setting
Returns
the DatasourcePool object for the given string
See also
QorusClientAPI::getNewDatasourcePool()
Example:
DatasourcePool app2p = omqclient.getDatasourcePool("app2");

◆ getLocalSystemAuthToken()

string OMQ::QorusClientAPI::getLocalSystemAuthToken ( *timeout  expiry)

Returns a token with internal system authentication for use with REST clients or throws an exception.

Parameters
expirythe optional expoiration period for the token (default = 10 minutes)
Returns
a token with internal system authentication for use with REST clients
Exceptions
QORUS-DOWNno token can be returned; Qorus is down
Since
Qorus 5.1.1

◆ getNewDatasource()

Datasource OMQ::QorusClientAPI::getNewDatasource ( string  name)

returns a new Datasource object for the given string if defined in Datasource Connections

Example:
Datasource app2 = omqclient.getNewDatasource("app2");

An exception is thrown if the datasource is not known

Parameters
namethe name of the datasource to retrieve
Returns
the Datasource object for the given string
Exceptions
INVALID-DATASOURCEunknown datasource
See also
QorusClientAPI::getDatasource()

◆ getNewDatasourcePool()

DatasourcePool OMQ::QorusClientAPI::getNewDatasourcePool ( string  name,
softint  min = 0,
softint  max = 0 
)

returns a new DatasourcePool object for the given string if defined in Datasource Connections

an exception is thrown if the datasource is not known

Parameters
namethe name of the datasource to use as a basis for creating the DatasourcePool object
minthe minumum number of connections to open when the object is created
maxthe maximum number of connections to manage; not more than these connections will be opened
Returns
the Datasource object for the given string
See also
QorusClientAPI::getDatasourcePool()
Example:
DatasourcePool app2p = omqclient.getNewDatasourcePool("app2");

◆ getOptionFileName()

string OMQ::QorusClientAPI::getOptionFileName ( )

returns the options file name

Returns
the options file name

◆ getOptions() [1/2]

hash< auto > OMQ::QorusClientAPI::getOptions ( )
private:internal

returns the options from all domains as a hash of hashes

the top-level hash keys are the domain names

Returns
the options from all domains as a hash of hashes

◆ getOptions() [2/2]

hash< auto > OMQ::QorusClientAPI::getOptions ( string  domain)
private:internal

returns the options from the given domain as a hash

an empty hash is returned for domains not present in the options file

Parameters
domainthe option domain to return
Returns
the options from the given domain as a hash

◆ getRemote()

OMQ::Client::QorusSystemAPIHelper OMQ::QorusClientAPI::getRemote ( string  name)

gets a remote connection based on connection parameters parsed in the Qorus to Qorus Connections

Parameters
namea string key/name of the remote instance
Returns
OMQ::Client::QorusSystemAPIHelper instance; see OMQ::QorusSystemAPIHelperBase for the full API
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections configuration or malformed syntax
GET-REMOTE-ERRORrequested connection is not defined

◆ getRemoteConfig() [1/2]

hash< auto > OMQ::QorusClientAPI::getRemoteConfig ( string  name,
bool  with_password = True 
)

returns a hash with connection parameters for a remote Qorus server based on connection parameters parsed in the Qorus to Qorus Connections

Parameters
namea string key/name of the remote instance
with_passwordif True then the password is also returned
Returns
a hash with connection parameters
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections configuration or malformed syntax
CONNECTION-ERRORrequested connection is not defined

◆ getRemoteConfig() [2/2]

hash< auto > OMQ::QorusClientAPI::getRemoteConfig ( string  name,
hash< auto >  opts 
)

returns a hash with connection parameters for a remote Qorus server based on connection parameters parsed in the Qorus to Qorus Connections

Parameters
namea string key/name of the remote instance
optsconnection information options; options are connection-specific; the only universal option is with_passwords: if True, then passwords are returned in the info hash
Returns
a hash with connection parameters
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections configuration or malformed syntax
CONNECTION-ERRORrequested connection is not defined

◆ getRemoteConnectionObject()

ConnectionProvider::AbstractConnection OMQ::QorusClientAPI::getRemoteConnectionObject ( string  name)

returns a ConnectionProvider::AbstractConnection object for the given remote connection

Example:
ConnectionProvider::AbstractConnection conn = omqclient.getRemoteConnectionObject(conn);
Parameters
namethe name of the remote connection
Returns
a ConnectionProvider::AbstractConnection object for the given remote connection; if the connection is invalid or unknown, an exception is thrown
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections config file or malformed syntax
GET-REMOTE-ERRORrequested connection is not defined
Since
Qorus 3.1.1

◆ getRemoteInfo() [1/2]

*hash< auto > OMQ::QorusClientAPI::getRemoteInfo ( )

returns a hash of remote connections keyed by remote connection name or NOTHING if no remote connections are defined

Example:
*hash h = omqclient.getRemoteInfo();
Returns
a hash of remote connections keyed by remote connection name or NOTHING if no remote connections are defined; hash values correspond to the return value of ConnectionProvider::AbstractConnection::getInfo()
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections config file or malformed syntax
Since
Qorus 3.1.1

◆ getRemoteInfo() [2/2]

hash OMQ::QorusClientAPI::getRemoteInfo ( string  name)

returns a hash of the given remote connection

Example:
hash h = omqclient.getRemoteInfo(conn);
Parameters
namethe name of the remote connection
Returns
a hash of the given remote connection; the return value corresponds to the return value of ConnectionProvider::AbstractConnection::getInfo(); if the connection is invalid or unknown, an exception is thrown
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections configuration or malformed syntax
GET-REMOTE-ERRORrequested connection is not defined
Since
Qorus 3.1.1

◆ getRemoteRest()

OMQ::Client::QorusSystemRestHelper OMQ::QorusClientAPI::getRemoteRest ( string  name,
bool  connect = True 
)

returns a connection for RESTful communication with a remote Qorus server based on connection parameters parsed in the Qorus to Qorus Connections

Parameters
namea string key/name of the remote instance
connectif False, then the object will be created in an unconnected state
Returns
OMQ::Client::QorusSystemRestHelper instance; see OMQ::QorusSystemRestHelperBase for the full API
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections configuration or malformed syntax
GET-REMOTE-ERRORrequested connection is not defined

◆ getRemoteUrl()

string OMQ::QorusClientAPI::getRemoteUrl ( string  name)

returns the URL for a Qorus remote connection from the connection name

Example:
string url = omqclient.getRemoteUrl(conn);
Parameters
namethe name of the remote connection
Returns
the URL for the connection
Exceptions
REMOTE-LOAD-ERRORMissing Qorus to Qorus Connections configuration or malformed syntax
GET-REMOTE-ERRORrequested connection is not defined
Since
Qorus 3.1.1

◆ getSQLIF() [1/3]

SQLInterface OMQ::QorusClientAPI::getSQLIF ( )
private:internal

returns an SQLInterface object using the system DatasourcePool object

Returns
an SQLInterface object using the system DatasourcePool object for the system schema "omq" datasource

◆ getSQLIF() [2/3]

SQLInterface OMQ::QorusClientAPI::getSQLIF ( DatasourcePool  dsp)
private:internal

returns an SQLInterface object using the DatasourcePool object given as an argument

Parameters
dspthe DatasourcePool to use for the SQLInteterface object
Returns
an SQLInterface object using the given DatasourcePool object

◆ getSQLIF() [3/3]

SQLInterface OMQ::QorusClientAPI::getSQLIF ( string  dsn)
private:internal

returns an SQLInterface object using a DatasourcePool object for the datasource given as an argument

Parameters
dsnthe name of the datasource to use for the SQLInteterface object
Returns
an SQLInterface object using the system DatasourcePool object for the given datasource

◆ getUserConnection()

object OMQ::QorusClientAPI::getUserConnection ( string  name,
bool  connect = True,
*hash  rtopts 
)

Returns an object corresponding to a defined user connection.

Example:
FtpClient ftp = omqclient.getUserConnection(name, False);
Parameters
namethe name of the connection
connectif False an unconnected object will be returned, otherwise the object is already connected
rtoptsany runtime options accepted by the connection
Returns
the object representing the connection
Exceptions
CONNECTION-ERRORThe given connection is not known
See also
OMQ::Client::get_user_connection()
Since
Qorus 3.1.0

◆ getUserConnectionInfo() [1/2]

*hash< auto > OMQ::QorusClientAPI::getUserConnectionInfo ( )

Returns a hash describing all defined user connections or NOTHING if no user connections are defined.

Example:
*hash<auto> h = omqclient.getUserConnectionInfo();
Returns
a hash describing all defined user connections or NOTHING if no user connections are defined; keys are user connection names; hash values correspond to the return value of ConnectionProvider::AbstractConnection::getInfo()
Note
connection-specific exceptions could be thrown initializing connections
Since
Qorus 3.1.1

◆ getUserConnectionInfo() [2/2]

synchronized hash OMQ::QorusClientAPI::getUserConnectionInfo ( string  name)

Returns a hash describing the given user connection.

Example:
hash h = omqclient.getUserConnectionInfo(name);
Parameters
namethe name of the connection
Returns
a hash describing the given user connections; the return value corresponds to the return value of ConnectionProvider::AbstractConnection::getInfo(); if the connection is invalid or unknown an exception is thrown
Exceptions
CONNECTION-ERRORThe given connection is invalid or unknown
Note
connection-specific exceptions could be thrown initializing connections
Since
Qorus 3.1.1

◆ getUserConnectionObject()

ConnectionProvider::AbstractConnection OMQ::QorusClientAPI::getUserConnectionObject ( string  name)

Returns a ConnectionProvider::AbstractConnection object corresponding to a defined user connection.

Example:
ConnectionProvider::AbstractConnection conn = omqclient.getUserConnectionObject(name);
Parameters
namethe name of the connection
Returns
the ConnectionProvider::AbstractConnection object representing the connection
Exceptions
CONNECTION-ERRORThe given connection is not known
Since
Qorus 3.1.1

◆ getUserConnections()

*hash< string, AbstractConnection > OMQ::QorusClientAPI::getUserConnections ( )

Returns a hash describing all defined user connections or NOTHING if no user connections are defined.

Example:
*hash<string, AbstractConnection> h = omqclient.getUserConnections();
Returns
a hash of all defined user connections or NOTHING if no user connections are defined; keys are user connection names; values AbstractConnection objects
Note
connection-specific exceptions could be thrown initializing connections
Since
Qorus 3.1.1.p4

◆ getUserConnectionUrl()

string OMQ::QorusClientAPI::getUserConnectionUrl ( string  name)

Returns the URL corresponding to a defined user connection.

Example:
string url = omqclient.getUserConnectionUrl(name);
Parameters
namethe name of the connection
Returns
the URL string for the connection
Exceptions
CONNECTION-ERRORThe given connection is invalid or unknown
Note
other connection-specific exceptions could be thrown initializing connections
Since
Qorus 3.1.1

◆ getWorkflowInfoID()

hash< auto > OMQ::QorusClientAPI::getWorkflowInfoID ( softint  wfid)

returns a hash of information about the given workflow based on the workflowid passed

an exception is thrown if the workflowid is invalid

Parameters
wfidthe workflowid of the workflow
Returns
a hash of workflow information including "keylist": a list of valid workflow keys
See also
QorusClientAPI::getWorkflowInfoName()

◆ getWorkflowInfoName()

hash< auto > OMQ::QorusClientAPI::getWorkflowInfoName ( string  name,
string  version 
)

returns a hash of information about the given workflow based on the workflow name and version passed

an exception is thrown if the workflow name and version are invalid

Parameters
namethe name the workflow
versionthe name the workflow
Returns
a hash of workflow information including "keylist": a list of valid workflow keys
See also
QorusClientAPI::getWorkflowInfoID()

◆ initSystemDatasources()

OMQ::QorusClientAPI::initSystemDatasources ( )
private:internal

initializes the system Datasource and DatasourcePool objects

This method is automatically called from other methods of this class when needed. This method is safe to call multiple times (also from multiple threads); if the system Datasource objects have already been initialized, then the method returns immediately

◆ isLSB()

bool OMQ::QorusClientAPI::isLSB ( )

returns True if the installation is an LSB installation, False if not

Returns
True if the installation is an LSB installation, False if not

◆ parse_ds()

static hash< auto > OMQ::QorusClientAPI::parse_ds ( string  str)
static

parses a datasource string and returns the hash

an exception will be thrown if no driver name is given

◆ parseOptionsFile()

static hash OMQ::QorusClientAPI::parseOptionsFile ( string  fn)
static

parses the given file as a Qorus option file and returns a hash

returns a hash of the option information, keyed by "domain" (i.e. qorus, qorus-client); the return hash only has the option data that is set in the file; no options are derived or automatically set by this function

Parameters
fnthe file name of the options file to parse
Returns
a hash of the options keyed by "domain" (i.e. qorus, qorus-client)

◆ parseToQoreValue()

static auto OMQ::QorusClientAPI::parseToQoreValue ( string  arg)
static

tries to convert a string (such as an argument given from the command-line) to a Qore value

This method recognizes two special prefixes in the string:

  • STR= this prefix indicates that the rest of the string should be passed literally and not parsed
  • EVAL= this prefix indicates that the rest of the string should be taken as a Qore expression and executed and the value returned
Parameters
arga string to convert to a Qore value
Returns
the Qore value corresponding to the input string
Note
reexported from the Util module

◆ reloadUserConnections()

OMQ::QorusClientAPI::reloadUserConnections ( )

reloads user connections from the DB on the next request for a user connection

Since
Qorus 3.1.1.p11

◆ setDatasourceFromText()

OMQ::QorusClientAPI::setDatasourceFromText ( string  line)

this method allows a datasource to be created or redefined from the text passed

Example:
omqclient.setDatasourceFromText("omq=driver:user/pass@db%host:port");
Parameters
linethe datasource text to use to create or redefine a datasource (ex: dsname=driver:user/pass@dbnamehost:port)

◆ tryGetLocalSystemAuthToken()

*string OMQ::QorusClientAPI::tryGetLocalSystemAuthToken ( *timeout  expiry)

Returns a token with internal system authentication for use with REST clients if possible.

Since
Qorus 5.1.1

◆ updateOptionValue()

OMQ::QorusClientAPI::updateOptionValue ( string  domain,
string  option,
auto  value 
)

Update internal option value.

To be used when the option file itself is updated


The documentation for this class was generated from the following file: