xmlBlaster 2.2.0 client API

org.xmlBlaster.util.qos
Class QueryQosData

java.lang.Object
  extended by org.xmlBlaster.util.qos.QosData
      extended by org.xmlBlaster.util.qos.QueryQosData
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class QueryQosData
extends QosData
implements java.io.Serializable, java.lang.Cloneable

Data container handling of query / access QoS.

This data holder is accessible through decorators, each of them allowing a specialized view on the data:

For the xml representation see QueryQosSaxFactory.

Author:
xmlBlaster@marcelruff.info
See Also:
QueryQosSaxFactory, org.xmlBlaster.test.classtest.qos.QueryQosFactoryTest, Serialized Form

Field Summary
 
Fields inherited from class org.xmlBlaster.util.qos.QosData
DEFAULT_persistent, glob, rcvTimestamp, routeNodeList, routeNodes, serialData
 
Constructor Summary
QueryQosData(Global glob, I_QueryQosFactory factory, MethodName methodName)
          Constructs the specialized quality of service object for query informations.
QueryQosData(Global glob, I_QueryQosFactory factory, java.lang.String serialData, MethodName methodName)
          Constructs the specialized quality of service object for a publish() call.
QueryQosData(Global glob, MethodName methodName)
          true if query has to be /** Constructs the specialized quality of service object for query informations.
 
Method Summary
 void addAccessFilter(AccessFilterQos filter)
          Adds your supplied subscribe filter
 void addQuerySpec(QuerySpecQos querySpec)
          Adds the querySpec you supplied.
 java.lang.Object clone()
          Returns a deep clone, you can change savely all basic or immutable types like boolean, String, int and also the ClientProperties and RouteInfo.
 boolean containsHistoryQos()
          Was a history qos specified?
 java.lang.String generateSubscriptionId(SessionName sessionName, QueryKeyData subscribeKey)
          A client side subscriptionId must start with "__subId:" followed by the relative session name.
 AccessFilterQos[] getAccessFilterArr()
          Return the subscribe filters or null if none is specified.
 java.util.ArrayList getAccessFilters()
           
 PropBoolean getContentProp()
           
 boolean getForceDestroy()
          Defaults to false.
 PropBoolean getForceDestroyProp()
           
 HistoryQos getHistoryQos()
          Get the QoS which describes the history query settings.
 PropBoolean getInitialUpdateProp()
           
 PropBoolean getLocalProp()
           
 PropBoolean getMetaProp()
           
 boolean getMultiSubscribe()
          Allow to subscribe multiple times to the same query/oid
 PropBoolean getMultiSubscribeProp()
           
 PropBoolean getNotifyProp()
           
 QuerySpecQos[] getQuerySpecArr()
          Return the subscribe filters or null if none is specified.
 java.util.ArrayList getQuerySpecs()
           
 java.lang.String getSubscriptionId()
          Get the identifier (unique handle) for this subscription.
 PropBoolean getUpdateOnewayProp()
           
 boolean getWantContent()
          Defaults to true.
 boolean getWantInitialUpdate()
          Defaults to true.
 boolean getWantLocal()
          Defaults to true.
 boolean getWantMeta()
          Defaults to true.
 boolean getWantNotify()
          For erase(): Notify the subscribers on erase? Defaults to true.
 boolean getWantUpdateOneway()
          Defaults to true.
 boolean hasSubscriptionId()
           
 boolean newestOnly()
          if __newestOnly client property is true remove older instances from callback queue of client
 void setFilters(AccessFilterQos[] newFilters)
           
 void setForceDestroy(boolean forceDestroy)
          Topic erase behavior with pending messages, defaults to false.
 void setGlobal(Global glob)
          Sets the global object (used when deserializing the object)
 void setHistoryQos(HistoryQos historyQos)
          Set the QoS which describes the history query settings.
 void setMultiSubscribe(boolean multiSubscribe)
           
 void setNewestOnly(boolean newestOnly)
           
 void setSubscriptionId(java.lang.String subscriptionId)
          Force the identifier (unique handle) for this subscription.
 void setWantContent(boolean content)
          Defaults to true.
 void setWantInitialUpdate(boolean initialUpdate)
          Do we want to have an initial update on subscribe if the message exists already? Defaults to true.
 void setWantLocal(boolean local)
          Defaults to true.
 void setWantMeta(boolean meta)
          Defaults to true.
 void setWantNotify(boolean notify)
          Set to true if you want an erase notification if the topic is explicitly erased.
 void setWantUpdateOneway(boolean updateOneway)
          Do we want the callback message delivered with update() or with updateOneway()? Defaults to false.
 java.lang.String toString()
           
 java.lang.String toXml()
          Dump state of this object into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset)
           
 java.lang.String toXml(java.lang.String extraOffset, java.util.Properties props)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class org.xmlBlaster.util.qos.QosData
addClientProperty, addClientProperty, addClientProperty, addClientProperty, addClientProperty, addClientProperty, addClientProperty, addClientProperty, addClientProperty, addClientProperty, addRouteInfo, clearRoutes, count, dirtyRead, getClientProperties, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientProperty, getClientPropertyArr, getContentCharset, getContentStr, getContentStrNoEx, getGlobal, getMethod, getNumRouteNodes, getPersistentProp, getRcvTime, getRcvTimestamp, getRcvTimestampNotNull, getRouteNodes, getSender, getState, getStateInfo, hasStateInfo, isAtMaster, isErase, isErased, isForwardError, isFromPersistenceRecovery, isFromPersistenceRecovery, isGet, isOk, isPersistent, isPublish, isSubscribe, isTimeout, isUnSubscribe, isUpdate, propertyExists, setMethod, setPersistent, setRcvTimestamp, setSender, setState, setStateInfo, size, touchRcvTimestamp, toXmlReadable, writePropertiesXml, writePropertiesXml
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryQosData

public QueryQosData(Global glob,
                    MethodName methodName)
true if query has to be /** Constructs the specialized quality of service object for query informations. E.g. for a subscribe() call

Parameters:
The - factory which knows how to serialize and parse me

QueryQosData

public QueryQosData(Global glob,
                    I_QueryQosFactory factory,
                    MethodName methodName)
Constructs the specialized quality of service object for query informations. E.g. for a subscribe() call

Parameters:
The - factory which knows how to serialize and parse me

QueryQosData

public QueryQosData(Global glob,
                    I_QueryQosFactory factory,
                    java.lang.String serialData,
                    MethodName methodName)
Constructs the specialized quality of service object for a publish() call. For internal use only, this message is sent from the persistence layer

Parameters:
the - XML based ASCII string
true -
Method Detail

getMultiSubscribe

public boolean getMultiSubscribe()
Allow to subscribe multiple times to the same query/oid

Returns:
defaults to true

getMultiSubscribeProp

public PropBoolean getMultiSubscribeProp()

setMultiSubscribe

public void setMultiSubscribe(boolean multiSubscribe)

setWantInitialUpdate

public void setWantInitialUpdate(boolean initialUpdate)
Do we want to have an initial update on subscribe if the message exists already? Defaults to true.

See Also:
The engine.qos.subscribe.initialUpdate requirement

getWantInitialUpdate

public boolean getWantInitialUpdate()
Defaults to true.


getInitialUpdateProp

public PropBoolean getInitialUpdateProp()

setWantUpdateOneway

public void setWantUpdateOneway(boolean updateOneway)
Do we want the callback message delivered with update() or with updateOneway()? Defaults to false.

See Also:
The interface.subscribe requirement

getWantUpdateOneway

public boolean getWantUpdateOneway()
Defaults to true.


getUpdateOnewayProp

public PropBoolean getUpdateOnewayProp()

newestOnly

public boolean newestOnly()
if __newestOnly client property is true remove older instances from callback queue of client


setNewestOnly

public void setNewestOnly(boolean newestOnly)

setWantNotify

public void setWantNotify(boolean notify)
Set to true if you want an erase notification if the topic is explicitly erased.

Parameters:
notify - Defaults to true.

getWantNotify

public boolean getWantNotify()
For erase(): Notify the subscribers on erase? Defaults to true.


getNotifyProp

public PropBoolean getNotifyProp()

setWantLocal

public void setWantLocal(boolean local)
Defaults to true.

Parameters:
setWantLocal - false Inhibit the dispatch of messages to myself if i have published it.

getWantLocal

public boolean getWantLocal()
Defaults to true.

Returns:
false Inhibit the dispatch of messages to myself if i have published it.

getLocalProp

public PropBoolean getLocalProp()

setWantMeta

public void setWantMeta(boolean meta)
Defaults to true.

Parameters:
meta - false: Don't send me the meta information of a message key

getWantMeta

public boolean getWantMeta()
Defaults to true.

Returns:
false: Don't send me the meta information of a message key

getMetaProp

public PropBoolean getMetaProp()

setWantContent

public void setWantContent(boolean content)
Defaults to true. If false, the update contains not the content (it is a notify of change only) TODO: Implement in server!!!


getWantContent

public boolean getWantContent()
Defaults to true.


getContentProp

public PropBoolean getContentProp()

setForceDestroy

public void setForceDestroy(boolean forceDestroy)
Topic erase behavior with pending messages, defaults to false.

Parameters:
forceDestroy -
See Also:
engine.message.lifecycle requirement

getForceDestroy

public boolean getForceDestroy()
Defaults to false.

Returns:
Topic erase behavior with pending messages
See Also:
engine.message.lifecycle requirement

getForceDestroyProp

public PropBoolean getForceDestroyProp()

setFilters

public void setFilters(AccessFilterQos[] newFilters)

addAccessFilter

public void addAccessFilter(AccessFilterQos filter)
Adds your supplied subscribe filter


getAccessFilters

public java.util.ArrayList getAccessFilters()

getAccessFilterArr

public AccessFilterQos[] getAccessFilterArr()
Return the subscribe filters or null if none is specified.


addQuerySpec

public void addQuerySpec(QuerySpecQos querySpec)
Adds the querySpec you supplied.


getQuerySpecs

public java.util.ArrayList getQuerySpecs()

getQuerySpecArr

public QuerySpecQos[] getQuerySpecArr()
Return the subscribe filters or null if none is specified.


setHistoryQos

public void setHistoryQos(HistoryQos historyQos)
Set the QoS which describes the history query settings.


getHistoryQos

public HistoryQos getHistoryQos()
Get the QoS which describes the history query settings.

Returns:
never null

containsHistoryQos

public boolean containsHistoryQos()
Was a history qos specified?


getSubscriptionId

public java.lang.String getSubscriptionId()
Get the identifier (unique handle) for this subscription.

Returns:
The id or null if not specified by client.
See Also:
The engine.qos.subscribe.id requirement

hasSubscriptionId

public boolean hasSubscriptionId()
Returns:
true if the client has forced a subscriptionId

setSubscriptionId

public void setSubscriptionId(java.lang.String subscriptionId)
Force the identifier (unique handle) for this subscription. Usually you let the identifier be generated by xmlBlaster.

See Also:
The engine.qos.subscribe.id requirement

generateSubscriptionId

public java.lang.String generateSubscriptionId(SessionName sessionName,
                                               QueryKeyData subscribeKey)
A client side subscriptionId must start with "__subId:" followed by the relative session name.

This us only useful for positive session Ids in fail save environments: if the subscription is queued the faked subscriptionId will be used later by the server

Parameters:
sessionName -
subscribeKey -
Returns:
e.g. "__subId:client/joe/session/1-XPATH://key" for pubSessionId>0 and multiSubscribe=false or e.g. "__subId:client/joe-135692304540000" in other cases

toXml

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

Specified by:
toXml in class QosData
Returns:
internal state of the query as a XML ASCII string

toXml

public java.lang.String toXml(java.lang.String extraOffset)

toXml

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

Specified by:
toXml in class QosData
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 deep clone, you can change savely all basic or immutable types like boolean, String, int and also the ClientProperties and RouteInfo.

Overrides:
clone in class QosData

setGlobal

public void setGlobal(Global glob)
Sets the global object (used when deserializing the object)

Overrides:
setGlobal in class QosData

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.