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
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
Clear the global trace log.
- Returns:
- item()
system:clear-xquery-cache
Clear XQuery cache.
- Returns:
- empty()
system:count-instances-active
Returns the number of eXist instances that are active.
- Returns:
- xs:integer : the count
system:count-instances-available
Returns the number of eXist instances that are available.
- Returns:
- xs:integer : the count
system:count-instances-max
Returns the maximum number of eXist instances.
- Returns:
- xs:integer : the count
system:enable-tracing
Enable function tracing on the database instance.
- Parameters:
-
$enable The boolean flag to enable/disable function tracing - Returns:
- item()
system:enable-tracing
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:
- item()
system:export
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. $incremental? Flag to do incremental export. $zip? Flag to do export to zip file. - Returns:
- node() : the export results
system:export-silently
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. $incremental? Flag to do incremental export. $zip? Flag to do export to zip file. - Returns:
- xs:boolean : the export results
system:ft-index-lookup
Internal function doing old full-text index lookup filtering. Intended to support the query optimizer by allowing restrictive filtering early on.
- Parameters:
-
$nodes* The nodes $string-filter? The string-filter - Returns:
- node()* : the nodes matching the string-filter
system:function-available
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
Returns the build of eXist running this query.
- Returns:
- xs:string : the build number
system:get-exist-home
Returns the eXist home location.
- Returns:
- xs:string : the path to the eXist home
system:get-index-statistics
Internal function
- Returns:
- node()? : the resource containing the index statistics
system:get-memory-free
Returns the amount of free memory available to eXist.
- Returns:
- xs:long : the size of memory
system:get-memory-max
Returns the maximum amount of memory eXist may use.
- Returns:
- xs:long : the size of memory
system:get-memory-total
Returns the total amount of memory in use by eXist.
- Returns:
- xs:long : the size of memory
system:get-module-load-path
Returns the module load path from the current query context. The module load path corresponds to the location on the file system from where modules are loaded into an XQuery. This is usually the directory from which the main XQuery was compiled, or - when executing a stored XQuery - the collection in which the main query resides. The module load path is also used to resolve relative XInclude paths.
- Returns:
- xs:string : the load path
system:get-revision
Returns the Git commit ID of the eXist instance running this query.
- Returns:
- xs:string : the Git commit ID.
system:get-running-jobs
Get a list of running jobs (dba role only).
- Returns:
- item() : the list of running jobs
system:get-running-xqueries
Get a list of running XQueries (dba role only).
- Returns:
- item() : a node containing the list of running XQueries
system:get-scheduled-jobs
Get a list of scheduled jobs (dba role only).
- Returns:
- item() : a node containing the list of scheduled jobs
system:get-uptime
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
Returns the version of eXist running this query.
- Returns:
- xs:string : the version string
system:import
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
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
Kill a running XQuey (dba role only).
- Parameters:
-
$xquery-id The XQuery ID obtained from get-running-xqueries() - Returns:
- item()
system:kill-running-xquery
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
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:shutdown
Shutdown eXist immediately. This method is only available to the DBA role.
- Returns:
- item()
system:shutdown
Shutdown eXist. This method is only available to the DBA role.
- Parameters:
-
$delay The delay in milliseconds before eXist starts to shutdown. - Returns:
- item()
system:trace
Returns function call statistics gathered by the trace log.
- Returns:
- node() : the call statistics gathered by the trace
system:tracing-enabled
Returns true if function tracing is currently enabled on the database instance.
- Returns:
- xs:boolean : true is tracing is enabled.
system:trigger-system-task
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:
- item()
system:update-statistics
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()