Qorus Integration Engine®  4.1.4.p2_git
datasource Class Reference

the main datasource service class More...

Inherits QorusSystemService.

Public Member Methods

 reload ()
 DEPRECATED: refresh datasources. More...
 

Static Public Member Methods

static deprecated Datasource get (string name)
 DEPRECATED: gets a shared datasource object with autocommit turn on. More...
 
static deprecated DatasourcePool getUnique (string name)
 DEPRECATED: gets a DatasourcePool object, suitable for transaction management with short transactions. More...
 
static deprecated DatasourcePool getPool (string name)
 DEPRECATED: gets a DatasourcePool object, suitable for transaction management with short transactions. More...
 
static deprecated Datasource getDedicated (string name)
 DEPRECATED: gets a new, dedicated Datasource object, suitable for transaction management for long-running transactions. More...
 
static deprecated nothing update_hash (string name, hash h)
 DEPRECATED: adds or updates an existing datasource entry, params: name, hash (like that returned by parse_datasource()) More...
 
static deprecated nothing update_string (string name, string desc)
 DEPRECATED: adds or updates an existing datasource entry, params: string(name), string(description that can be parsed by parse_datasource()) More...
 
static deprecated nothing update (string name, string type, string user, string pass, string db, *string charset, *string host, *softint port, softint min=0, softint max=0, *hash opts)
 DEPRECATED: adds or updates an existing datasource entry, params: name, type, user, pass, dbname[, charset, host, port, min, max]. More...
 
static deprecated hash showDefaults ()
 DEPRECATED: shows currently-cached datasource parameters (without passwords) More...
 
static deprecated hash showDefaultsWithPasswords ()
 DEPRECATED: shows currently-cached datasource parameters (with passwords) More...
 
static deprecated nothing reset (string name)
 DEPRECATED: resets a datasource; any new requests for instances of this datasource will result in a new datasource or datasource pool being opened, params: name. More...
 
static deprecated auto select (string name, string sql)
 DEPRECATED: synonym for selectRow(); use selectRow() instead. More...
 
static deprecated auto selectRow (string name, string sql)
 DEPRECATED: runs a test 'selectRow' on the datasource. More...
 
static deprecated nothing flushToFile (*hash optHash)
 DEPRECATED: write current datasources into file; accepts an optional hash parameter with datasource information, if it's NOTHING, currently set datasources are used. More...
 
static deprecated string get_desc (string name)
 DEPRECATED: returns a datasource description string for the given datasource, if known, otherwise throws an exception. More...
 

Detailed Description

the main datasource service class

Member Function Documentation

◆ flushToFile()

static deprecated nothing datasource::flushToFile ( *hash  optHash)
inlinestatic

DEPRECATED: write current datasources into file; accepts an optional hash parameter with datasource information, if it's NOTHING, currently set datasources are used.

Parameters
optHashan optional hash parameter with datasource information, if not included in the call, currently set datasources are used
Exceptions
DATASOURCE-ERRORerror saving file
Deprecated:
use PUT /api/latest/remote/datasources?action=flush instead
Note
- lock: OMQ::SLRead
- write: True (external calls require OMQ::QR_CALL_SYSTEM_SERVICES_RW)

◆ get()

static deprecated Datasource datasource::get ( string  name)
inlinestatic

DEPRECATED: gets a shared datasource object with autocommit turn on.

it is an error to close or delete the Datasource returned by this method or to turn off the autocommit status

Parameters
namethe name of the datasource
Returns
a shared Datasource object with autocommit turn on
Exceptions
DATASOURCE-SERVICE-EXCEPTIONunknown or system datasource
See also
getDedicated()
getPool()
Deprecated:
use get_datasource_pool() instead; the concept of datasources with auto-commit enabled is deprecated in Qorus
Note
- internal: True (this method can only be called internally)

◆ get_desc()

static deprecated string datasource::get_desc ( string  name)
inlinestatic

DEPRECATED: returns a datasource description string for the given datasource, if known, otherwise throws an exception.

Parameters
namethe name of the datasource
Returns
datasource description string for the given datasource, if known, otherwise throws an exception
Exceptions
DATASOURCE-ERRORunknown datasource
Deprecated:
use get_datasource_info() or GET /api/latest/remote/datasources/{name} instead

◆ getDedicated()

static deprecated Datasource datasource::getDedicated ( string  name)
inlinestatic

DEPRECATED: gets a new, dedicated Datasource object, suitable for transaction management for long-running transactions.

Parameters
namethe name of the datasource
Returns
a new, dedicated Datasource object, suitable for transaction management for long-running transactions
Exceptions
DATASOURCE-ERRORunknown or system datasource
See also
getPool()
get()
Deprecated:
use get_datasource_dedicated() instead
Note
- internal: True (this method can only be called internally)

◆ getPool()

static deprecated DatasourcePool datasource::getPool ( string  name)
inlinestatic

DEPRECATED: gets a DatasourcePool object, suitable for transaction management with short transactions.

Parameters
namethe name of the datasource
Returns
a DatasourcePool object, suitable for transaction management with short transactions
Exceptions
DATASOURCE-ERRORunknown or system datasource
See also
getDedicated()
get()
Deprecated:
use get_datasource_pool() instead
Note
- internal: True (this method can only be called internally)

◆ getUnique()

static deprecated DatasourcePool datasource::getUnique ( string  name)
inlinestatic

DEPRECATED: gets a DatasourcePool object, suitable for transaction management with short transactions.

Parameters
namethe name of the datasource
Returns
a DatasourcePool object, suitable for transaction management with short transactions
See also
getPool()
Deprecated:
use get_datasource_pool() instead
Note
- internal: True (this method can only be called internally)

◆ reload()

datasource::reload ( )
inline

DEPRECATED: refresh datasources.

It is necessary to call this method (or reset the service) to re-read the configuration file

Exceptions
FILELINEITERATOR-OPEN-ERRORerror opening configuration file

◆ reset()

static deprecated nothing datasource::reset ( string  name)
inlinestatic

DEPRECATED: resets a datasource; any new requests for instances of this datasource will result in a new datasource or datasource pool being opened, params: name.

Parameters
namethe name of the datasource to reset
Exceptions
DATASOURCE-ERRORunknown or system datasource
Deprecated:
use PUT /api/latest/remote/datasources/{name}?action=reset instead

◆ select()

static deprecated auto datasource::select ( string  name,
string  sql 
)
inlinestatic

DEPRECATED: synonym for selectRow(); use selectRow() instead.

Parameters
namethe name of the datasource to execute the select on
sqlthe SQL string to execute
Returns
the result of executing Datasource::selectRow() with the given arguments
Exceptions
DATASOURCE-ERRORunknown or system datasource
Deprecated:
use select methods in the system.sqlutil service instead

◆ selectRow()

static deprecated auto datasource::selectRow ( string  name,
string  sql 
)
inlinestatic

DEPRECATED: runs a test 'selectRow' on the datasource.

Parameters
namethe name of the datasource to execute the select on
sqlthe SQL string to execute
Returns
the result of executing Datasource::selectRow() with the given arguments
Exceptions
DATASOURCE-ERRORunknown or system datasource
Deprecated:
use select methods in the system.sqlutil service instead

◆ showDefaults()

static deprecated hash datasource::showDefaults ( )
inlinestatic

DEPRECATED: shows currently-cached datasource parameters (without passwords)

Returns
a hash of datasource information, each hash value is a hash with the following possible keys (not all keys may be set on all datasources):
  • type: the driver name for the datasource
  • user: the username for the connection
  • charset: the database-specific character set name for the connection
  • db: the database name for the connection
  • host: the hostname for the connection
  • port: the port number for the connection
  • desc: a descriptive string for the connection
  • locked: True if the datasource is locked
  • options: a hash with the following 2 members: min and max
  • shared-pool: a string giving shared pool status (if any shared pool exists)
Deprecated:
use GET /api/remote/datasources instead

◆ showDefaultsWithPasswords()

static deprecated hash datasource::showDefaultsWithPasswords ( )
inlinestatic

DEPRECATED: shows currently-cached datasource parameters (with passwords)

Returns
a hash of datasource information, each hash value is a hash with the following possible keys (not all keys may be set on all datasources):
  • type: the driver name for the datasource
  • user: the username for the connection
  • password: the password for the connection
  • charset: the database-specific character set name for the connection
  • db: the database name for the connection
  • host: the hostname for the connection
  • port: the port number for the connection
  • desc: a descriptive string for the connection
  • locked: True if the datasource is locked
  • options: a hash with the following 2 members: min and max
  • shared-pool: a string giving shared pool status (if any shared pool exists)
Note
- requires role OMQ::QR_DATASOURCE_CONTROL
Deprecated:
use GET /api/remote/datasources instead
Note
- lock: OMQ::SLRead

◆ update()

static deprecated nothing datasource::update ( string  name,
string  type,
string  user,
string  pass,
string  db,
*string  charset,
*string  host,
*softint  port,
softint  min = 0,
softint  max = 0,
*hash  opts 
)
inlinestatic

DEPRECATED: adds or updates an existing datasource entry, params: name, type, user, pass, dbname[, charset, host, port, min, max].

Parameters
namethe name of the datasource to update or add
typethe name of the driver
userthe name of the user for connections based on this datasource
passthe password for connections based on this datasource
dbthe database name for connections based on this datasource
charsetthe database-specific character encoding for connections based on this datasource
hostthe optional hostname for new connections
portthe optional port number for new connections
minthe minimum number of connections for DatasourcePool objects created from this datasource
maxthe maximum number of connections for DatasourcePool objects created from this datasource
optsother driver options
Exceptions
DATASOURCE-SERVICE-EXCEPTIONunknown or system datasource
Note
Changing a datasource with this method is permanent
Deprecated:
use PUT /api/latest/remote/datasources/{name} instead

◆ update_hash()

static deprecated nothing datasource::update_hash ( string  name,
hash  h 
)
inlinestatic

DEPRECATED: adds or updates an existing datasource entry, params: name, hash (like that returned by parse_datasource())

Parameters
namethe name of the datasource to update or add
ha datasource hash like that returned by parse_datasource()
Exceptions
DATASOURCE-ERRORempty name string passed as an argument or tried to update a system datasource
Note
Changing a datasource with this method is permanent
Deprecated:
use PUT /api/latest/remote/datasources/{name} instead

◆ update_string()

static deprecated nothing datasource::update_string ( string  name,
string  desc 
)
inlinestatic

DEPRECATED: adds or updates an existing datasource entry, params: string(name), string(description that can be parsed by parse_datasource())

Parameters
namethe name of the datasource to update or add
desca datasource description string, like: driver:user/pass@db(encoding)%host:port{min=x,max=y}
Exceptions
DATASOURCE-SERVICE-EXCEPTIONunknown or system datasource
Note
Changing a datasource with this method is permanent
Deprecated:
use PUT /api/latest/remote/datasources/{name} instead

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