public class SubscriptionLink extends java.lang.Object implements ComplexObjectNameLink, java.io.Serializable
Represents a user subscription within the Liberator. A user subscription is a relationship between a particular user session and the cached object that the client has subscribed to.
If this object is obtained from a user session MBean, the getObjectName()
method will return the ObjectName of the cached object this subscription represents. If this object is obtainined from a cached object MBean, the getObjectName()
method will return the ObjectName of the user session.
In addition to information about the user session and the cached object, this object also provides the method, getSubscriptionId()
, which returns the subscription identifier, which is unique within a particular user session, and a method, getSubscriptionName()
, which returns the name of the object that the client actually subscribed to.
The user session identifier and subscription identifier together uniquely indentify a particular subscription. Neither the subscription name, nor cached object name, can be used to uniquely identify a subscription since it is possible for a client to register multiple subscriptions for the same object.
Subscription data examples:
Session Id | Subscription Id | Subscription Name | Cached Object Name |
---|---|---|---|
1FEDCB | 0001 | /DEMO/MSFT | /DEMO/MSFT |
1FEDCB | 0002 | /DEMO/CSCO | /DEMO/CSCO |
098765 | 0001 | /DEMO/MSFT | /DELAYED/DEMO/MSFT |
098765 | 0003 | /DEMO/MSFT | /DELAYED/DEMO/MSFT |
Further information about a specific subscription, such as its current throttle level and update count, can be obtained by invoking operations on the helper MBean which can be obtained via the ObjectName returned by getHelperObjectName()
.
Constructor and Description |
---|
SubscriptionLink(boolean linkFromSession,
javax.management.ObjectName cachedObjectObjectName,
javax.management.ObjectName sessionObjectName,
javax.management.ObjectName helperObjectName,
java.lang.String cachedObject,
java.lang.String sessionId,
java.lang.String subscriptionId,
java.lang.String subscriptionName)
Constructs the SubscriptionLink with the specified arguments.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Compares this SubscriptionLink to another one.
|
java.lang.String |
getCachedObject()
Gets the name of the cached object this subscription is for.
|
javax.management.ObjectName |
getCachedObjectObjectName()
Gets the ObjectName of the cached object MBean this object links to.
|
javax.management.ObjectName |
getHelperObjectName()
Gets the
ObjectName of the MBean that can be used to get additonal information about the relationship represented by this object. |
java.lang.String |
getLinkName()
Gets a human readable name for the MBean that this instance of ObjectNameLink represents a link to.
|
javax.management.ObjectName |
getObjectName()
Gets the
ObjectName of the MBean that this instance of ObjectNameLink represents a link to. |
java.lang.String |
getSessionId()
Gets the unique identifier for the session this subscription has been made from.
|
javax.management.ObjectName |
getSessionObjectName()
Gets the ObjectName of the user session MBean this object links to.
|
java.lang.String |
getSubscriptionId()
Gets the unique identifier for the session this subscription has been made from.
|
java.lang.String |
getSubscriptionName()
Gets the name of the object subscribed to by the client.
|
int |
hashCode()
Returns a hash code value for the object.
|
java.lang.String |
toString()
Returns the human readable name of the linked MBean, as returned by
getLinkName() . |
public SubscriptionLink(boolean linkFromSession, javax.management.ObjectName cachedObjectObjectName, javax.management.ObjectName sessionObjectName, javax.management.ObjectName helperObjectName, java.lang.String cachedObject, java.lang.String sessionId, java.lang.String subscriptionId, java.lang.String subscriptionName)
Constructs the SubscriptionLink with the specified arguments.
linkFromSession
- true
if this SubscriptionLink represents a link from a session to a cached object, otherwise false
.cachedObjectObjectName
- The ObjectName of the cached object MBean this object links to.sessionObjectName
- The ObjectName of the user session MBean this object links to.helperObjectName
- The ObjectName of the helper MBean that should be used to obtain more information about the relationship this object represents.cachedObject
- The name of the cached object this subscription is for.sessionId
- The unique identifier for the session this subscription has been made from.subscriptionId
- The unique identifier for the session this subscription has been made from.subscriptionName
- The name of the object subscribed to by the client.java.lang.IllegalArgumentException
- If any of the arguments are null
.public javax.management.ObjectName getObjectName()
ObjectNameLink
Gets the ObjectName
of the MBean that this instance of ObjectNameLink represents a link to.
getObjectName
in interface ObjectNameLink
ObjectName
of the linked object.public java.lang.String getLinkName()
ObjectNameLink
Gets a human readable name for the MBean that this instance of ObjectNameLink represents a link to.
getLinkName
in interface ObjectNameLink
public javax.management.ObjectName getCachedObjectObjectName()
Gets the ObjectName of the cached object MBean this object links to.
public javax.management.ObjectName getSessionObjectName()
Gets the ObjectName of the user session MBean this object links to.
public javax.management.ObjectName getHelperObjectName()
ComplexObjectNameLink
Gets the ObjectName
of the MBean that can be used to get additonal information about the relationship represented by this object.
getHelperObjectName
in interface ComplexObjectNameLink
public java.lang.String getCachedObject()
Gets the name of the cached object this subscription is for.
public java.lang.String getSessionId()
Gets the unique identifier for the session this subscription has been made from.
public java.lang.String getSubscriptionId()
Gets the unique identifier for the session this subscription has been made from.
public java.lang.String getSubscriptionName()
Gets the name of the object subscribed to by the client. Typically, this would be identical to the cached object name, however an advanced feature within the Liberator allows the object requested by the client to be mapped onto a different object name (e.g. /DEMO/MSFT
may be mapped onto /DELAYED/DEMO/MSFT
).
public boolean equals(java.lang.Object object)
Compares this SubscriptionLink to another one.
equals
in class java.lang.Object
object
- The object to be compared against.true
if the specified object is a SubscriptionLink and its getObjectName()
, getCachedObjectObjectName()
, getSessionObjectName()
, getHelperObjectName()
, getCachedObject()
, getSessionId()
, getSubscriptionId()
and getSubscriptionName()
values are equals to those of this SubscriptionLink.public int hashCode()
Returns a hash code value for the object.
hashCode
in class java.lang.Object
public java.lang.String toString()
Returns the human readable name of the linked MBean, as returned by getLinkName()
.
toString
in class java.lang.Object
Please send bug reports and comments to Caplin support