MarkLogic Server 11.0 Product Documentation
xdmp:forest-online

xdmp:forest-online(
   $forestID as xs:unsignedLong,
   [$timestamp as xs:unsignedLong],
   [$isReplica as xs:boolean],
   [$syncingOk as xs:boolean]
) as xs:boolean

Summary

Returns true if the specified forest is online with a state of open, open replica or sync replicating if isReplica is true, or syncing replica if syncingOk is true, otherwise returns false. For a remote forest, returns false if the cached forest online status is older than the specified timestamp.

Parameters
forestID ID of the forest.
timestamp If the forest online status is older than the specified timestamp, consider it offline.
isReplica Whether the forest is a replica.
syncingOk Whether to return true if the forest is in "syncing replica" state.

Required Privileges

http://marklogic.com/xdmp/privileges/status

Example

  xdmp:forest-online(xdmp:forest("Documents"))
  => true

Example

  xdmp:forest-online(xdmp:forest("Documents"),
    xdmp:wallclock-to-timestamp(fn:current-dateTime()), fn:true())
  => true if a forest is in open or sync-replicating state.
Powered by MarkLogic Server | Terms of Use | Privacy Policy