com.novell.nds.dirxml.driver.jdbc.util
Class MappingPolicy

java.lang.Object
  extended bycom.novell.nds.dirxml.driver.jdbc.util.MappingPolicy

public abstract class MappingPolicy
extends Object

A collection of methods for mapping multi-valued attributes to single-valued database fields.

These methods are intended for use in the Command Transform.


Constructor Summary
MappingPolicy()
           
 
Method Summary
static com.novell.xml.xpath.NodeSet FirstPerReplica(com.novell.xml.xpath.NodeSet parent, com.novell.xml.xpath.NodeSet fpr, com.novell.nds.dirxml.driver.XdsQueryProcessor processor)
          Returns a NodeSet containing a clone of each <add-attr> or <modify-attr> elements passed into it with its corresponding first replica value.
static com.novell.xml.xpath.NodeSet LastPerReplica(com.novell.xml.xpath.NodeSet parent, com.novell.xml.xpath.NodeSet lpr, com.novell.nds.dirxml.driver.XdsQueryProcessor processor)
          Returns a NodeSet containing a clone of each <add-attr> or <modify-attr> elements passed into it with its corresponding last replica value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingPolicy

public MappingPolicy()
Method Detail

FirstPerReplica

public static com.novell.xml.xpath.NodeSet FirstPerReplica(com.novell.xml.xpath.NodeSet parent,
                                                           com.novell.xml.xpath.NodeSet fpr,
                                                           com.novell.nds.dirxml.driver.XdsQueryProcessor processor)
                                                    throws com.novell.nds.dirxml.engine.VRDException
Returns a NodeSet containing a clone of each <add-attr> or <modify-attr> elements passed into it with its corresponding first replica value.

Should be used to alter the contents of <add> or <modify> events.

Parameters:
parent - the <add> or <modify> element; if null or empty, an empty NodeSet is returned; <modify> elements must have a src-entry-id attribute value to enable query-back capabilities; if more than one node is in the nodeset, only the first is utilized
fpr - the <add-attr> or <modify-attr> elements to clone; if null or empty, an empty NodeSet is returned; elements must have attr-name attribute value for <modify> events
processor - the query processor used to determine first-per-replica values for <modify> events; may be null for <add> events
Returns:
returns a NodeSet that should be inserted into the result document in place of nodes contained in fpr; will not return null; if query-back fails, fpr is returned
Throws:
IllegalArgumentException - if processor is null and parent contains a <modify> element; if elements in fpr are missing attr-name attribute values and parent contains a <modify> element
com.novell.nds.dirxml.engine.VRDException - if an DOMException is thrown

LastPerReplica

public static com.novell.xml.xpath.NodeSet LastPerReplica(com.novell.xml.xpath.NodeSet parent,
                                                          com.novell.xml.xpath.NodeSet lpr,
                                                          com.novell.nds.dirxml.driver.XdsQueryProcessor processor)
                                                   throws com.novell.nds.dirxml.engine.VRDException
Returns a NodeSet containing a clone of each <add-attr> or <modify-attr> elements passed into it with its corresponding last replica value.

Should be used to alter the contents of <add> or <modify> events.

Parameters:
parent - the <add> or <modify> element; if null or empty, an empty NodeSet is returned; <modify> elements must have a src-entry-id attribute value to enable query-back capabilities; if more than one node is in the nodeset, only the first is utilized
lpr - the <add-attr> or <modify-attr> elements to clone; if null or empty, an empty NodeSet is returned; elements must have attr-name attribute value for <modify> events
processor - the query processor used to determine last-per-replica values for <modify> events; may be null for <add> events
Returns:
returns a NodeSet that should be inserted into the result document in place of nodes contained in fpr; will not return null; if query-back fails, fpr is returned
Throws:
IllegalArgumentException - if processor is null and parent contains a <modify> element; if elements in fpr are missing attr-name attribute values and parent contains a <modify> element
com.novell.nds.dirxml.engine.VRDException - if an DOMException is thrown