![]() |
Qorus Integration Engine®
4.0.3.p2_git
|
Each job's Program container is set up with the following imported objects:
In addition to the above, all public constants in the OMQ namespace are available.
The job class APIs are documented here:
For class-based jobs, the job's implementation class must inherit Job::QorusJob (Qore) or job.QorusJob (Java) directly. This means that Qore code can call the static methods defined in the base class directly.
For library classes and other job code, calls must be prefixed with the class name (also for all Java code as well).
Each job has a single Qore Program object containing the code to be defined when the job trigger time arrives, as well as any objects imported into the Program object (classes, constants, and functions listed as attributes of the job when the job is defined). Job Program objects are restricted from using elements of the Qore language related to process and thread control; the use of these functions is either dangerous or could violate the integrity of the Qorus server process and therefore is restricted.
To enforce these restrictions, job Program objects are created with the following parse restrictions:
Directive | Constant | Description |
%no-top-level | Qore::PO_NO_TOP_LEVEL_STATEMENTS | No code is allowed in the top-level statement (outside a function or class) |
%no-thread-control | Qore::PO_NO_THREAD_CONTROL | Thread management functionality is unavailable |
%no-process-control | Qore::PO_NO_PROCESS_CONTROL | Functionality that affects the entire process is unavailable |
%require-our | Qore::PO_REQUIRE_OUR | All variables must be declared before use |
Please note that despite these restrictions, job program objects have most of the Qore language API and class library available for use.
Furthermore, the following parse defines are defined:
Define | Availability | Description |
Qorus | W , S , J | Identifies code in Qorus |
QorusHasAlerts | W , S , J | Marks the availability of the alert API (Qorus 3.0+) |
QorusHasTableCache | W , S , J | Marks the availability of the table cache API (Qorus 3.1+) |
QorusHasUserConnections | W , S , J | Marks the availability of the connection API (Qorus 3.0+) |
QorusJob | S | Identifies code used in a job Program container |
QorusServer | W , S , J | Identifies code used in Qorus server interfaces |
The following APIs are imported into job program logic containers (see also JobApi and OMQ::UserApi::Job):
The following classes are imported into job program logic containers:
Qore Class | Java Class | Availability | Description |
AbstractFsRemoteReceive | AbstractFsRemoteReceive | W , S , J | provides an API for streaming data from a remote filesystem through a remote Qorus instance |
AbstractParallelStream | n/a | W , S , J | provides an abstract base class for streaming data to or from a remote database through a remote Qorus instance and also provides static helper methods |
DbRemote | DbRemote | W , S , J | provides an API wrapper for all system.sqlutil service methods |
DbRemoteReceive | DbRemoteReceive | W , S , J | provides an API for streaming data from a remote database through a remote Qorus instance |
DbRemoteSend | DbRemoteSend | W , S , J | provides an API for streaming data to a remote database through a remote Qorus instance |
FsRemote | FsRemote | W , S , J | provides an API wrapper for all system.fs service methods |
FsRemoteSend | FsRemoteSend | W , S , J | provides an API for streaming data to a remote filesystem through a remote Qorus instance |
JobApi | JobApi | J | the primary job API class |
QorusInboundTableMapper | InboundTableMapper | W , S , J | provides an API for mapping data to a DB table |
QorusInboundTableMapperIterator | n/a | W , S , J | provides an iterator-based API for mapping data to a DB table |
QorusRawSqlStatementOutboundMapper | RawSqlStatementOutboundMapper | W , S , J | provides an API for mapping from SQL statement using direct SQL statements passed in |
QorusRemoteServiceHelper | n/a | W , S , J | provides an API for calling service methods in remote Qorus instances |
QorusSqlStatementOutboundMapper | SqlStatementOutboundMapper | W , S , J | provides an API for mapping from SQL statement using SqlUtil |
QorusSystemAPIHelper | n/a | W , S , J | provides an API for calling RPC API methods in remote Qorus instances |
OMQ::QorusSystemRestHelper | QorusSystemRestHelper | W , S , J | provides an API for using the REST API in remote Qorus instances |
UserApi | UserApi | W , S , J | the primary shared Qorus API class |
The following modules are imported by default into job program logic containers:
Name | Availability | Description |
json | W , S , J | provides APIs for JSON data serialization and deserialization support |
Mime | W , S , J | provides MIME definitions and functionality |
Mapper | W , S , J | provides a data-mapping API |
SoapClient | W , S , J | provides a SOAP client API |
SqlUtil | W , S , J | provides high-level APIs for programmatic DML (SQL data manipulation), DDL (creating, querying, manipulating database definitions), and DBA operations |
TableMapper | W , S , J | provides high-level APIs for mapping data to and from database tables |
Util | W , S , J | provides utility APIs |
uuid | W , S , J | provides an API for generating UUIDs |
xml | W , S , J | provides APIs for parsing, validating, and generating XML documents |
yaml | W , S , J | provides APIs for Qore's YAML-based data serialization and deserialization support |
This section lists all of the API methods specific to jobs; the main job API classes are:
"job_"
.Job logging APIs:
Qore Method | Java Method | Qore Function | Description |
JobApi::err() | JobApi.err() | job_err() | raises job errors with mandatory error and description string arguments |
JobApi::errWithInfo() | JobApi.errWithInfo() | job_error() | raises job errors |
JobApi::getStateData() | JobApi.getStateData() | job_get_state_data() | retrieves job state data if available |
JobApi::getInfo() | JobApi.getInfo() | job_info() | retrieves information about the currently-executing job |
JobApi::saveInfo() | JobApi.saveInfo() | job_save_info() | saves information about job processing agaainst the job instance record |
JobApi::saveStateData() | JobApi.saveStateData() | job_save_state_data() | saves job state data against the current job instance |
JobApi::setTrigger() | JobApi.setTrigger() | job_set_trigger() | sets a custom trigger time for the next job instance |
JobApi::warnWithInfo() | JobApi.warnWithInfo() | job_warning() | raises job warnings |