xmlBlaster 2.2.0 client API

org.xmlBlaster.util.key
Class QueryKeyData

java.lang.Object
  extended by org.xmlBlaster.util.key.KeyData
      extended by org.xmlBlaster.util.key.QueryKeyData
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class QueryKeyData
extends KeyData
implements java.io.Serializable, java.lang.Cloneable

This class encapsulates the Message key information of query invocations.

For the xml representation see MsgKeySaxFactory.

See Also:
QueryKeySaxFactory, Serialized Form

Field Summary
protected  AccessFilterQos[] filterArr
           
protected  java.util.ArrayList filterList
          subscribe(), get() and cluster configuration keys may contain a filter rule
 
Fields inherited from class org.xmlBlaster.util.key.KeyData
CONTENTMIME_DEFAULT, CONTENTMIMEEXTENDED_DEFAULT, DEFAULT_DOMAIN, glob, queryString, queryType, QUERYTYPE_DEFAULT, serialData
 
Constructor Summary
QueryKeyData(Global glob)
          Minimal constructor.
QueryKeyData(Global glob, I_QueryKeyFactory factory, java.lang.String serialData)
          Constructor to parse a message.
QueryKeyData(Global glob, java.lang.String query)
           
QueryKeyData(Global glob, java.lang.String query, java.lang.String queryType)
           
 
Method Summary
 void addFilter(AccessFilterQos qos)
           
 void appendQueryString(java.lang.String query)
          Same as setQueryString() but allows you to call it more than once the strings are concatenated.
 java.lang.String checkQueryType(java.lang.String queryType)
          Check the query type, Constants.XPATH, Constants.EXACT, Constants.DOMAIN are currently supported
 java.lang.Object clone()
          Returns a shallow clone, you can change savely all basic or immutable types like boolean, String, int.
 AccessFilterQos[] getAccessFilterArr()
          Return the filters or array with size==0 if none is specified.
 java.lang.String getNiceString()
          Helper which returns the oid OR the xpath query for nice logging.
 java.lang.String getQueryString()
          Access the query string like "//key"
 void setDomain(java.lang.String domain)
          Use for domain specific query
 void setOid(java.lang.String oid)
          Use for domain specific query
 void setQueryString(java.lang.String query)
          Your XPath query string.
 void setQueryType(java.lang.String queryType)
          Should be avoided to call directly.
 java.lang.String toXml()
          Converts the data in XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class org.xmlBlaster.util.key.KeyData
equals, generateOid, getContentMime, getContentMimeExtended, getDomain, getGlobal, getOid, getQueryType, getUrl, hasOid, isAdministrative, isDeadMessage, isDefaultDomain, isDomain, isExact, isInternal, isPluginInternal, isQuery, isRemoteProperties, isRunlevelManager, isXPath, setContentMime, setContentMimeExtended, setGlobal, size, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filterList

protected java.util.ArrayList filterList
subscribe(), get() and cluster configuration keys may contain a filter rule


filterArr

protected transient AccessFilterQos[] filterArr
Constructor Detail

QueryKeyData

public QueryKeyData(Global glob)
Minimal constructor.


QueryKeyData

public QueryKeyData(Global glob,
                    java.lang.String query)
Parameters:
glob -
query - The query string For example a topic oid like "Hello" or "oid:Hello" or a query like "xpath://key", "domain:CLUSTER"

QueryKeyData

public QueryKeyData(Global glob,
                    java.lang.String query,
                    java.lang.String queryType)
             throws XmlBlasterException
Parameters:
glob -
query - The query string (syntax is depending on queryType)
queryType - Constants.EXACT | Constants.XPATH | Constants.DOMAIN
Throws:
XmlBlasterException

QueryKeyData

public QueryKeyData(Global glob,
                    I_QueryKeyFactory factory,
                    java.lang.String serialData)
Constructor to parse a message.

Parameters:
factory - If null, the default factory from Global is used.
Method Detail

checkQueryType

public java.lang.String checkQueryType(java.lang.String queryType)
                                throws XmlBlasterException
Check the query type, Constants.XPATH, Constants.EXACT, Constants.DOMAIN are currently supported

Throws:
XmlBlasterException

setQueryType

public void setQueryType(java.lang.String queryType)
                  throws XmlBlasterException
Should be avoided to call directly.

Overrides:
setQueryType in class KeyData
Throws:
XmlBlasterException

setOid

public void setOid(java.lang.String oid)
Use for domain specific query

Overrides:
setOid in class KeyData

setDomain

public void setDomain(java.lang.String domain)
Use for domain specific query

Overrides:
setDomain in class KeyData
See Also:
The cluster requirement

setQueryString

public void setQueryString(java.lang.String query)
Your XPath query string.

Parameters:
query - The query string, e.g. "//key"

appendQueryString

public void appendQueryString(java.lang.String query)
Same as setQueryString() but allows you to call it more than once the strings are concatenated.

Parameters:
query - The query string, e.g. "//key"

getQueryString

public java.lang.String getQueryString()
Description copied from class: KeyData
Access the query string like "//key"

Overrides:
getQueryString in class KeyData
Returns:
A query string or null

getNiceString

public java.lang.String getNiceString()
Helper which returns the oid OR the xpath query for nice logging.


getAccessFilterArr

public AccessFilterQos[] getAccessFilterArr()
Return the filters or array with size==0 if none is specified.

For subscribe() and get() and cluster messages.

Returns:
never null

addFilter

public void addFilter(AccessFilterQos qos)

toXml

public java.lang.String toXml()
Converts the data in XML ASCII string.

Specified by:
toXml in class KeyData
Returns:
An XML ASCII string

toXml

public java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Specified by:
toXml in class KeyData
Parameters:
extraOffset - indenting of tags for nice output
Returns:
internal state of the query as a XML ASCII string

clone

public java.lang.Object clone()
Returns a shallow clone, you can change savely all basic or immutable types like boolean, String, int. Currently AccessFilterQos is not deep cloned (so don't change it)

Overrides:
clone in class KeyData

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.