|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.qos.QosData org.xmlBlaster.util.qos.MsgQosData
public final class MsgQosData
Data container handling of publish() and update() quality of services.
QoS Informations sent from the client to the server via the publish() method and back via the update() methodThis data holder is accessible through 4 decorators, each of them allowing a specialized view on the data:
For the xml representation see MsgQosSaxFactory.
MsgQosSaxFactory
,
org.xmlBlaster.test.classtest.qos.MsgQosFactoryTest
,
The interface.publish requirement,
Serialized FormField Summary | |
---|---|
static boolean |
DEFAULT_administrative
|
static boolean |
DEFAULT_forceDestroy
|
static boolean |
DEFAULT_forceUpdate
Send message to subscriber even the content is the same as the previous? Default is that xmlBlaster does send messages to subscribed clients, even the content didn't change. |
static boolean |
DEFAULT_isSubscribable
|
static long |
DEFAULT_lifeTime
|
protected Destination[] |
destinationArrCache
|
protected java.util.ArrayList |
destinationList
ArrayList for loginQoS, holding all destination addresses (Destination objects) |
static Destination[] |
EMPTY_DESTINATION_ARR
|
Fields inherited from class org.xmlBlaster.util.qos.QosData |
---|
DEFAULT_persistent, glob, rcvTimestamp, routeNodeList, routeNodes, serialData |
Constructor Summary | |
---|---|
MsgQosData(Global glob,
I_MsgQosFactory factory,
MethodName methodName)
Constructs the specialized quality of service object for a publish() or update() call. |
|
MsgQosData(Global glob,
I_MsgQosFactory factory,
java.lang.String serialData,
MethodName methodName)
Constructs the specialized quality of service object for a publish() call. |
|
MsgQosData(Global glob,
MethodName methodName)
Constructs the specialized quality of service object for a publish() or update() call. |
Method Summary | |
---|---|
void |
addDestination(Destination destination)
Add a destination. |
java.lang.Object |
clone()
Returns a partly deep clone, you can change safely all basic or immutable types like boolean, String, int. |
PropBoolean |
getAdministrativeProp()
|
Destination[] |
getDestinationArr()
|
java.util.ArrayList |
getDestinations()
Get all the destinations of this message. |
PropBoolean |
getForceDestroyProp()
|
PropBoolean |
getForceUpdateProp()
|
long |
getLifeTime()
The life time of the message or -1L if forever |
PropLong |
getLifeTimeProp()
|
static long |
getMaxLifeTime()
The server default for max. |
int |
getNumDestinations()
|
PriorityEnum |
getPriority()
Message priority. |
long |
getQueueIndex()
|
long |
getQueueSize()
|
java.lang.String |
getRcvTime()
Deprecated. Use getXmlRcvTimestamp() |
int |
getRedeliver()
Returns > 0 if the message probably is redelivered. |
long |
getRemainingLife()
|
long |
getRemainingLifeStatic()
This is the value delivered in the QoS (as it was calculated by the server on sending) and is NOT dynamically recalculated. |
PropBoolean |
getSubscribableProp()
|
java.lang.String |
getSubscriptionId()
If Pub/Sub style update: contains the subscribe ID which caused this update |
TopicProperty |
getTopicProperty()
The configuration for the TopicHandler (topic) |
java.lang.String |
getXmlRcvTimestamp()
Tagged form of message receive, e.g.: <rcvTimestamp nanos='1007764305862000004'/> |
boolean |
hasTopicProperty()
The getTopicProperty() creates an initial TopicHandler, this method allows to check without creation |
void |
incrRedeliver()
Increment the redeliver counter |
boolean |
isAdministrative()
|
boolean |
isExpired()
Calculates if we are expired |
boolean |
isForceDestroy()
|
boolean |
isForceUpdate()
|
boolean |
isFromPersistenceStore()
Internal use only, is this message sent from the persistence layer? |
boolean |
isPtp()
Test if Point to Point addressing style is used. |
boolean |
isReadonly()
|
boolean |
isSubscribable()
Test if Publish/Subscribe style is used. |
boolean |
isVolatile()
|
static void |
main(java.lang.String[] args)
|
void |
removeDestination(Destination destination)
Remove a destination. |
void |
setAdministrative(boolean administrative)
Marks a message to be administrative only, in this case the topic is configured only. |
void |
setForceDestroy(boolean forceDestroy)
Control message life cycle on message expiry, defaults to false. |
void |
setForceUpdate(boolean forceUpdate)
Send message to subscriber even if the content is the same as the previous. |
void |
setFromPersistenceStore(boolean fromPersistenceStore)
Internal use only, set if this message sent from the persistence layer |
void |
setGlobal(Global glob)
Sets the global object (used when deserializing the object) |
void |
setLifeTime(long lifeTime)
Control the life time of a message. |
void |
setPriority(PriorityEnum priority)
Set message priority value, PriorityEnum.NORM_PRIORITY (5) is default. |
void |
setQueueIndex(long queueIndex)
|
void |
setQueueSize(long queueSize)
|
void |
setReadonly(boolean readonly)
|
void |
setRedeliver(int redeliver)
Set > 0 if the message probably is redelivered (number of retries). |
void |
setRemainingLifeStatic(long remainingLifeStatic)
|
void |
setSubscribable(boolean isSubscribable)
|
void |
setSubscriptionId(java.lang.String subscriptionId)
If Pub/Sub style update: contains the subscribe ID which caused this update |
void |
setTopicProperty(TopicProperty topicProperty)
|
void |
setVolatile(boolean volatileFlag)
|
java.util.Hashtable |
toJXPath()
Dump the QoS to a flattened JXPath representation. |
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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final transient boolean DEFAULT_isSubscribable
public static final transient boolean DEFAULT_forceUpdate
public static final long DEFAULT_lifeTime
public static final transient boolean DEFAULT_administrative
public static final transient boolean DEFAULT_forceDestroy
protected java.util.ArrayList destinationList
protected transient Destination[] destinationArrCache
public static final Destination[] EMPTY_DESTINATION_ARR
Constructor Detail |
---|
public MsgQosData(Global glob, MethodName methodName)
public MsgQosData(Global glob, I_MsgQosFactory factory, MethodName methodName)
factory
- The factory which knows how to serialize and parse mepublic MsgQosData(Global glob, I_MsgQosFactory factory, java.lang.String serialData, MethodName methodName)
the
- XML based ASCII stringMethod Detail |
---|
public void setSubscribable(boolean isSubscribable)
isSubscribable()
public boolean isSubscribable()
public PropBoolean getSubscribableProp()
public boolean isPtp()
public void setVolatile(boolean volatileFlag)
volatile
- true sets lifeTime=0 and forceDestroy=falsepublic boolean isVolatile()
public void setSubscriptionId(java.lang.String subscriptionId)
subscriptionId
- null if PtP messagepublic java.lang.String getSubscriptionId()
public void setForceUpdate(boolean forceUpdate)
forceUpdate
- public boolean isForceUpdate()
public PropBoolean getForceUpdateProp()
public void setReadonly(boolean readonly)
public boolean isReadonly()
public void setRedeliver(int redeliver)
redeliver
- if == 0 The message is guaranteed to be delivered only once.public void incrRedeliver()
public int getRedeliver()
public void setQueueSize(long queueSize)
queueSize
- The number of queued messagespublic long getQueueSize()
public void setQueueIndex(long queueIndex)
queueIndex
- The index of the message in the queuepublic long getQueueIndex()
public PriorityEnum getPriority()
PriorityEnum
public void setPriority(PriorityEnum priority)
PriorityEnum
public boolean isFromPersistenceStore()
public void setFromPersistenceStore(boolean fromPersistenceStore)
true/false
- public long getLifeTime()
public PropLong getLifeTimeProp()
public void setLifeTime(long lifeTime)
lifeTime
- The life time of the message or -1L if forever.
Setting to 0 will behave as a volatile message (see setVolatile()) and the message will be invisible directly after being pushed into the subscribers callback queues, in the callback queues it will stay until retrieved by the subscriber.
Setting it to a value > 0 will expire the message after the given milliseconds, even if they remain in any callback queue.
public long getRemainingLife()
public long getRemainingLifeStatic()
public void setRemainingLifeStatic(long remainingLifeStatic)
public boolean isExpired()
public static long getMaxLifeTime()
public java.lang.String getXmlRcvTimestamp()
Timestamp
public java.lang.String getRcvTime()
getRcvTime
in class QosData
public void setForceDestroy(boolean forceDestroy)
forceDestroy
- true Force message destroy on message expirepublic boolean isForceDestroy()
public PropBoolean getForceDestroyProp()
public void setAdministrative(boolean administrative)
administrative
- true The message is only used to configure the topicPriorityEnum
public boolean isAdministrative()
public PropBoolean getAdministrativeProp()
public java.util.ArrayList getDestinations()
if (isPtp()) ...
before calling this method
public int getNumDestinations()
public Destination[] getDestinationArr()
public void addDestination(Destination destination)
public void removeDestination(Destination destination)
public boolean hasTopicProperty()
public TopicProperty getTopicProperty()
public void setTopicProperty(TopicProperty topicProperty)
The
- new topicProperty, usually you should create the instance with getTopicProperty()
to not loose any readonly settings.public java.util.Hashtable toJXPath()
This is experimental code for the simple Applet client
/qos/rcvTimestamp/@nanos -> 1042815836675000001 /qos/methodName/text() -> update /qos/clientProperty[@name='myAge']/text() -> 12 /qos/state/@id -> OK
Currently only an UpdateQos dump is supported
public java.lang.String toXml()
toXml
in class QosData
public java.lang.String toXml(java.lang.String extraOffset)
public java.lang.String toXml(java.lang.String extraOffset, java.util.Properties props)
toXml
in class QosData
extraOffset
- indenting of tags for nice outputforceReadable
- If true, any base64 is decoded to be more human readable
public java.lang.Object clone()
clone
in class QosData
public void setGlobal(Global glob)
setGlobal
in class QosData
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |