2.10 Driver State

DirXML provides a mechanism for your driver to save state information between invocations. State information may be saved separately for the driver object, the subscriber object, and the publisher object. Any saved state information is passed to the object’s init method as part of the initialization parameters document. The state information is stored in an attribute on the DirXML-Driver object corresponding to your driver.

It is important to note that, in general, it is inappropriate for a driver to store configuration information outside of eDirectory where it cannot be remotely configured using ConsoleOne, iManager, or other remote configuration utilities.

Driver state is written by returning or publishing an <init-params> element containing one or more of the following elements: <driver-state>, <subscriber-state>, and <publisher-state>. When returning state to be written, the <init-params> element is a child of the <output> element in the XDS document. When publishing state, the <init-params> element is a child of the <input> element in the XDS document. State may be written at any time in a document returned to the DirXMLengine and may be written at any time by publishing a document to the DirXML engine on the publisher channel.

The actual state information can be any information desired. The content of the <driver-state>, <subscriber-state>, and <publisher-state> elements is stored exactly as presented to the DirXML engine.

The following example XML document shows a sample document sent to the DirXML engine that writes publisher state.

  <nds dtdversion="1.0" ndsversion="8.5">
     <input>
        <init-params>
           <publisher-state>
              <sync-up-to>965252784</sync-up-to>
              <last-object>
                 <name>Test</name>
                 <id>2349</id>
              </last-object>
           </publisher-state>
        </init-params>
     </input>
  </nds>
  

The content of the <publisher-state> element is not defined by DirXML. The content may be any XML representation of the data that is convenient for your driver. The state for any or all of the driver, subscriber, and publisher objects can be written on the subscriber channel as an <output> document or publisher channel as an <input> document.