## org.hornetq.api.jms.management
Interface TopicControl

All Superinterfaces:
  DestinationControl

    public interface TopicControl

extends DestinationControl

A TopicControl is used to manage a JMS Topic.

Author:
  Jeff Mesnil

Method Summary
`void` `addJNDI(String jndi)` Add the JNDI 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.
`String[]` `getJNDIBindings()` Returns the JNDI bindings associated to this connection factory.
`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.
`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.
`void` `removeJNDI(String jndi)`

Methods inherited from interface org.hornetq.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.

### getJNDIBindings

    String[] getJNDIBindings()

  Returns the JNDI bindings associated to this connection factory.

### addJNDI

    void addJNDI(String jndi)
                 throws Exception

  Add the JNDI binding to this destination

  Throws:
    `Exception`

### removeJNDI

    void removeJNDI(String jndi)
                    throws Exception

  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 © 2009 Red Hat Inc. All Rights Reserved.