Class Subscription


  • public class Subscription
    extends Object
    The Subscription class is a utility class needed to show information about client subscription.

    Be careful, contrary to user, queue or topic administration object, the Subscription object is just a data structure; it is initialized by user.getSubscription() methods and no longer keep consistent with the real state of subscription.

    • Field Detail

      • name

        private String name
        Name of the subscription.
      • topicId

        private String topicId
        Related topic unique identification.
      • messageCount

        private int messageCount
        Number of pending messages for this subscription.
      • ackCount

        private int ackCount
        Number of pending acks for this subscription.
      • durable

        private boolean durable
        True if the subscription is durable.
    • Constructor Detail

      • Subscription

        public Subscription​(String name,
                            String topicId,
                            int messageCount,
                            int ackCount,
                            boolean durable)
        Creates a new Subscription object.
    • Method Detail

      • getName

        public final String getName()
        Returns the subscription's name.
        Returns:
        the subscription's name.
      • getTopicId

        public final String getTopicId()
        Returns the related topic unique identification.
        Returns:
        the related topic unique identification.
      • getMessageCount

        public final int getMessageCount()
        Returns the number of pending messages.
        Returns:
        the number of pending messages.
      • getDeliveredMessageCount

        public final int getDeliveredMessageCount()
        Returns the number of messages delivered and waiting for acknowledge.
        Returns:
        The number of messages delivered and waiting for acknowledge.
      • isDurable

        public final boolean isDurable()
        Returns true if the subscription is durable, false otherwise.
        Returns:
        true if the subscription is durable, false otherwise.
      • toString

        public String toString()
        Returns a String image of the subscription.
        Overrides:
        toString in class Object