xmlBlaster 2.1.0 API

org.xmlBlaster.engine.xml2java
Class XmlKeyDom

java.lang.Object
  extended by org.xmlBlaster.engine.xml2java.XmlKeyDom
All Implemented Interfaces:
I_MergeDomNode
Direct Known Subclasses:
BigXmlKeyDOM

public class XmlKeyDom
extends java.lang.Object
implements I_MergeDomNode

Building a DOM tree for XmlKeys.

This DOM tree contains the meta data from XmlKey:

<![CDATA[
  <?xml version='1.0' encoding='UTF-8' ?>
  <xmlBlaster>
    <key oid='abc' contentMime='text/plain'>
      <Hello/>
    </key>
    <key oid='xyz' contentMime='text/xml'>
      <World/>
    </key>
  </xmlBlaster>]]>
 

Author:
xmlBlaster@marcelruff.info

Field Summary
protected  java.lang.String encoding
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
protected  RequestBroker requestBroker
           
private  ServerScope serverScope
           
protected  org.w3c.dom.Document xmlKeyDoc
           
 
Constructor Summary
protected XmlKeyDom(RequestBroker requestBroker)
          Constructor to handle a DOM with XPath query.
 
Method Summary
protected  java.lang.String getKeyOid(org.w3c.dom.Node node)
          Given a node , extract its attribute oid='...'
 org.w3c.dom.Node mergeNode(org.w3c.dom.Node node)
          Adding a new <key> node to the xmlBlaster xmlKey tree.
 java.util.ArrayList parseKeyOid(SessionInfo sessionInfo, java.lang.String xpathQuery, QueryQosData qos)
          This method does the XPath query.
 java.lang.String toXml()
          Dump state of this object into XML.
 java.lang.String toXml(java.lang.String extraOffset, boolean stripDeclaration)
          Dump state of this object into XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private static final java.lang.String ME
See Also:
Constant Field Values

serverScope

private final ServerScope serverScope

log

private static java.util.logging.Logger log

xmlKeyDoc

protected org.w3c.dom.Document xmlKeyDoc

encoding

protected java.lang.String encoding

requestBroker

protected final RequestBroker requestBroker
Constructor Detail

XmlKeyDom

protected XmlKeyDom(RequestBroker requestBroker)
             throws XmlBlasterException
Constructor to handle a DOM with XPath query.

Throws:
XmlBlasterException
Method Detail

mergeNode

public final org.w3c.dom.Node mergeNode(org.w3c.dom.Node node)
                                 throws XmlBlasterException
Adding a new <key> node to the xmlBlaster xmlKey tree.

This method is forced by the interface I_MergeDomNode

Specified by:
mergeNode in interface I_MergeDomNode
Parameters:
the - node to merge into the DOM tree, it is invalid after this call
Returns:
the node added or null
Throws:
XmlBlasterException

parseKeyOid

public final java.util.ArrayList parseKeyOid(SessionInfo sessionInfo,
                                             java.lang.String xpathQuery,
                                             QueryQosData qos)
                                      throws XmlBlasterException
This method does the XPath query.

Parameters:
clientName - is only needed for nicer logging output
Returns:
Array of matching key oid objects TODO: a query Handler, allowing drivers for REGEX, XPath, SQL, etc. queries
Throws:
XmlBlasterException

getKeyOid

protected final java.lang.String getKeyOid(org.w3c.dom.Node node)
                                    throws XmlBlasterException
Given a node , extract its attribute oid='...'

Returns:
oid = unique object id of the MsgUnit
Throws:
XmlBlasterException

toXml

public java.lang.String toXml()
                       throws XmlBlasterException
Dump state of this object into XML.

Returns:
XML state of XmlKeyDom
Throws:
XmlBlasterException

toXml

public java.lang.String toXml(java.lang.String extraOffset,
                              boolean stripDeclaration)
                       throws XmlBlasterException
Dump state of this object into XML.

Parameters:
extraOffset - indenting of tags
stripDeclaration - if true '<?xml version="1.0" encoding="UTF-8"?>' is not dumped
Returns:
XML state of XmlKeyDom
Throws:
XmlBlasterException

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.