Class SubscriptionLink

  • All Implemented Interfaces:
    ComplexObjectNameLink, ObjectNameLink, java.io.Serializable

    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().

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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().
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SubscriptionLink

        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.

        Parameters:
        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.
        Throws:
        java.lang.IllegalArgumentException - If any of the arguments are null.
    • Method Detail

      • getObjectName

        public javax.management.ObjectName 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 interface ObjectNameLink
        Returns:
        The ObjectName of the linked object.
      • getLinkName

        public java.lang.String 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 interface ObjectNameLink
        Returns:
        A human readable name for the linked object.
      • getCachedObjectObjectName

        public javax.management.ObjectName 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

        public javax.management.ObjectName 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

        public javax.management.ObjectName 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 interface ComplexObjectNameLink
        Returns:
        The ObjectName of the MBean that
      • getCachedObject

        public java.lang.String getCachedObject()

        Gets the name of the cached object this subscription is for.

        Returns:
        The name of the cached object this subscription is for.
      • getSessionId

        public java.lang.String 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

        public java.lang.String 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

        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).

        Returns:
        The name of the object subscribed to by the client.
      • hashCode

        public int hashCode()

        Returns a hash code value for the object.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hash code value for this object.
      • toString

        public java.lang.String toString()

        Returns the human readable name of the linked MBean, as returned by getLinkName().

        Overrides:
        toString in class java.lang.Object
        Returns:
        The human readable name of the linked MBean.