XQuery Function Documentation
http://exist-db.org/xquery/system
java:org.exist.xquery.functions.system.SystemModule
A module for retrieving information about eXist and the system.
system:as-user #3
system:as-user ($username as xs:string, $password as xs:string?, $code-block as item()*) as item()
A pseudo-function to execute a limited block of code as a different user. The first argument is the name of the user, the second is the password. If the user can be authenticated, the function will execute the code block given in the third argument with the permissions of that user andreturns the result of the execution. Before the function completes, it switches the current user back to the old user.
- Parameters:
$username The username of the user to run the code against $password The password of the user to run the code against $code-block The code block to run as the identified user - Returns:
- item()* : the results of the code block executed
system:clear-trace #0
system:clear-trace () as empty-sequence()
Clear the global trace log.
- Returns:
- empty-sequence()
system:clear-xquery-cache #0
system:clear-xquery-cache () as empty-sequence()
Clear XQuery cache.
- Returns:
- empty-sequence()
system:count-instances-active #0
system:count-instances-active () as xs:integer
Returns the number of eXist instances that are active.
- Returns:
- xs:integer : the count
system:count-instances-available #0
system:count-instances-available () as xs:integer
Returns the number of eXist instances that are available.
- Returns:
- xs:integer : the count
system:count-instances-max #0
system:count-instances-max () as xs:integer
Returns the maximum number of eXist instances.
- Returns:
- xs:integer : the count
system:enable-tracing #1
system:enable-tracing ($enable as xs:boolean) as empty-sequence()
Enable function tracing on the database instance.
- Parameters:
$enable The boolean flag to enable/disable function tracing - Returns:
- empty-sequence()
system:enable-tracing #2
system:enable-tracing ($enable as xs:boolean, $tracelog as xs:boolean) as empty-sequence()
Enable function tracing on the database instance.
- Parameters:
$enable The enable boolean flag to enable/disable function tracing $tracelog The tracelog boolean flag: if set to true, entering/exiting a function will be logged to the logger 'xquery.profiling' - Returns:
- empty-sequence()
system:export #3
system:export ($dir as xs:string, $incremental as xs:boolean?, $zip as xs:boolean?) as node()
Export a backup of the database (admin user only).
- Parameters:
$dir This is an absolute path to where the backup will be written. Must be writeable by the eXist process. $incremental Flag to do incremental export. $zip Flag to do export to zip file. - Returns:
- node() : the export results
system:export-silently #3
system:export-silently ($dir as xs:string, $incremental as xs:boolean?, $zip as xs:boolean?) as xs:boolean
Export a backup of the database (admin user only). Messagers from exporter reroute to logs.
- Parameters:
$dir This is an absolute path to where the backup will be written. Must be writeable by the eXist process. $incremental Flag to do incremental export. $zip Flag to do export to zip file. - Returns:
- xs:boolean : the export results
system:function-as-user #3
system:function-as-user ($username as xs:string, $password as xs:string?, $function as function(*)) as item()
A pseudo-function to execute a function as a different user. The first argument is the name of the user, the second is the password. If the user can be authenticated, the function will execute the function given in the third argument with the permissions of that user andreturns the result of the execution. Before the function completes, it switches the current user back to the old user.
- Parameters:
$username The username of the user to run the code against $password The password of the user to run the code against $function The zero arity function to run as the identified user - Returns:
- item()* : the results of the code block executed
system:function-available #2
system:function-available ($function-name as xs:QName, $arity as xs:integer) as xs:boolean
Returns whether a function is available.
- Parameters:
$function-name The fully qualified name of the function $arity The arity of the function - Returns:
- xs:boolean : true() if the function exists, false() otherwise.
system:get-build #0
system:get-build () as xs:string
Returns the build of eXist running this query.
- Returns:
- xs:string : the build number
system:get-exist-home #0
system:get-exist-home () as xs:string
Returns the eXist home location.
- Returns:
- xs:string : the path to the eXist home
system:get-index-statistics #0
system:get-index-statistics () as node()
Internal function
- Returns:
- node()? : the resource containing the index statistics
system:get-main-module-load-path #0
system:get-main-module-load-path () as xs:string
Returns the module load path from the root query context. The module load path corresponds to the location on the file system or the collection in the database of the main module that was compiled.
- Returns:
- xs:string : the main module load path
system:get-memory-free #0
system:get-memory-free () as xs:long
Returns the amount of free memory available to eXist.
- Returns:
- xs:long : the size of memory
system:get-memory-max #0
system:get-memory-max () as xs:long
Returns the maximum amount of memory eXist may use.
- Returns:
- xs:long : the size of memory
system:get-memory-total #0
system:get-memory-total () as xs:long
Returns the total amount of memory in use by eXist.
- Returns:
- xs:long : the size of memory
system:get-module-load-path #0
system:get-module-load-path () as xs:string
Returns the module load path from the current query context. The module load path corresponds to the source location from where this module is loaded.The module load path is also used to resolve relative XInclude paths.
- Returns:
- xs:string : the module load path
system:get-product-name #0
system:get-product-name () as xs:string
Returns the product name of the software running this query.
- Returns:
- xs:string : the product name
system:get-revision #0
system:get-revision () as xs:string
Returns the Git commit ID of the eXist instance running this query.
- Returns:
- xs:string : the Git commit ID.
system:get-running-jobs #0
system:get-running-jobs () as item()
Get a list of running jobs (dba role only).
- Returns:
- item() : the list of running jobs
system:get-running-xqueries #0
system:get-running-xqueries () as item()
Get a list of running XQueries (dba role only).
- Returns:
- item() : a node containing the list of running XQueries
system:get-scheduled-jobs #0
system:get-scheduled-jobs () as item()
Get a list of scheduled jobs (dba role only).
- Returns:
- item() : a node containing the list of scheduled jobs
system:get-uptime #0
system:get-uptime () as xs:dayTimeDuration
Returns the time since eXist-db was started. The value is stable over the lifetime of a query.
- Returns:
- xs:dayTimeDuration : the duration since eXist-db was started
system:get-version #0
system:get-version () as xs:string
Returns the version of eXist running this query.
- Returns:
- xs:string : the version string
system:import #3
system:import ($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?) as node()
Restore the database or a section of the database (admin user only).
- Parameters:
$dir-or-file This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. $admin-pass The password for the admin user $new-admin-pass Set the admin password to this new password. - Returns:
- node() : the import results
system:import-silently #3
system:import-silently ($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?) as node()
Restore the database or a section of the database (admin user only). Messagers from exporter reroute to logs.
- Parameters:
$dir-or-file This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. $admin-pass The password for the admin user $new-admin-pass Set the admin password to this new password. - Returns:
- node() : the import results
system:kill-running-xquery #1
system:kill-running-xquery ($xquery-id as xs:integer) as item()
Kill a running XQuey (dba role only).
- Parameters:
$xquery-id The XQuery ID obtained from get-running-xqueries() - Returns:
- item()
system:kill-running-xquery #2
system:kill-running-xquery ($xquery-id as xs:integer, $wait-time as xs:long) as item()
Kill a running XQuey (dba role only).
- Parameters:
$xquery-id The XQuery ID obtained from get-running-xqueries() $wait-time The wait time in milliseconds before terminating the XQuery - Returns:
- item()
system:restore #3
system:restore ($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?) as node()
Restore the database or a section of the database (admin user only).
- Parameters:
$dir-or-file This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. $admin-pass The password for the admin user $new-admin-pass Set the admin password to this new password. - Returns:
- node() : the restore results
system:restore #4
system:restore ($dir-or-file as xs:string, $admin-pass as xs:string?, $new-admin-pass as xs:string?, $overwrite as xs:boolean) as node()
Restore the database or a section of the database (admin user only).
- Parameters:
$dir-or-file This is either a backup directory with the backup descriptor (__contents__.xml) or a backup ZIP file. $admin-pass The password for the admin user $new-admin-pass Set the admin password to this new password. $overwrite Should newer versions of apps installed in the database be overwritten by those found in the backup? False by default. - Returns:
- node() : the restore results
system:shutdown #0
system:shutdown () as empty-sequence()
Shutdown eXist immediately. This method is only available to the DBA role.
- Returns:
- empty-sequence()
system:shutdown #1
system:shutdown ($delay as xs:long) as empty-sequence()
Shutdown eXist. This method is only available to the DBA role.
- Parameters:
$delay The delay in milliseconds before eXist starts to shutdown. - Returns:
- empty-sequence()
system:trace #0
system:trace () as node()
Returns function call statistics gathered by the trace log.
- Returns:
- node() : the call statistics gathered by the trace
system:tracing-enabled #0
system:tracing-enabled () as xs:boolean
Returns true if function tracing is currently enabled on the database instance.
- Returns:
- xs:boolean : true is tracing is enabled.
system:trigger-system-task #2
system:trigger-system-task ($java-classname as xs:string, $task-parameters as node()?) as empty-sequence()
Trigger a system task.
- Parameters:
$java-classname The full name of the Java class to execute. It must implement org.exist.storage.SystemTask $task-parameters The XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters> - Returns:
- empty-sequence()
system:update-statistics #0
system:update-statistics () as empty-sequence()
This function is part of the unfinished index statistics module, which is not yet usable in a normal eXist setup. update-statistics rebuilds index statistics for the entire database.
- Returns:
- empty-sequence()