|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.engine.SubscriptionInfo
public final class SubscriptionInfo
This is a container to hold references on all interesting data concerning a subscription of exactly one topic from exactly one client.
Field Summary | |
---|---|
private java.util.ArrayList |
childrenList
It it is a query subscription, we remember all subscriptions which resulted from this query |
private ContextNode |
contextNode
|
private long |
creationTime
|
private ServerScope |
glob
The global handle |
private boolean |
isShutdown
|
private KeyData |
keyData
reference to keyData |
private static java.util.logging.Logger |
log
Logging to channel "core" |
private JmxMBeanHandle |
mbeanHandle
My JMX registration |
private java.lang.String |
ME
|
private long |
persistenceId
uniqueId used to store this in queue |
private SubscriptionInfo |
querySub
A reference to the query subscription (XPATH), which created this subscription If the subscription was EXACT, querySub is null |
private SessionInfo |
sessionInfo
The initiatior of this subscription |
private int |
subscribeCounter
If duplicateUpdates=false is set we can check here how often this message is subscribed from the same client |
private SubscribeQosServer |
subscribeQos
reference to 'Quality of Service' of subscribe() / unSubscribe() |
private TopicHandler |
topicHandler
reference to my managing container |
private java.lang.String |
uniqueKey
The unique key of a subscription (subscriptionId), which is a function of f(keyData,xmlQos). |
private java.util.Map<java.lang.String,java.lang.Object> |
userMap
Map to store arbitrary info about the topic to client relation, is cleaned up automatically when unSubscribe happens Useful for example for plugins |
Constructor Summary | |
---|---|
SubscriptionInfo(ServerScope glob,
SessionInfo sessionInfo,
KeyData keyData,
SubscribeQosServer qos)
Use this constructor for an exact subscription. |
|
SubscriptionInfo(ServerScope glob,
SessionInfo sessionInfo,
SubscriptionInfo querySub,
KeyData keyData)
Use this constructor it the subscription is a result of a XPath subscription |
Method Summary | |
---|---|
void |
addSubscription(SubscriptionInfo subs)
For this query subscription remember all resulted child subscriptions |
void |
addTopicHandler(TopicHandler topicHandler)
This must be called as soon as my TopicHandler handles me. |
void |
decrSubscribeCounter()
If same client subscribes multiple times on same topic but wants to suppress multi-updates (e.g. |
private static java.lang.String |
generateUniqueKey(KeyData keyData,
QueryQosData xmlQos,
boolean clusterWideUnique)
This static method may be used from external objects to get the unique key of a subscription. |
AccessFilterQos[] |
getAccessFilterArr()
|
java.lang.String[] |
getAccessFilters()
Access the filter QoS of this subscription. |
SubscriptionInfo[] |
getChildrenSubscriptions()
For this query subscription return all resulted subscriptions |
long |
getCreationTime()
Time when this Subscription is invoked. |
java.lang.String |
getCreationTimestamp()
Get the human readable timestamp when this subscription was established. |
java.lang.String[] |
getDependingSubscriptions()
Get my depending subscriptions (childrens), usually caused by an XPATH subscription. |
java.lang.String |
getId()
Access the unique identifier of this subscription. |
KeyData |
getKeyData()
Access on KeyData object |
java.lang.String |
getKeyOid()
The oid of the message we belong to |
I_Queue |
getMsgQueue()
My destination queue. |
java.lang.String |
getParentSubscription()
Get the parent subscription ID. |
long |
getPersistenceId()
Gets the uniqueId for the persistence of this session. |
QueryQosData |
getQueryQosData()
Access on SubscribeQosServer object |
java.util.Map |
getQueryQosDataClientProperties()
|
SessionInfo |
getSessionInfo()
The session info of the client who initiated this subscription |
java.lang.String |
getSessionName()
Get the session name of the subscriber. |
int |
getSubscribeCounter()
If same client subscribes multiple times on same topic but wants to suppress multi-updates (e.g. |
java.lang.String |
getSubscribeKeyStr()
Get the subscription key. |
SubscribeQosServer |
getSubscribeQosServer()
|
java.lang.String |
getSubscribeQosStr()
Get the configuration for this subscription. |
java.lang.String |
getSubscriptionId()
Accessing a unique subscription id generated for this SubscriptionInfo. |
java.lang.String |
getSubSourceSubscriptionId()
Accessing the unique subscription id from method subscribe(), which was the reason for this SubscriptionInfo |
TopicHandler |
getTopicHandler()
|
java.lang.String |
getTopicId()
Get the subscribed topic. |
java.lang.String |
getUsageUrl()
JMX |
java.lang.Object |
getUserObject(java.lang.String key,
java.lang.Object defaultValue)
Map to store arbitrary info about the topic to client relation, is cleaned up automatically when unSubscribe happens Useful for example for plugins |
java.util.Map<java.lang.String,java.lang.Object> |
getUserObjectMap()
Use carefully to not harm other plugins. |
boolean |
hasUserObject(java.lang.String key)
|
void |
incrSubscribeCounter()
If same client subscribes multiple times on same topic but wants to suppress multi-updates (e.g. |
private void |
init(ServerScope glob,
SessionInfo sessionInfo,
KeyData keyData,
SubscribeQosServer qos)
|
private void |
initSubscriptionId()
For JMX the uniqueKey may not contain commas ','. |
boolean |
isCreatedByQuerySubscription()
If true this is a child. |
boolean |
isExact()
|
boolean |
isQuery()
|
boolean |
isShutdown()
|
(package private) static boolean |
isSubscribeId(java.lang.String id)
Test if this id is a subscribeId (starts with "__subId:") |
void |
removeChildSubscription(SubscriptionInfo subs)
For this query subscription remember all resulted subscriptions |
(package private) void |
removeSubscribe()
Telling my container that i am not subscribing any more. |
void |
setPersistenceId(long persistenceId)
Sets the uniqueId used to retrieve this session from the persistence |
void |
setUsageUrl(java.lang.String url)
|
java.lang.Object |
setUserObject(java.lang.String key,
java.lang.Object value)
The key should use a prefix to not collide with other users / plugins. |
void |
shutdown()
Cleanup subscription. |
java.lang.String |
toString()
|
java.lang.String |
toXml()
Dump state of this object into XML. |
java.lang.String |
toXml(java.lang.String extraOffset)
Dump state of this object into XML. |
java.lang.String |
toXmlSmall(java.lang.String extraOffset)
Dump state of this object into XML. |
void |
update(SubscribeQosServer newQos)
Supports limited reconfiguration with the given newQos. |
java.lang.String |
usage()
JMX |
static void |
verifySubscriptionId(boolean isClusterNode,
SessionName sessionName,
QueryKeyData xmlKey,
SubscribeQosServer subscribeQos)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String ME
private ContextNode contextNode
private ServerScope glob
private static java.util.logging.Logger log
private SessionInfo sessionInfo
private KeyData keyData
private SubscribeQosServer subscribeQos
private java.lang.String uniqueKey
private TopicHandler topicHandler
private SubscriptionInfo querySub
private java.util.ArrayList childrenList
private java.util.Map<java.lang.String,java.lang.Object> userMap
private int subscribeCounter
private long creationTime
private long persistenceId
private JmxMBeanHandle mbeanHandle
private boolean isShutdown
Constructor Detail |
---|
public SubscriptionInfo(ServerScope glob, SessionInfo sessionInfo, KeyData keyData, SubscribeQosServer qos) throws XmlBlasterException
sessionInfo
- The session which initiated this subscriptionkeyData
- The message meta infoqos
- This may be a SubscribeQosServer or a UnSubscribeQosServer instance
XmlBlasterException
public SubscriptionInfo(ServerScope glob, SessionInfo sessionInfo, SubscriptionInfo querySub, KeyData keyData) throws XmlBlasterException
sessionInfo
- The session which initiated this subscriptionquerySub
- The XPATH query subscription which is has us as a childkeyData
- The matching key for the above querySub
XmlBlasterException
Method Detail |
---|
private void init(ServerScope glob, SessionInfo sessionInfo, KeyData keyData, SubscribeQosServer qos) throws XmlBlasterException
XmlBlasterException
public java.lang.String toString()
toString
in class java.lang.Object
public void incrSubscribeCounter()
public void decrSubscribeCounter()
public int getSubscribeCounter()
public SessionInfo getSessionInfo()
public I_Queue getMsgQueue()
public void addSubscription(SubscriptionInfo subs)
public void removeChildSubscription(SubscriptionInfo subs)
public SubscriptionInfo[] getChildrenSubscriptions()
public boolean isQuery()
public boolean isExact()
public boolean isCreatedByQuerySubscription()
public AccessFilterQos[] getAccessFilterArr()
public void addTopicHandler(TopicHandler topicHandler)
topicHandler
- I'm handled (lifetime) by this handlerpublic TopicHandler getTopicHandler()
public long getCreationTime()
void removeSubscribe()
public KeyData getKeyData()
public java.lang.String getKeyOid()
public QueryQosData getQueryQosData()
public java.util.Map getQueryQosDataClientProperties()
public void update(SubscribeQosServer newQos)
newQos
- The new QueryQosData to usepublic SubscribeQosServer getSubscribeQosServer()
public java.lang.String getSubscriptionId()
private void initSubscriptionId() throws XmlBlasterException
XmlBlasterException
public java.lang.String getSubSourceSubscriptionId() throws XmlBlasterException
XmlBlasterException
public void shutdown()
public boolean isShutdown()
static boolean isSubscribeId(java.lang.String id)
private static java.lang.String generateUniqueKey(KeyData keyData, QueryQosData xmlQos, boolean clusterWideUnique) throws XmlBlasterException
clusterWideUnique
- If false the key is unique for this xmlBlaster instance only
__subId:heron-53
XmlBlasterException
org.xmlBlaster.util.qos.QueryQosData#generateSubscriptionId(String)
public static void verifySubscriptionId(boolean isClusterNode, SessionName sessionName, QueryKeyData xmlKey, SubscribeQosServer subscribeQos) throws XmlBlasterException
sessionName
- xmlKey
- subscribeQos
-
XmlBlasterException
org.xmlBlaster.util.qos.QueryQosData#generateSubscriptionId(String)
,
generateUniqueKey
public java.lang.String toXml()
public java.lang.String toXml(java.lang.String extraOffset)
extraOffset
- indenting of tags
public java.lang.String toXmlSmall(java.lang.String extraOffset)
<subscribe id='_subId:1' sessionName='/node/heron/client/joe/-2' oid='HelloWorld' parent='_sub:XPATH-2'/>
extraOffset
- indenting of tags
public final long getPersistenceId()
getPersistenceId
in interface I_AdminSubscription
public final void setPersistenceId(long persistenceId)
persistenceId
- public java.lang.String getId()
I_AdminSubscription
getId
in interface I_AdminSubscription
public java.lang.String getSessionName()
I_AdminSubscription
getSessionName
in interface I_AdminSubscription
public java.lang.String getTopicId()
I_AdminSubscription
getTopicId
in interface I_AdminSubscription
public java.lang.String getParentSubscription()
I_AdminSubscription
getParentSubscription
in interface I_AdminSubscription
public java.lang.String getCreationTimestamp()
I_AdminSubscription
getCreationTimestamp
in interface I_AdminSubscription
public java.lang.String getSubscribeQosStr()
I_AdminSubscription
getSubscribeQosStr
in interface I_AdminSubscription
public java.lang.String getSubscribeKeyStr()
I_AdminSubscription
getSubscribeKeyStr
in interface I_AdminSubscription
public java.lang.String[] getAccessFilters()
I_AdminSubscription
getAccessFilters
in interface I_AdminSubscription
public java.lang.String[] getDependingSubscriptions()
I_AdminSubscription
getDependingSubscriptions
in interface I_AdminSubscription
public java.lang.String usage()
usage
in interface I_AdminUsage
public java.lang.String getUsageUrl()
getUsageUrl
in interface I_AdminUsage
public void setUsageUrl(java.lang.String url)
setUsageUrl
in interface I_AdminUsage
public java.lang.Object getUserObject(java.lang.String key, java.lang.Object defaultValue)
public boolean hasUserObject(java.lang.String key)
public java.lang.Object setUserObject(java.lang.String key, java.lang.Object value)
key
- value
-
public java.util.Map<java.lang.String,java.lang.Object> getUserObjectMap()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |