xmlBlaster 2.1.0 API

org.xmlBlaster.util.key
Class QueryKeySaxFactory

java.lang.Object
  extended by org.xmlBlaster.util.SaxHandlerBase
      extended by org.xmlBlaster.util.key.QueryKeySaxFactory
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, I_QueryKeyFactory

public final class QueryKeySaxFactory
extends SaxHandlerBase
implements I_QueryKeyFactory

Parsing xml Key (quality of service) of subscribe() and update().

All XmlKey's have the same XML minimal structure:

     <key oid='4711' queryType='EXACT'>
     </key>
 
or like this:
     <key oid='' queryType='XPATH'>
        //AGENT
     </key>
 
Example of the filter tag in the key (NOT EVALUATED -> use QoS):
  <key queryType='XPATH'>
     /xmlBlaster/key/RUGBY
     <filter type='ContentLength' version='1.0'>
       800
     </filter>
  <key>
 

Author:
xmlBlaster@marcelruff.info
See Also:
QueryKeyData, QueryKeyFactoryTest

Field Summary
private  Global glob
           
private  boolean inCdata
           
private  int inKey
          helper flag for SAX parsing: parsing inside ?
private  java.lang.StringBuffer innerTags
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  java.util.Set nameSpaceSet
           
private  QueryKeyData queryKeyData
           
private  AccessFilterQos tmpFilter
           
 
Fields inherited from class org.xmlBlaster.util.SaxHandlerBase
character, locator, xmlLiteral, xmlSource
 
Constructor Summary
QueryKeySaxFactory(Global glob)
          Can be used as singleton.
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
          End element, event from SAX parser.
 java.lang.String getName()
          A human readable name of this factory
 QueryKeyData readObject(java.lang.String xmlKey)
          Parses the given xml Key and returns a QueryKeyData holding the data.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attrs)
          Start element, event from SAX parser.
 java.lang.String writeObject(QueryKeyData queryKeyData, java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class org.xmlBlaster.util.SaxHandlerBase
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, error, fatalError, getUseLexicalHandler, ignorableWhitespace, init, init, init, notationDecl, processingInstruction, setDocumentLocator, setUseLexicalHandler, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping, toString, toXml, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private final Global glob

log

private static java.util.logging.Logger log

queryKeyData

private QueryKeyData queryKeyData

inKey

private transient int inKey
helper flag for SAX parsing: parsing inside ?


tmpFilter

private transient AccessFilterQos tmpFilter

innerTags

private java.lang.StringBuffer innerTags

inCdata

private boolean inCdata

nameSpaceSet

private java.util.Set nameSpaceSet
Constructor Detail

QueryKeySaxFactory

public QueryKeySaxFactory(Global glob)
Can be used as singleton.

Method Detail

readObject

public QueryKeyData readObject(java.lang.String xmlKey)
                        throws XmlBlasterException
Parses the given xml Key and returns a QueryKeyData holding the data. Parsing of update() and subscribe() key is supported here.

Specified by:
readObject in interface I_QueryKeyFactory
Parameters:
the - XML based ASCII string
Throws:
XmlBlasterException

startElement

public final void startElement(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String name,
                               org.xml.sax.Attributes attrs)
Start element, event from SAX parser.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class SaxHandlerBase
Parameters:
name - Tag name
attrs - the attributes of the tag

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
End element, event from SAX parser.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class SaxHandlerBase
Parameters:
name - Tag name

writeObject

public final java.lang.String writeObject(QueryKeyData queryKeyData,
                                          java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Specified by:
writeObject in interface I_QueryKeyFactory
Parameters:
extraOffset - indenting of tags for nice output
Returns:
internal state of the RequestBroker as a XML ASCII string

getName

public java.lang.String getName()
A human readable name of this factory

Specified by:
getName in interface I_QueryKeyFactory
Returns:
"QueryKeySaxFactory"

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.