<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.forestOnline.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.forestOnline</api:function-name><api:suggest>xdmp.forestonline</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>forestonline</api:suggest><api:function-link mode="xquery" fullname="xdmp:forest-online">/apidoc/8.0/xdmp:forest-online.xml</api:function-link><api:function mode="javascript" name="forestOnline" type="builtin" lib="xdmp" category="Server Monitoring" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.forestOnline"><api:summary>
  Returns true if the specified forest is online with a state of 
  <code xmlns="http://www.w3.org/1999/xhtml">open</code>, <code xmlns="http://www.w3.org/1999/xhtml">open replica</code> or
  <code xmlns="http://www.w3.org/1999/xhtml">sync replicating</code> if isReplica is true, or
  <code xmlns="http://www.w3.org/1999/xhtml">syncing replica</code> if syncingOk is true,
  otherwise returns false.
</api:summary><api:params><api:param name="forestID" type="xs:unsignedLong"><api:param-description>
    ID of the forest.
  </api:param-description><api:param-name>forestID</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="timestamp" type="xs:unsignedLong" optional="true"><api:param-description>
    If the forest online status is older than the specified timestamp,
    consider it offline.
  </api:param-description><api:param-name>timestamp</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="isReplica" type="xs:boolean" optional="true"><api:param-description>
    Whether the forest is a replica.
  </api:param-description><api:param-name>isReplica</api:param-name><api:param-type>Boolean</api:param-type></api:param><api:param name="syncingOk" type="xs:boolean" optional="true"><api:param-description>
    Whether to return true if the forest is in "syncing replica" state.
  </api:param-description><api:param-name>syncingOk</api:param-name><api:param-type>Boolean</api:param-type></api:param></api:params><api:return>Boolean</api:return><api:privilege>
   <code xmlns="http://www.w3.org/1999/xhtml">http://marklogic.com/xdmp/privileges/status</code>
</api:privilege><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.forestOnline(xdmp.forest("Documents"));
  =&gt; true
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.forestOnline(xdmp.forest("Documents"), 
     xdmp.wallclockToTimestamp(fn.currentDateTime()), true);
  =&gt; true if a forest is in open or sync-replicating state.
</pre></api:example></api:function></api:function-page>