org.apache.activemq.artemis.api.jms.management

## Interface TopicControl

- All Superinterfaces:
    DestinationControl
  All Known Implementing Classes:
    JMSTopicControlImpl

      public interface TopicControl
      extends DestinationControl

  A TopicControl is used to manage a JMS Topic.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBinding(String binding)` Add the Registry binding to this destination
    `int` | `countMessagesForSubscription(String clientID, String subscriptionName, String filter)` Counts the number of messages in the subscription specified by the specified client ID and subscription name.
    `void` | `dropAllSubscriptions()` Drops all subscriptions.
    `void` | `dropDurableSubscription(String clientID, String subscriptionName)` Drops the subscription specified by the specified client ID and subscription name.
    `int` | `getDurableMessageCount()` Returns the number of messages for all durable subscribers for this topic.
    `int` | `getDurableSubscriptionCount()` Returns the number of durable subscribers for this topic.
    `int` | `getNonDurableMessageCount()` Returns the number of messages for all non-durable subscribers for this topic.
    `int` | `getNonDurableSubscriptionCount()` Returns the number of non-durable subscribers for this topic.
    `String[]` | `getRegistryBindings()` Returns the Registry bindings associated with this topic.
    `int` | `getSubscriptionCount()` Returns the number of (durable and non-durable) subscribers for this topic.
    `Object[]` | `listAllSubscriptions()` Lists all the subscriptions for this topic (both durable and non-durable).
    `String` | `listAllSubscriptionsAsJSON()` Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
    `Object[]` | `listDurableSubscriptions()` Lists all the durable subscriptions for this topic.
    `String` | `listDurableSubscriptionsAsJSON()` Lists all the durable subscriptions using JSON serialization.
    `Map<String,Object>[]` | `listMessagesForSubscription(String queueName)` Lists all the messages in this queue matching the specified queue representing the subscription.
    `String` | `listMessagesForSubscriptionAsJSON(String queueName)` Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
    `Object[]` | `listNonDurableSubscriptions()` Lists all the non-durable subscriptions for this topic.
    `String` | `listNonDurableSubscriptionsAsJSON()` Lists all the non-durable subscriptions using JSON serialization.

    - ### Methods inherited from interface org.apache.activemq.artemis.api.jms.management.DestinationControl

      `getAddress, getDeliveringCount, getMessageCount, getMessagesAdded, getName, isTemporary, removeMessages`

- - ### Method Detail

    - #### getSubscriptionCount

          int getSubscriptionCount()

      Returns the number of (durable and non-durable) subscribers for this topic.

    - #### getDurableSubscriptionCount

          int getDurableSubscriptionCount()

      Returns the number of durable subscribers for this topic.

    - #### getNonDurableSubscriptionCount

          int getNonDurableSubscriptionCount()

      Returns the number of non-durable subscribers for this topic.

    - #### getDurableMessageCount

          int getDurableMessageCount()

      Returns the number of messages for all durable subscribers for this topic.

    - #### getNonDurableMessageCount

          int getNonDurableMessageCount()

      Returns the number of messages for all non-durable subscribers for this topic.

    - #### getRegistryBindings

          String[] getRegistryBindings()

      Returns the Registry bindings associated with this topic.

    - #### addBinding

          void addBinding(String binding)
                   throws Exception

      Add the Registry binding to this destination
      Throws:
        `Exception`

    - #### listAllSubscriptions

          Object[] listAllSubscriptions()
                                 throws Exception

      Lists all the subscriptions for this topic (both durable and non-durable).
      Throws:
        `Exception`

    - #### listAllSubscriptionsAsJSON

          String listAllSubscriptionsAsJSON()
                                     throws Exception

      Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
      Java objects can be recreated from JSON serialization using `SubscriptionInfo.from(String)`.
      Throws:
        `Exception`

    - #### listDurableSubscriptions

          Object[] listDurableSubscriptions()
                                     throws Exception

      Lists all the durable subscriptions for this topic.
      Throws:
        `Exception`

    - #### listDurableSubscriptionsAsJSON

          String listDurableSubscriptionsAsJSON()
                                         throws Exception

      Lists all the durable subscriptions using JSON serialization.
      Java objects can be recreated from JSON serialization using `SubscriptionInfo.from(String)`.
      Throws:
        `Exception`

    - #### listNonDurableSubscriptions

          Object[] listNonDurableSubscriptions()
                                        throws Exception

      Lists all the non-durable subscriptions for this topic.
      Throws:
        `Exception`

    - #### listNonDurableSubscriptionsAsJSON

          String listNonDurableSubscriptionsAsJSON()
                                            throws Exception

      Lists all the non-durable subscriptions using JSON serialization.
      Java objects can be recreated from JSON serialization using `SubscriptionInfo.from(String)`.
      Throws:
        `Exception`

    - #### listMessagesForSubscription

          Map<String,Object>[] listMessagesForSubscription(String queueName)
                                                    throws Exception

      Lists all the messages in this queue matching the specified queue representing the subscription.
      1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
      Throws:
        `Exception`

    - #### listMessagesForSubscriptionAsJSON

          String listMessagesForSubscriptionAsJSON(String queueName)
                                            throws Exception

      Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
      Throws:
        `Exception`

    - #### countMessagesForSubscription

          int countMessagesForSubscription(String clientID,
                                           String subscriptionName,
                                           String filter)
                                    throws Exception

      Counts the number of messages in the subscription specified by the specified client ID and subscription name. Only messages matching the filter will be counted.
      Using `null` or an empty filter will count all messages from this queue.
      Throws:
        `Exception`

    - #### dropDurableSubscription

          void dropDurableSubscription(String clientID,
                                       String subscriptionName)
                                throws Exception

      Drops the subscription specified by the specified client ID and subscription name.
      Throws:
        `Exception`

    - #### dropAllSubscriptions

          void dropAllSubscriptions()
                             throws Exception

      Drops all subscriptions.
      Throws:
        `Exception`

Copyright © 2018 The Apache Software Foundation. All rights reserved.