SubscriptionShim
acts as the Subscriber channel output. The Subscriber channel therefore accepts Identity Vault events, generates commands with
the help of the policies, and issues those commands to the
SubscriptionShim
which then updates the application.
The second channel is the Publisher channel. The shim's
PublicationShim
acts as the Publisher channel input and the Identity Vault acts as the Publisher channel output. The Publisher channel therefore
accepts events for the application through the
PublicationShim
,
generates commands with the help of the rules, and issues those commands to update the Identity Vault.
SubscriptionShim
).
PublicationShim
).
SubscriptionShim
using <add-association>
in the result document returned from the add processing.
DriverShim
- The top-level interface responsible
for starting up and shutting down the driver.
SubscriptionShim
- The interface
responsible for accepting and processing commands from Identity Manager.
PublicationShim
- The interface responsible
for notifying Identity Manager of events that occur in the application.
XmlQueryProcessor
- The interface
passed by the PublicationShim into
XmlCommandProcessor
.execute
when calling Identity Manager to report an application event. Identity Manager uses the XmlQueryProcessor interface to query the PublicationShim
for any additional information that Identity Manager may need to process the application event.
XmlCommandProcessor
- The interface
passed to
PublicationShim
.start
so that
the
PublicationShim
can notify Identity Manager
of application events.
XmlQueryProcessor
- The interface
passed by Identity Manager to
SubscriptionShim
.execute
so that the
SubscriptionShim
can query
Identity Manager for any additional information it may need to process a command.
DriverShim
is instantiated
by Identity Manager via introspection using a no-argument constructor.
DriverShim
.init
method is called
by Identity Manager. Identity Manager passes in the driver initialization parameters.
SubscriptionShim
interface using
DriverShim
.getSubscriptionShim
.
PublicationShim
interface using
DriverShim
.getPublicationShim
.
SubscriptionShim
.init
,
passing the Subscriber initialization parameters.
PublicationShim
.init
,
passing the Publisher initialization parameters.
PublicationShim
.start
,
passing the Identity Manager object that implements
XmlCommandProcessor
.
The
PublicationShim
.start
method loops,
notifying Identity Manager using
XmlCommandProcessor
.execute
whenever a relevant event occurs in the application. It does not return
until
DriverShim
.shutdown
is called unless there is a fatal error.
XmlCommandProcessor
.execute
processes the event, possibly calling the driver
XmlQueryProcessor
(passed into
XmlCommandProcessor
.execute
)
one or more times if additional information is needed by Identity Manager to process the event.
SubscriptionShim
.execute
when an application object must be created or a change must be made to an application object. In addition, Identity Manager
invokes SubscriptionShim.execute() to query the application for information about application objects.
SubscriptionShim
.execute
processes
the command, optionally calling the Identity Manager
XmlQueryProcessor
(passed into
SubscriptionShim
.execute
)
one or more times if additional information is needed to process the command.
DriverShim
.shutdown
is called which performs whatever shim-specific cleanup is needed (including
signaling
PublicationShim
.start
to return.
XmlDocument
is a high level
abstraction representing an XML document. It allows for easy conversions between several common representations
of XML, notably Document Object Model (DOM), Simple API for
XML 1.0 (SAX), and a serialized, human-readable form.
This allows shims to create and consume XML documents in the form that is most convenient for the particular
application. Identity Manager predominantly uses DOM internally, but uses the serialized form when logging messages to DSTRACE.
Most shims will probably also use DOM internally, but shims which must pass the XML to external or remote processes
will likely use the serialized form as well.
Note that support for SAX 2.0 has not been added because all shims to date have used either the DOM representation or
a serialized representation.
com.novell.xml.dom.DocumentFactory
.newDocument
.
It is possible for a shim to use a different implementation of DOM. However, keep in mind that documents that
are passed to the shim by Identity Manager will always use the nxsl.jar implementation, so any extensions to DOM that might
be available in another implementation will not be available in documents received from Identity Manager. Note also that
the performance of the Novell XSLT processor is significantly better on documents created using the nxsl.jar implementation.
<nds dtdversion="3.5" ndsversion="8.x"> <source> <product asn1id="2 16 840 1 113719 1 x" version="3.5">Identity Manager</product> <contact>Novell, Inc.</contact> </source> <input> <!-- input commands or events go here --> </input> </nds>Shim returns:
<nds dtdversion="3.5" ndsversion="8.x"> <source> <product version="4.0.2.b">Some Application Driver</product> <contact>Nobody in particular</contact> </source> <output> <!-- results from commands or events go here --> </output> </nds>
SubscriptionShim
.execute
,
XmlQueryProcessor
.query
, and
XmlCommandProcessor
().execute(). The
Schema Mapping Policy is also applied to XML sent to (but not to XML returned from)
SubscriptionShim
.init
and
PublicationShim
().init(). The Schema
Mapping Policy is applied before the Output Transformation Policy when Identity Manager submits or returns a document to the shim and before
the Input Transformation Policy when the driver submits or returns a document to Identity Manager.
XmlCommandProcessor
.execute
and
XmlQueryProcessor
.query
(when
called by the driver) and to the XML documents returned from
SubscriptionShim
.execute
,
and
XmlQueryProcessor
.query
(when
called by Identity Manager). The Input Transformation Policy is applied before the Schema Mapping Policy.
The Input Transformation Policy is often used to transform data from the application format into the Identity Vault format. When
the Input Transformation is used for data format transformations the Output Transformation Policy usually performs the data transformation
in the opposite
direction (i.e., transforms from the Identity Vault format to the application format). The
Input Transformation Policy is also used to perform actions in response to the results of commands sent to the shim. Note that schema names
will always be in the application namespace in the XML processed by
the Input Transformation Policy.
It is also possible to use the Input Transformation Policy to transform an arbitrary XML format native to the connected
application to the format expected by Identity Manager. Such transformations must be written in XSLT because DirXML-Script
operates only on the Identity Manager-specific XML vocabulary.
SubscriptionShim
.execute
and
XmlQueryProcessor
.query
(when
called by Identity Manager) and to the XML documents returned from
XmlCommandProcessor
.execute
and
XmlQueryProcessor
.query
(when
called by the shim). The Output Transformation Policy is applied after the Schema Mapping Rule.
The Output Transformation Policy is often used to transform data from the Identity Vault format into the application format. When
the Output Transformation is used for data format transformations the Input Transformation Policy usually performs the data transformation
in the opposite
direction (i.e., transforms from the application format to the Identity Vault format). The
Output Transformation Policy is also used to perform actions in response to the results of commands sent to the Identity Vault.
Note that schema names
will always be in the application namespace in the XML processed by
the Input Transformation Policy.
It is also possible to use the Output Transformation Policy to transform from the format used by Identity Manager to an
arbitrary XML format native to the connected application. Such transformations must be written in XSLT because DirXML-Script
operates only on the Identity Manager-specific XML vocabulary.
<xsl:template match="/" > <xsl:apply-templates select="node()|@*"/> </xsl:template> <xsl:template match="node()|@*" > <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
XdsQueryProcessor
.
This allows the stylesheet to query the event source for more information.
XdsQueryProcessor
.
This allows the stylesheet to query the event target for more information.
XdsCommandProcessor
.
This allows the stylesheet to "write-back" a command to the event source.
XdsCommandProcessor
.
This allows the stylesheet to issue a command to the command destination directly, bypassing most other policies.
DNConverter
.
This allows the stylesheet to convert eDirectory DNs from one DN format to another.
<xsl:param name="fromNDS"/> <xsl:param name="srcQueryProcessor"/> <xsl:param name="destQueryProcessor"/> <xsl:param name="srcCommandProcessor"/> <xsl:param name="destCommandProcessor"/> <xsl:param name="dnConverter"/>Use of the query processors depends on the Novell XSLT implementation of extension functions. In order to make a query you need to declare a namespace for the Java interfaces used. For example, to use the XdsQueryProcessor interface add xmlns:query="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsQueryProcessor" to the <xsl:stylesheet> or <xsl:transform> element of the stylesheet. An example of using one of the query processors:
<!-- query object name queries the Identity Vault for the passed object-name. Ideally, this would --> <!-- not depend on "CN": to do this, add another parameter that is the name of the --> <!-- naming attribute. --> <xsl:template name="query-object-name"> <xsl:param name="object-name"/> <!-- build an xds query as a result tree fragment --> <xsl:variable name="query"> <query> <search-class class-name="{ancestor-or-self::add/@class-name}"/> <!-- NOTE: depends on CN being the naming attribute --> <search-attr attr-name="CN"> <value><xsl:value-of select="$object-name"/></value> </search-attr> <!-- put an empty read attribute in so that we don't get the whole object back --> <read-attr/> </query> </xsl:variable> <!-- query NDS --> <xsl:variable name="result" select="query:query($destQueryProcessor,$query)"/> <!-- return an empty or non-empty result tree fragment depending on result of query --> <xsl:value-of select="$result//instance"/> </xsl:template>Use of the command processors depends on the Novell XSLT implementation of extension functions. In order to issue a command you need to declare a namespace for the XdsCommandProcessor interface: this is done by adding xmlns:command="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor" to the <xsl:stylesheet> or <xsl:transform> element of the stylesheet. An example of using one of the command processors:
<!-- update full name sets the "Full Name" attribute in the event source --> <!-- it expects the context node to be the <modify> element in the document --> <xsl:template name="update-full-name"> <!-- build an xds command as a result tree fragment --> <xsl:variable name="command"> <modify> <!-- get the association from the modify coming through --> <xsl:copy-of select="association"/> <!-- put in the <modify-attr> for the Full Name attribute --> <modify-attr attr-name="Full Name"> <remove-all-values/> <add-value> <value> <xsl:value-of select="modify-attr[@attr-name='Given Name']/add-value/value"/> <xsl:text> </xsl:text> <xsl:value-of select="modify-attr[@attr-name='Surname']/add-value/value"/> </value> </add-value> </modify-attr> </modify> </xsl:variable> <!-- send command to source --> <xsl:variable name="result" select="command:execute($srcCommandProcessor,$command)"/> </xsl:template>
<!-- get-dn-prefix places the part of the passed dn that precedes the --> <!-- last occurrence of '\' in the passed dn in a result tree fragment --> <!-- meaning that it can be used to assign a variable value --> <xsl:template name="get-dn-prefix" xmlns:jstring="http://www.novell.com/nxsl/java/java.lang.String"> <xsl:param name="src-dn"/> <!-- use java string stuff to make this much easier --> <xsl:variable name="dn" select="jstring:new($src-dn)"/> <xsl:variable name="index" select="jstring:lastIndexOf($dn,'\')"/> <xsl:if test="$index != -1"> <xsl:value-of select="jstring:substring($dn,0,$index)"/> </xsl:if> </xsl:template>
Stylesheet
class. There are various ways in which this can be set up and invoked so it pays to read the documentation, but
a typical invocation is illustrated by the following code fragment.
import com.novell.nds.dirxml.driver.*; import com.novell.xsl.*; import com.novell.xsl.result.*; import org.w3c.dom.*; . . . try { XmlDocument inputDoc = new XmlDocument(); XmlDocument stylesheetDoc = new XmlDocument(); // load the input and stylesheet documents from a file inputDoc.readDocument(new FileInputStream("input.xml")); stylesheetDoc.readDocument(new FileInputStream("stylesheet.xsl")); // create the stylesheet processor and give it the stylesheet Stylesheet styleSheet = new Stylesheet(); styleSheet.load(stylesheetDoc.getDocument()); // pass in any stylesheet parameters that the stylesheet might need styleSheet.setParameter("fromNds", new Boolean(fromNDS)); // setup a result handler to get a DOM tree Document resultDoc = com.novell.xml.dom.DocumentFactory.newDocument(); DOMResultHandler resultHandler = new DOMResultHandler(resultDoc); styleSheet.setResultHandler(resultHandler); // apply the stylesheet styleSheet.process(doc, null); // result will be in resultDoc } catch( XSLException xsle ) { // handle any exception thrown }
com.novell.xml.dom.DOMQuery
- A class that uses XPath
expressions to find nodes in a DOM tree.
com.novell.xml.dom.DOMUtil
- Utility class implementing,
among others, things that XSLT and Identity Manager need for DOM that aren't defined by the 1.0 DOM spec (namespaces, serialization,
whitespace stripping, id resolution, etc.).
com.novell.xml.dom.DOMWriter
- A class for serializing
DOM trees, used by XmlDocument and DOMUtil. Using this class directly allows for finer control of the serialization
process.
com.novell.xsl.util.Util
- Has a method called getXSLStringValue()
which evaluates the string value of a Node according to the XPath definition. Useful for the text content of an
Element.
com.novell.nds.dirxml.driver.DriverFilter
and
com.novell.nds.dirxml.driver.ClassFilter
- Allows easy use of the Publisher Event Filter or the Subscriber Event Filter passed to the shim init() method.
com.novell.nds.dirxml.driver.Trace
- Facility
for drivers to use to output debugging trace messages to the DSTRACE console and to the Identity Manager log file.
com.novell.nds.dirxml.driver.DelimitedText
- class for representing a delimited text file as XML.
com.novell.nds.dirxml.driver.ThreadBridge
- implements a method of calling methods on a different thread.
com.novell.xml.util.Base64Codec
- implements
encoding and decoding of binary data using Base64 encoding. Base64 encoding is used by Identity Manager to encode binary
data in command and event notification documents.
com.novell.nds.dirxml.driver.ThreadGroupLocal
- implements a storage of variables local to the threads used for a shim (subscriber and publisher threads).
com.novell.nds.dirxml.driver.DNConverter
- interface usable from stylesheet rules for converting eDirectory DNs from one DN format to another.
com.novell.nds.dirxml.driver.Trace
.
It is recommended that shims not write directly to System.out or System.err (even though this will currently
send the output to DSTRACE) because this may not be supported in future releases.
Trace messages may also be directed to a file (in addition to DSTRACE) by entering the name and path of a file
in the trace settings for the driver or driver set.
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=8080,suspend=n
Alternatively, use the DHOST_JVM_OPTIONS environment variable (DIRXML_JVM_OPTIONS on NetWare) to set any debugger options desired.
Attach a Java debugger to the Identity Manager JRE using the port number specified.
DHOST_JVM_USE_VFPRINTF | If set to a value other than "0"; will cause installation of a vfprintf hook function that will write to a log file named "jvm_vfprintf.log"; in the temp directory. This will also enable verbose class and JNI messages. |
DHOST_JVM_VERBOSE_GC | If set to a value other than "0"; will enable verbose garbage collector messages. This is only useful in conjunction with JVM_USE_VFPRINTF. |
DHOST_JVM_INITIAL_HEAP (NetWare: DIRXML_JVM_INITIAL_HEAP) |
Set to the value in number of bytes of initial JVM heap size.
Example:
|
DHOST_JVM_MAX_HEAP (NetWare: DIRXML_JVM_MAX_HEAP) |
Set to the value in number of bytes of maximum JVM heap size.
Example:
|
DHOST_JVM_OPTIONS (NetWare: DIRXML_JVM_OPTIONS) |
Set to command line arguments for the JRE.
Example:
Each option string is separated by whitespace. If an option string contains whitespace, it must be enclosed in double quotes. |
DIRXML_JVM_VIRTUAL_HEAP |
set to the value in bytes of virtual java heap size. Example:
|
DIRXML_JVM_C_STACK_SIZE |
set to the value in bytes of the java C process stack size.
Example:
|