XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/scheduler

java:org.exist.xquery.modules.scheduler.SchedulerModule

A module for scheduling jobs using the Quartz Scheduler

scheduler:delete-scheduled-job

scheduler:delete-scheduled-job($job-name as xs:string) as xs:boolean

Delete the named job named from the Scheduler. Will only delete User Scheduled Jobs! Returns true if the Job was deleted.

Parameters:
$job-name The name of the job to be deleted
Returns:
xs:boolean : a boolean value indicating success or failure on deleting the named job.

scheduler:get-scheduled-jobs

scheduler:get-scheduled-jobs() as node()

Gets the details of all scheduled jobs in the form: <scheduler:jobs xmlns:scheduler="http://exist-db.org/xquery/scheduler" count="iJobs"> <scheduler:group name="group"> <scheduler:job name=""> <scheduler:trigger name=""> <expression></expression> <state></state> <start></start> <end></end> <previous></previous> <next></next> <final></final> </scheduler:trigger> </scheduler:job> </scheduler:group></scheduler:jobs>

Returns:
node() : the XML containing the list of jobs

scheduler:pause-scheduled-job

scheduler:pause-scheduled-job($job-name as xs:string) as xs:boolean

Pause the named job in the scheduler. Will only pause user scheduled jobs!

Parameters:
$job-name The name of the job in the scheduler
Returns:
xs:boolean : the success of the pausing of the named job

scheduler:resume-scheduled-job

scheduler:resume-scheduled-job($job-name as xs:string) as xs:boolean

Resumes the named job in the scheduler. Will only resume user scheduled jobs!

Parameters:
$job-name The name of the job to resume.
Returns:
xs:boolean : the indicator of successful resumption

scheduler:schedule-java-cron-job

scheduler:schedule-java-cron-job($java-classname as xs:string, $cron-expression as xs:string, $job-name as xs:string) as xs:boolean

Schedules the Java Class named (the class must extend org.exist.scheduler.UserJavaJob) according to the Cron expression. The job will be registered using the job name.

Parameters:
$java-classname The full name of the class to be executed. It must extend the org.exist.scheduler.UserJavaJob class.
$cron-expression The cron expression. Please see the scheduler documentation.
$job-name The name of the job.
Returns:
xs:boolean : a flag indicating successful execution

scheduler:schedule-java-cron-job

scheduler:schedule-java-cron-job($java-classname as xs:string, $cron-expression as xs:string, $job-name as xs:string, $job-parameters as element()?) as xs:boolean

Schedules the Java Class named (the class must extend org.exist.scheduler.UserJavaJob) according to the Cron expression. The job will be registered using the name passed in $job-name. The final argument can be used to specify parameters for the job, which will be passed to the query as external variables. Parameters are specified in an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>.

Parameters:
$java-classname The full name of the class to be executed. It must extend the org.exist.scheduler.UserJavaJob class.
$cron-expression The cron expression. Please see the scheduler documentation.
$job-name The name of the job.
$job-parameters? The XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
Returns:
xs:boolean : a flag indicating successful execution

scheduler:schedule-java-periodic-job

scheduler:schedule-java-periodic-job($java-classname as xs:string, $period as xs:integer, $job-name as xs:string, $job-parameters as element()?, $delay as xs:integer, $repeat as xs:integer) as xs:boolean

Schedules the Java Class named (the class must extend org.exist.scheduler.UserJavaJob) according to the periodic value. The job will be registered using the job name. The $job-parameters argument can be used to specify parameters for the job, which will be passed to the query as external variables. Parameters are specified in an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>, Given the delay and the repeat.

Parameters:
$java-classname The full name of the class to be executed. It must extend the org.exist.scheduler.UserJavaJob class.
$period Time in milliseconds between execution of the job
$job-name The name of the job.
$job-parameters? The XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
$delay The period in milliseconds to delay the start of a job.
$repeat The number of times to repeat the job after the initial execution. A value of -1 means repeat forever.
Returns:
xs:boolean : a flag indicating successful execution

scheduler:schedule-xquery-cron-job

scheduler:schedule-xquery-cron-job($xquery-resource as xs:string, $cron-expression as xs:string, $job-name as xs:string) as xs:boolean

Schedules the named XQuery resource (e.g. /db/foo.xql) according to the Cron expression. XQuery job's will be launched under the guest account initially, although the running XQuery may switch permissions through calls to xmldb:login(). The job will be registered using the job name. Jobs submitted via this function are transitory and will be lost on a server restart. To ensure the persistence of scheduled tasks add them to the conf.xml file.

Parameters:
$xquery-resource The path to the XQuery resource
$cron-expression The cron expression. Please see the scheduler documentation.
$job-name The name of the job.
Returns:
xs:boolean : a flag indicating successful execution

scheduler:schedule-xquery-cron-job

scheduler:schedule-xquery-cron-job($xquery-resource as xs:string, $cron-expression as xs:string, $job-name as xs:string, $job-parameters as element()?) as xs:boolean

Schedules the named XQuery resource (e.g. /db/foo.xql) according to the Cron expression. XQuery job's will be launched under the guest account initially, although the running XQuery may switch permissions through calls to xmldb:login(). The job will be registered using the job name. The final argument can be used to specify parameters for the job, which will be passed to the query as external variables. Parameters are specified in an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters> Jobs submitted via this function are transitory and will be lost on a server restart. To ensure the persistence of scheduled tasks add them to the conf.xml file.

Parameters:
$xquery-resource The path to the XQuery resource
$cron-expression A cron expression. Please see the scheduler documentation.
$job-name The name of the job.
$job-parameters? XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
Returns:
xs:boolean : Flag indicating successful execution

scheduler:schedule-xquery-cron-job

scheduler:schedule-xquery-cron-job($xquery-resource as xs:string, $cron-expression as xs:string, $job-name as xs:string, $job-parameters as element()?, $unschedule as xs:boolean) as xs:boolean

Schedules the named XQuery resource (e.g. /db/foo.xql) according to the Cron expression. XQuery job's will be launched under the guest account initially, although the running XQuery may switch permissions through calls to xmldb:login(). The job will be registered using the job name. The job parameters argument can be used to specify parameters for the job, which will be passed to the query as external variables. Parameters are specified in an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters> Jobs submitted via this function are transitory and will be lost on a server restart. To ensure the persistence of scheduled tasks add them to the conf.xml file.

Parameters:
$xquery-resource The path to the XQuery resource
$cron-expression A cron expression. Please see the scheduler documentation.
$job-name The name of the job.
$job-parameters? XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
$unschedule Specifies whether to unschedule this job if an XPathException is raised, default is true.
Returns:
xs:boolean : Flag indicating successful execution

scheduler:schedule-xquery-periodic-job

scheduler:schedule-xquery-periodic-job($xquery-resource as xs:string, $period as xs:integer, $job-name as xs:string, $job-parameters as element()?, $delay as xs:integer, $repeat as xs:integer) as xs:boolean

Schedules the named XQuery resource (e.g. /db/foo.xql) according to the period. XQuery job's will be launched under the guest account initially, although the running XQuery may switch permissions through calls to xmldb:login(). The job will be registered using the job name. The job parameters argument can be used to specify parameters for the job, which will be passed to the query as external variables. Parameters are specified in an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>, Given the delay passed and the repeat value. Jobs submitted via this function are transitory and will be lost on a server restart. To ensure the persistence of scheduled tasks add them to the conf.xml file.

Parameters:
$xquery-resource The path to the XQuery resource
$period Time in milliseconds between execution of the job
$job-name The name of the job.
$job-parameters? XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
$delay Can be used with a period in milliseconds to delay the start of a job.
$repeat Number of times to repeat the job after the initial execution. A value of -1 means repeat forever.
Returns:
xs:boolean : Flag indicating successful execution

scheduler:schedule-xquery-periodic-job

scheduler:schedule-xquery-periodic-job($xquery-resource as xs:string, $period as xs:integer, $job-name as xs:string, $job-parameters as element()?, $delay as xs:integer, $repeat as xs:integer, $unschedule as xs:boolean) as xs:boolean

Schedules the named XQuery resource (e.g. /db/foo.xql) according to the period. XQuery job's will be launched under the guest account initially, although the running XQuery may switch permissions through calls to xmldb:login(). The job will be registered using the job name. The job parameters argument can be used to specify parameters for the job, which will be passed to the query as external variables. Parameters are specified in an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>, Given the delay passed and the repeat value. Jobs submitted via this function are transitory and will be lost on a server restart. To ensure the persistence of scheduled tasks add them to the conf.xml file.

Parameters:
$xquery-resource The path to the XQuery resource
$period Time in milliseconds between execution of the job
$job-name The name of the job.
$job-parameters? XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
$delay Can be used with a period in milliseconds to delay the start of a job.
$repeat Number of times to repeat the job after the initial execution. A value of -1 means repeat forever.
$unschedule Specifies whether to unschedule this job if an XPathException is raised, default is true.
Returns:
xs:boolean : Flag indicating successful execution