com.novell.nds.dirxml.driver.xds
Class XDSQueryDocument

java.lang.Object
  extended bycom.novell.nds.dirxml.driver.xds.DocumentImpl
      extended bycom.novell.nds.dirxml.driver.xds.XDSQueryDocument
All Implemented Interfaces:
ReadableDocument, WriteableDocument, XDSDocument

public class XDSQueryDocument
extends DocumentImpl
implements ReadableDocument, WriteableDocument

The XmlDocument passed to the query(XmlDocument) method of interface XmlQueryProcessor.

Interface PublicationShim implements this method. An XmlQueryProcessor object reference is passed to the SubscriptionShim.execute(XmlDocument, XmlQueryProcessor) method.


Constructor Summary
XDSQueryDocument()
          Constructs an empty, writeable query document.
XDSQueryDocument(DTDVersion dtdVersion)
          Constructs an empty, writeable query document.
XDSQueryDocument(com.novell.nds.dirxml.driver.XmlDocument xdsXML)
          Constructs a readable query document from an existing XDS-formatted, XML document.
 
Method Summary
 XDSQueryElement appendQueryElement()
          Appends an empty, child <query> element to this document's <input> element.
 XDSQueryExElement appendQueryExElement()
          Appends an empty, child <query-ex> element to this document's <input> element.
 XDSSourceElement appendSourceElement()
          Appends an empty, child <source> element to this document's <nds> element.
 List childElements()
          Returns the child elements of this document's <input> element.
 void empty()
          Removes all child nodes from this document's <input> or <output> element.
 List extractQueryElements()
          Returns this element's child <query> and <query-ex> elements.
 XDSSourceElement extractSourceElement()
          Returns this document's <source> element.
 DTDVersion getDTDVersion()
          Returns the dtdversion attribute value from this document's <nds> element.
 com.novell.nds.dirxml.driver.XmlDocument toXML()
          Converts this document into an XmlDocument.
 void validate()
          Validates this document.
 
Methods inherited from class com.novell.nds.dirxml.driver.xds.DocumentImpl
domDocument, domIOElement, domNDSElement, isEmpty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.novell.nds.dirxml.driver.xds.XDSDocument
domDocument, domIOElement, domNDSElement, isEmpty
 

Constructor Detail

XDSQueryDocument

public XDSQueryDocument(com.novell.nds.dirxml.driver.XmlDocument xdsXML)
                 throws XDSParseException
Constructs a readable query document from an existing XDS-formatted, XML document.

This constructor should be used to parse documents passed to method query(XmlDocument) of interface PublicationShim.

Parameters:
xdsXML - must not be null
Throws:
XDSParseException - thrown if xdsXML is empty, malformed, or invalid
See Also:
SkeletonPublicationShim.query(XmlDocument)

XDSQueryDocument

public XDSQueryDocument()
Constructs an empty, writeable query document. By default, the current DTD version is used.

This constructor should be used to build documents passed to the XmlQueryProcessor object passed to method execute(XmlDocument, XmlQueryProcessor) of interface SubscriptionShim.

See Also:
SkeletonSubscriptionShim.execute(XmlDocument, com.novell.nds.dirxml.driver.XmlQueryProcessor)

XDSQueryDocument

public XDSQueryDocument(DTDVersion dtdVersion)
Constructs an empty, writeable query document. The DTD version used is configurable.

This constructor should be used to build documents passed to the XmlQueryProcessor object passed to method execute(XmlDocument, XmlQueryProcessor) of interface SubscriptionShim.

Parameters:
dtdVersion - must not be null
See Also:
SkeletonSubscriptionShim.execute(XmlDocument, com.novell.nds.dirxml.driver.XmlQueryProcessor)
Method Detail

extractSourceElement

public XDSSourceElement extractSourceElement()
Description copied from interface: ReadableDocument
Returns this document's <source> element.

Invocation Context:
READ

Specified by:
extractSourceElement in interface ReadableDocument
Returns:
may return null

extractQueryElements

public List extractQueryElements()
Returns this element's child <query> and <query-ex> elements.

Invocation Context:
READ

Returns:
java.util.Collections.EMPTY_LIST or a list of XDSQueryElement and XDSQueryExElement objects; will not return null

getDTDVersion

public DTDVersion getDTDVersion()
Description copied from interface: ReadableDocument
Returns the dtdversion attribute value from this document's <nds> element.

Invocation Context:
READ

Specified by:
getDTDVersion in interface ReadableDocument
Returns:
will not return null; if absent, this method returns DTDVersion.UNKNOWN

childElements

public List childElements()
Returns the child elements of this document's <input> element.

Usage Notes:
The types of objects returned by this method may be extended in the future. Thus, callers should be able to handle object types other than those listed in the returns field below.
Invocation Context:
READ

Specified by:
childElements in interface ReadableDocument
Returns:
Collections.EMPTY_LIST or a list of XDSQueryElement, XDSQueryExElement and NonXDSElement objects; will not return null

appendQueryElement

public XDSQueryElement appendQueryElement()
Appends an empty, child <query> element to this document's <input> element.

Invocation Context:
WRITE

Returns:
will not return null

appendQueryExElement

public XDSQueryExElement appendQueryExElement()
Appends an empty, child <query-ex> element to this document's <input> element.

Invocation Context:
WRITE

Returns:
will not return null

appendSourceElement

public XDSSourceElement appendSourceElement()
Description copied from interface: WriteableDocument
Appends an empty, child <source> element to this document's <nds> element. When called more than once, no action is taken and the same <source> element is returned.

Invocation Context:
WRITE

Specified by:
appendSourceElement in interface WriteableDocument
Returns:
will not return null

validate

public void validate()
              throws XDSParseException
Description copied from interface: WriteableDocument
Validates this document.

Invocation Context:
WRITE

Specified by:
validate in interface WriteableDocument
Throws:
XDSParseException - if this document is malformed or invalid

toXML

public com.novell.nds.dirxml.driver.XmlDocument toXML()
Description copied from interface: WriteableDocument
Converts this document into an XmlDocument.

Invocation Context:
WRITE

Specified by:
toXML in interface WriteableDocument
Returns:
this document as a XmlDocument

empty

public void empty()
Description copied from interface: WriteableDocument
Removes all child nodes from this document's <input> or <output> element.

Invocation Context:
WRITE

Specified by:
empty in interface WriteableDocument