Class SubscriptionLink
- All Implemented Interfaces:
ComplexObjectNameLink
,ObjectNameLink
,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()
.
- See Also:
-
Constructor Summary
ConstructorDescriptionSubscriptionLink
(boolean linkFromSession, ObjectName cachedObjectObjectName, ObjectName sessionObjectName, ObjectName helperObjectName, String cachedObject, String sessionId, String subscriptionId, String subscriptionName) Constructs the SubscriptionLink with the specified arguments. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this SubscriptionLink to another one.Gets the name of the cached object this subscription is for.Gets the ObjectName of the cached object MBean this object links to.Gets theObjectName
of the MBean that can be used to get additonal information about the relationship represented by this object.Gets a human readable name for the MBean that this instance of ObjectNameLink represents a link to.Gets theObjectName
of the MBean that this instance of ObjectNameLink represents a link to.Gets the unique identifier for the session this subscription has been made from.Gets the ObjectName of the user session MBean this object links to.Gets the unique identifier for the session this subscription has been made from.Gets the name of the object subscribed to by the client.int
hashCode()
Returns a hash code value for the object.toString()
Returns the human readable name of the linked MBean, as returned bygetLinkName()
.
-
Constructor Details
-
SubscriptionLink
public SubscriptionLink(boolean linkFromSession, ObjectName cachedObjectObjectName, ObjectName sessionObjectName, ObjectName helperObjectName, String cachedObject, String sessionId, String subscriptionId, String subscriptionName) Constructs the SubscriptionLink with the specified arguments.
- Parameters:
linkFromSession
-true
if this SubscriptionLink represents a link from a session to a cached object, otherwisefalse
.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.- Throws:
IllegalArgumentException
- If any of the arguments arenull
.
-
-
Method Details
-
getObjectName
Description copied from interface:ObjectNameLink
Gets the
ObjectName
of the MBean that this instance of ObjectNameLink represents a link to.- Specified by:
getObjectName
in interfaceObjectNameLink
- Returns:
- The
ObjectName
of the linked object.
-
getLinkName
Description copied from interface:ObjectNameLink
Gets a human readable name for the MBean that this instance of ObjectNameLink represents a link to.
- Specified by:
getLinkName
in interfaceObjectNameLink
- Returns:
- A human readable name for the linked object.
-
getCachedObjectObjectName
Gets the ObjectName of the cached object MBean this object links to.
- Returns:
- The ObjectName of the cached object MBean this object links to.
-
getSessionObjectName
Gets the ObjectName of the user session MBean this object links to.
- Returns:
- The ObjectName of the user session MBean this object links to.
-
getHelperObjectName
Description copied from interface:ComplexObjectNameLink
Gets the
ObjectName
of the MBean that can be used to get additonal information about the relationship represented by this object.- Specified by:
getHelperObjectName
in interfaceComplexObjectNameLink
- Returns:
- The ObjectName of the MBean that
-
getCachedObject
Gets the name of the cached object this subscription is for.
- Returns:
- The name of the cached object this subscription is for.
-
getSessionId
Gets the unique identifier for the session this subscription has been made from.
- Returns:
- The unique identifier for the session this subscription has been made from.
-
getSubscriptionId
Gets the unique identifier for the session this subscription has been made from.
- Returns:
- The unique identifier for the session this subscription has been made from.
-
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
).- Returns:
- The name of the object subscribed to by the client.
-
equals
Compares this SubscriptionLink to another one.
- Overrides:
equals
in classObject
- Parameters:
object
- The object to be compared against.- Returns:
true
if the specified object is a SubscriptionLink and itsgetObjectName()
,getCachedObjectObjectName()
,getSessionObjectName()
,getHelperObjectName()
,getCachedObject()
,getSessionId()
,getSubscriptionId()
andgetSubscriptionName()
values are equals to those of this SubscriptionLink.
-
hashCode
public int hashCode()Returns a hash code value for the object.
-
toString
Returns the human readable name of the linked MBean, as returned by
getLinkName()
.
-