appendix-scheduling.xml revision 21321a22cb4d65f132f22f73df6b0fd8a62dac32
<?xml version="1.0" encoding="UTF-8"?>
<!--
! CCPL HEADER START
!
! This work is licensed under the Creative Commons
! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
! To view a copy of this license, visit
! http://creativecommons.org/licenses/by-nc-nd/3.0/
! or send a letter to Creative Commons, 444 Castro Street,
! Suite 900, Mountain View, California, 94041, USA.
!
! You can also obtain a copy of the license at
! legal/CC-BY-NC-ND.txt.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! If applicable, add the following below this CCPL HEADER, with the fields
! enclosed by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CCPL HEADER END
!
! Copyright 2011-2012 ForgeRock AS
!
-->
<appendix xml:id="appendix-scheduling"
xmlns="http://docbook.org/ns/docbook"
version="5.0"
xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xinclude="http://www.w3.org/2001/XInclude">
<title>Scheduling</title>
<para>OpenIDM provides the scheduling for operations such as synchronization
and reconciliation. You configure the scheduler with syntax similar to that
of the <command>cron</command> command. The scheduler relies on the Quartz
library.</para>
<para>You can configure the feature using the
<literal>org.forgerock.openidm.scheduler</literal> service. In other words,
you configure the schedule by creating a JSON file named
<filename>conf/[org.forgerock.openidm.]scheduler-<replaceable
>schedule-name</replaceable>.json</filename>, where
<literal>[org.forgerock.openidm.]</literal> is optional and added
automatically when OpenIDM reads the configuration, and
<replaceable>schedule-name</replaceable> is the logical name for the
scheduled operation, such as
<literal>reconcile_systemXmlAccounts_managedUser</literal>.</para>
<para>Alternatively, modules can request scheduling themselves based on the
configuration in their format and location.</para>
<section xml:id="scheduler-configuration-file">
<title>Configuration File</title>
<para>The scheduler configuration in the file
<filename>conf/[org.forgerock.openidm.]scheduler-<replaceable
>schedule-name</replaceable>.json</filename> has the following format.</para>
<programlisting language="javascript">{
"enabled" : true,
"type" : "cron",
"startTime" : "<replaceable>optional time</replaceable>",
"endTime" : "<replaceable>optional time</replaceable>",
"schedule" : "<replaceable>cron expression</replaceable>",
"timeZone" : "<replaceable>optional time zone</replaceable>",
"invokeService" : "<replaceable>service identifier</replaceable>",
"invokeContext" : "<replaceable>service specific context info</replaceable>"
}</programlisting>
<itemizedlist>
<listitem>
<para>Specify the time and date in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.</para>
</listitem>
<listitem>
<para>The optional properties <literal>startTime</literal>,
<literal>endTime</literal>, and <literal>timeZone</literal> can be absent,
or empty.</para>
</listitem>
<listitem>
<para>The <replaceable>cron expression</replaceable> is described in
<link xlink:show="new"
xlink:href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html"
>http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html</link> and
<link xlink:show="new"
xlink:href="http://www.quartz-scheduler.org/docs/tutorial/TutorialLesson06.html"
>http://www.quartz-scheduler.org/docs/tutorial/TutorialLesson06.html</link>.</para>
</listitem>
<listitem>
<para>The <literal>"invokeService"</literal> service identifier and
<literal>"invokeContext"</literal> information can be take the following
values: TODO.</para>
<para>A service identifier can be specified without the
<literal>org.forgerock.openidm.</literal> prefix. In other words,
<literal>"invokeService" : "active-sync"</literal> is equivalent to
<literal>"invokeService" : "org.forgerock.openidm.active-sync"</literal>.</para>
</listitem>
</itemizedlist>
<example xml:id="simple-scheduler-example">
<title>Schedule Configuration: Simple Example</title>
<para>TODO describe the example.</para>
<programlisting language="javascript">{
"enabled" : true,
"type" : "cron",
"schedule" : "0 30 10-13 ? * WED,FRI"
"invokeService" : "active-sync",
"invokeContext" : "system-x"
}</programlisting>
</example>
<example xml:id="complex-scheduler-example">
<title>Schedule Configuration: Complex Example</title>
<para>TODO describe the example.</para>
<programlisting language="javascript">{
"enabled" : true,
"type" : "cron",
"startTime" : "2011-05-03T10:00:00 ",
"endTime" : "2011-05-03T15:59:59",
"schedule" : "0 30 10-13 ? * WED,FRI"
"timeZone" : "America/Los_Angeles"
"invokeService" : "active-sync",
"invokeContext" : "system-x"
}</programlisting>
</example>
</section>
<section xml:id="scheduler-service-implementations">
<title>Service Implementer Notes</title>
<para>Services that can be scheduled implement
<literal>ScheduledService</literal>. The service PID is used as a basis for
the service identifier in schedule definitions.</para>
</section>
</appendix>