Sending a XDS Message from one driver to another

Sending a XDS Message from one driver to another

Send Queue Event



This java class allows you to send a arbitary XDS message to another driver without needing to generate an event against eDirectory.

This is much the same as the sendDriverCommand with some subtle yet important difference.

When using sendDriverCommand the source driver waits until the destination driver processes the full event from the Subscriber and get the response back to the source driver as the resultant XDS.

The destination driver also needs to be running, if it 's stopped or disabled then the sendDriverCommand will fail.

When using the sendQueueEvent the event is queued up on the destination driver. The advantages of this is the source driver does not wait until the destination driver has completed. Plus if the driver is in a stopped state the event will still be queued up and processed when the driver next starts.

To use this you need to put the dxqueue.jar includined in the zip file into your dirxml\classes directory.

Then you can call the java class by including the "dxqueue.send" java method in your namespace. And then make the call: sendQueueEvent($DriverDN, $XDS/nds)

If you load the "SendQueueEvent.xml" Null Driver included in the zip into Designer you will see the single policy "Send Queue Event" On the subscriber. In there you will see I
am loading the namespace:


<policy xmlns:dxqueue="http://www.novell.com/nxsl/java/dxqueue.send">



Then setting a Nodeset Varaible to call that Java Class using the xpath call.


<do-set-local-variable name="CmdResult" scope="policy">
<arg-node-set>
<token-xpath expression="dxqueue:sendQueueEvent($DriverDN, $XDS/nds)"/>
</arg-node-set>
</do-set-local-variable>



This example creates a XDS message to then have it logged into a JDBC Database using a direct JDBC Insert statement. This is quite a handy way to log audit data into a database that you don't necessarily want to store in the Directory (such as Event Souce IP Address) but you do want to audit.
Attachments

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments
Great little tool, I had a use-case for this and found it fit the requirement perfectly. Far better than my prior approach.
Indeed an excellent helper class!

One thing to point out: I ran into a rights issue recently. It seems that the Security Equivalence of the 'Driver User' needs supervisor rights to the Driver object. I'm not sure why, because I would expect write rights to the attribute DirXML-AccessSubmitCommand should be sufficient (am I missing something?). Without these rights a Throwable is not handled by the code (bug):

com.novell.xml.xpath.XPathEvaluationException: function call to 'dxqueue:sendQueueEvent' resulted in an error: 'java.lang.NoSuchMethodError: com.novell.nds.dirxml.engine.NdsDtd.createStatusDocument(Ljava/lang/Throwable;Lcom/novell/nds/dirxml/engine/OperationData;)Lorg/w3c/dom/Document;
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2010-06-18 20:37
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.