org.apache.activemq.artemis.jms.management.impl

## Class JMSQueueControlImpl

- java.lang.Object
- - javax.management.StandardMBean
  - - org.apache.activemq.artemis.jms.management.impl.JMSQueueControlImpl

- All Implemented Interfaces:
    DynamicMBean, MBeanRegistration, DestinationControl, JMSQueueControl

      public class JMSQueueControlImpl
      extends StandardMBean
      implements JMSQueueControl

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JMSQueueControlImpl(ActiveMQDestination managedQueue, QueueControl coreQueueControl, JMSServerManager jmsServerManager, org.apache.activemq.artemis.core.messagecounter.MessageCounter counter)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBinding(String binding)` Add the JNDI binding to this destination
    `boolean` | `changeMessagePriority(String messageID, int newPriority)` Changes the message's priority corresponding to the specified message ID to the specified priority.
    `int` | `changeMessagesPriority(String filterStr, int newPriority)` Changes the priority for all the message corresponding to the specified filter to the specified priority.
    `long` | `countMessages(String filterStr)` Counts the number of messages in this queue matching the specified filter.
    `static String` | `createFilterFromJMSSelector(String selectorStr)` Returns null if the string is null or empty
    `boolean` | `expireMessage(String messageID)` Expires the message corresponding to the specified message ID.
    `int` | `expireMessages(String filterStr)` Expires all the message corresponding to the specified filter.
    `void` | `flushExecutor()` it will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you call any other measure.
    `String` | `getAddress()` Returns the ActiveMQ Artemis address corresponding to this destination.
    `int` | `getConsumerCount()` Returns the number of consumers consuming messages from this queue.
    `String` | `getDeadLetterAddress()` Returns the dead-letter address associated to this queue.
    `int` | `getDeliveringCount()` Returns the number of messages that this queue is currently delivering to its consumers.
    `String` | `getExpiryAddress()` Returns the expiry address associated to this queue.
    `Long` | `getFirstMessageAge()` Returns the age of the first message in milliseconds.
    `String` | `getFirstMessageAsJSON()` Returns the first message on the queue as JSON
    `Long` | `getFirstMessageTimestamp()` Returns the timestamp of the first message in milliseconds.
    `MBeanInfo` | `getMBeanInfo()`
    `long` | `getMessageCount()` Returns the number of messages currently in this destination.
    `long` | `getMessagesAdded()` Returns the number of messages added to this queue since it was created.
    `String` | `getName()` Returns the name of this destination.
    `String[]` | `getRegistryBindings()` Returns the Registry bindings associated to this connection factory.
    `long` | `getScheduledCount()` Returns the number of scheduled messages in this queue.
    `String` | `getSelector()` returns the selector for the queue
    `boolean` | `isDurable()`
    `boolean` | `isPaused()` Returns whether the queue is paused.
    `boolean` | `isTemporary()` Returns whether this destination is temporary.
    `String` | `listConsumersAsJSON()`
    `Map<String,Map<String,Object>[]>` | `listDeliveringMessages()` Lists all the messages being deliver per consumer.
    `String` | `listDeliveringMessagesAsJSON()` Executes a conversion of `JMSQueueControl.listDeliveringMessages()` to JSON
    `String` | `listMessageCounter()` Lists the message counter for this queue.
    `String` | `listMessageCounterAsHTML()` Lists the message counter for this queue as a HTML table.
    `String` | `listMessageCounterHistory()` Lists the message counter history for this queue.
    `String` | `listMessageCounterHistoryAsHTML()` Lists the message counter history for this queue as a HTML table.
    `Map<String,Object>[]` | `listMessages(String filterStr)` Lists all the JMS messages in this queue matching the specified filter.
    `String` | `listMessagesAsJSON(String filter)` Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
    `Map<String,Object>[]` | `listScheduledMessages()` Lists all the messages scheduled for delivery for this queue.
    `String` | `listScheduledMessagesAsJSON()` Lists all the messages scheduled for delivery for this queue using JSON serialization.
    `boolean` | `moveMessage(String messageID, String otherQueueName)` Moves the message corresponding to the specified message ID to the specified other queue.
    `boolean` | `moveMessage(String messageID, String otherQueueName, boolean rejectDuplicates)` Moves the message corresponding to the specified message ID to the specified other queue.
    `int` | `moveMessages(String filterStr, String otherQueueName)` Moves all the message corresponding to the specified filter to the specified other queue.
    `int` | `moveMessages(String filterStr, String otherQueueName, boolean rejectDuplicates)` Moves all the message corresponding to the specified filter to the specified other queue.
    `void` | `pause()` Pauses the queue.
    `boolean` | `removeMessage(String messageID)` Removes the message corresponding to the specified message ID.
    `int` | `removeMessages(String filterStr)` Removes all the message corresponding to the specified filter.
    `void` | `resetMessageCounter()` Resets the message counter for this queue.
    `void` | `resume()` Resumes the queue.
    `int` | `sendMessagesToDeadLetterAddress(String filterStr)` Sends all the message corresponding to the specified filter to this queue's dead letter address.
    `boolean` | `sendMessageToDeadLetterAddress(String messageID)` Sends the message corresponding to the specified message ID to this queue's dead letter address.

    - ### Methods inherited from class javax.management.StandardMBean

      `cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JMSQueueControlImpl

          public JMSQueueControlImpl(ActiveMQDestination managedQueue,
                                     QueueControl coreQueueControl,
                                     JMSServerManager jmsServerManager,
                                     org.apache.activemq.artemis.core.messagecounter.MessageCounter counter)
                              throws Exception

      Throws:
        `Exception`

  - ### Method Detail

    - #### createFilterFromJMSSelector

          public static String createFilterFromJMSSelector(String selectorStr)
                                                    throws ActiveMQException

      Returns null if the string is null or empty
      Throws:
        `ActiveMQException`

    - #### getName

          public String getName()

      Description copied from interface: `DestinationControl`
      Returns the name of this destination.
      Specified by:
        `getName` in interface `DestinationControl`

    - #### getAddress

          public String getAddress()

      Description copied from interface: `DestinationControl`
      Returns the ActiveMQ Artemis address corresponding to this destination.
      Specified by:
        `getAddress` in interface `DestinationControl`

    - #### isTemporary

          public boolean isTemporary()

      Description copied from interface: `DestinationControl`
      Returns whether this destination is temporary.
      Specified by:
        `isTemporary` in interface `DestinationControl`

    - #### getMessageCount

          public long getMessageCount()

      Description copied from interface: `DestinationControl`
      Returns the number of messages currently in this destination.
      Specified by:
        `getMessageCount` in interface `DestinationControl`

    - #### getMessagesAdded

          public long getMessagesAdded()

      Description copied from interface: `DestinationControl`
      Returns the number of messages added to this queue since it was created.
      Specified by:
        `getMessagesAdded` in interface `DestinationControl`

    - #### getConsumerCount

          public int getConsumerCount()

      Description copied from interface: `JMSQueueControl`
      Returns the number of consumers consuming messages from this queue.
      Specified by:
        `getConsumerCount` in interface `JMSQueueControl`

    - #### getDeliveringCount

          public int getDeliveringCount()

      Description copied from interface: `DestinationControl`
      Returns the number of messages that this queue is currently delivering to its consumers.
      Specified by:
        `getDeliveringCount` in interface `DestinationControl`

    - #### getScheduledCount

          public long getScheduledCount()

      Description copied from interface: `JMSQueueControl`
      Returns the number of scheduled messages in this queue.
      Specified by:
        `getScheduledCount` in interface `JMSQueueControl`

    - #### isDurable

          public boolean isDurable()

    - #### getDeadLetterAddress

          public String getDeadLetterAddress()

      Description copied from interface: `JMSQueueControl`
      Returns the dead-letter address associated to this queue.
      Specified by:
        `getDeadLetterAddress` in interface `JMSQueueControl`

    - #### getExpiryAddress

          public String getExpiryAddress()

      Description copied from interface: `JMSQueueControl`
      Returns the expiry address associated to this queue.
      Specified by:
        `getExpiryAddress` in interface `JMSQueueControl`

    - #### getFirstMessageAsJSON

          public String getFirstMessageAsJSON()
                                       throws Exception

      Description copied from interface: `JMSQueueControl`
      Returns the first message on the queue as JSON
      Specified by:
        `getFirstMessageAsJSON` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### getFirstMessageTimestamp

          public Long getFirstMessageTimestamp()
                                        throws Exception

      Description copied from interface: `JMSQueueControl`
      Returns the timestamp of the first message in milliseconds.
      Specified by:
        `getFirstMessageTimestamp` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### getFirstMessageAge

          public Long getFirstMessageAge()
                                  throws Exception

      Description copied from interface: `JMSQueueControl`
      Returns the age of the first message in milliseconds.
      Specified by:
        `getFirstMessageAge` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### addBinding

          public void addBinding(String binding)
                          throws Exception

      Description copied from interface: `JMSQueueControl`
      Add the JNDI binding to this destination
      Specified by:
        `addBinding` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### getRegistryBindings

          public String[] getRegistryBindings()

      Description copied from interface: `JMSQueueControl`
      Returns the Registry bindings associated to this connection factory.
      Specified by:
        `getRegistryBindings` in interface `JMSQueueControl`

    - #### removeMessage

          public boolean removeMessage(String messageID)
                                throws Exception

      Description copied from interface: `JMSQueueControl`
      Removes the message corresponding to the specified message ID.
      Specified by:
        `removeMessage` in interface `JMSQueueControl`
      Returns:
        `true` if the message was removed, `false` else
      Throws:
        `Exception`

    - #### removeMessages

          public int removeMessages(String filterStr)
                             throws Exception

      Description copied from interface: `JMSQueueControl`
      Removes all the message corresponding to the specified filter.
      Using `null` or an empty filter will remove all messages from this queue.
      Specified by:
        `removeMessages` in interface `DestinationControl`
      Specified by:
        `removeMessages` in interface `JMSQueueControl`
      Returns:
        the number of removed messages
      Throws:
        `Exception`

    - #### listMessages

          public Map<String,Object>[] listMessages(String filterStr)
                                            throws Exception

      Description copied from interface: `JMSQueueControl`
      Lists all the JMS messages in this queue matching the specified filter.
      1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
      Using `null` or an empty filter will list all messages from this queue.
      Specified by:
        `listMessages` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listScheduledMessages

          public Map<String,Object>[] listScheduledMessages()
                                                     throws Exception

      Description copied from interface: `JMSQueueControl`
      Lists all the messages scheduled for delivery for this queue.
      1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
      Specified by:
        `listScheduledMessages` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listScheduledMessagesAsJSON

          public String listScheduledMessagesAsJSON()
                                             throws Exception

      Description copied from interface: `JMSQueueControl`
      Lists all the messages scheduled for delivery for this queue using JSON serialization.
      Specified by:
        `listScheduledMessagesAsJSON` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listDeliveringMessages

          public Map<String,Map<String,Object>[]> listDeliveringMessages()
                                                                  throws Exception

      Description copied from interface: `JMSQueueControl`
      Lists all the messages being deliver per consumer.
      The Map's key is a toString representation for the consumer. Each consumer will then return a `Map<String,Object>[]` same way is returned by `JMSQueueControl.listScheduledMessages()`
      Specified by:
        `listDeliveringMessages` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listDeliveringMessagesAsJSON

          public String listDeliveringMessagesAsJSON()
                                              throws Exception

      Description copied from interface: `JMSQueueControl`
      Executes a conversion of `JMSQueueControl.listDeliveringMessages()` to JSON
      Specified by:
        `listDeliveringMessagesAsJSON` in interface `JMSQueueControl`
      Returns:
      Throws:
        `Exception`

    - #### listMessagesAsJSON

          public String listMessagesAsJSON(String filter)
                                    throws Exception

      Description copied from interface: `JMSQueueControl`
      Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
      Using `null` or an empty filter will list all messages from this queue.
      Specified by:
        `listMessagesAsJSON` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### countMessages

          public long countMessages(String filterStr)
                             throws Exception

      Description copied from interface: `JMSQueueControl`
      Counts the number of messages in this queue matching the specified filter.
      Using `null` or an empty filter will count all messages from this queue.
      Specified by:
        `countMessages` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### expireMessage

          public boolean expireMessage(String messageID)
                                throws Exception

      Description copied from interface: `JMSQueueControl`
      Expires the message corresponding to the specified message ID.
      Specified by:
        `expireMessage` in interface `JMSQueueControl`
      Returns:
        `true` if the message was expired, `false` else
      Throws:
        `Exception`

    - #### expireMessages

          public int expireMessages(String filterStr)
                             throws Exception

      Description copied from interface: `JMSQueueControl`
      Expires all the message corresponding to the specified filter.
      Using `null` or an empty filter will expire all messages from this queue.
      Specified by:
        `expireMessages` in interface `JMSQueueControl`
      Returns:
        the number of expired messages
      Throws:
        `Exception`

    - #### sendMessageToDeadLetterAddress

          public boolean sendMessageToDeadLetterAddress(String messageID)
                                                 throws Exception

      Description copied from interface: `JMSQueueControl`
      Sends the message corresponding to the specified message ID to this queue's dead letter address.
      Specified by:
        `sendMessageToDeadLetterAddress` in interface `JMSQueueControl`
      Returns:
        `true` if the message was sent to the dead letter address, `false` else
      Throws:
        `Exception`

    - #### sendMessagesToDeadLetterAddress

          public int sendMessagesToDeadLetterAddress(String filterStr)
                                              throws Exception

      Description copied from interface: `JMSQueueControl`
      Sends all the message corresponding to the specified filter to this queue's dead letter address.
      Using `null` or an empty filter will send all messages from this queue.
      Specified by:
        `sendMessagesToDeadLetterAddress` in interface `JMSQueueControl`
      Returns:
        the number of sent messages
      Throws:
        `Exception`

    - #### changeMessagePriority

          public boolean changeMessagePriority(String messageID,
                                               int newPriority)
                                        throws Exception

      Description copied from interface: `JMSQueueControl`
      Changes the message's priority corresponding to the specified message ID to the specified priority.
      Specified by:
        `changeMessagePriority` in interface `JMSQueueControl`
        `newPriority` - between 0 and 9 inclusive.
      Returns:
        `true` if the message priority was changed
      Throws:
        `Exception`

    - #### changeMessagesPriority

          public int changeMessagesPriority(String filterStr,
                                            int newPriority)
                                     throws Exception

      Description copied from interface: `JMSQueueControl`
      Changes the priority for all the message corresponding to the specified filter to the specified priority.
      Using `null` or an empty filter will change all messages from this queue.
      Specified by:
        `changeMessagesPriority` in interface `JMSQueueControl`
      Returns:
        the number of changed messages
      Throws:
        `Exception`

    - #### moveMessage

          public boolean moveMessage(String messageID,
                                     String otherQueueName)
                              throws Exception

      Description copied from interface: `JMSQueueControl`
      Moves the message corresponding to the specified message ID to the specified other queue.
      Specified by:
        `moveMessage` in interface `JMSQueueControl`
      Returns:
        `true` if the message was moved, `false` else
      Throws:
        `Exception`

    - #### moveMessage

          public boolean moveMessage(String messageID,
                                     String otherQueueName,
                                     boolean rejectDuplicates)
                              throws Exception

      Description copied from interface: `JMSQueueControl`
      Moves the message corresponding to the specified message ID to the specified other queue.
      Specified by:
        `moveMessage` in interface `JMSQueueControl`
      Returns:
        `true` if the message was moved, `false` else
      Throws:
        `Exception`

    - #### moveMessages

          public int moveMessages(String filterStr,
                                  String otherQueueName,
                                  boolean rejectDuplicates)
                           throws Exception

      Description copied from interface: `JMSQueueControl`
      Moves all the message corresponding to the specified filter to the specified other queue.
      Using `null` or an empty filter will move all messages from this queue.
      Specified by:
        `moveMessages` in interface `JMSQueueControl`
      Returns:
        the number of moved messages
      Throws:
        `Exception`

    - #### moveMessages

          public int moveMessages(String filterStr,
                                  String otherQueueName)
                           throws Exception

      Description copied from interface: `JMSQueueControl`
      Moves all the message corresponding to the specified filter to the specified other queue. RejectDuplicates=false on this case
      Using `null` or an empty filter will move all messages from this queue.
      Specified by:
        `moveMessages` in interface `JMSQueueControl`
      Returns:
        the number of moved messages
      Throws:
        `Exception`

    - #### listConsumersAsJSON

          public String listConsumersAsJSON()
                                     throws Exception

      Specified by:
        `listConsumersAsJSON` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listMessageCounter

          public String listMessageCounter()

      Description copied from interface: `JMSQueueControl`
      Lists the message counter for this queue.
      Specified by:
        `listMessageCounter` in interface `JMSQueueControl`

    - #### resetMessageCounter

          public void resetMessageCounter()
                                   throws Exception

      Description copied from interface: `JMSQueueControl`
      Resets the message counter for this queue.
      Specified by:
        `resetMessageCounter` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listMessageCounterAsHTML

          public String listMessageCounterAsHTML()

      Description copied from interface: `JMSQueueControl`
      Lists the message counter for this queue as a HTML table.
      Specified by:
        `listMessageCounterAsHTML` in interface `JMSQueueControl`

    - #### listMessageCounterHistory

          public String listMessageCounterHistory()
                                           throws Exception

      Description copied from interface: `JMSQueueControl`
      Lists the message counter history for this queue.
      Specified by:
        `listMessageCounterHistory` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### listMessageCounterHistoryAsHTML

          public String listMessageCounterHistoryAsHTML()

      Description copied from interface: `JMSQueueControl`
      Lists the message counter history for this queue as a HTML table.
      Specified by:
        `listMessageCounterHistoryAsHTML` in interface `JMSQueueControl`

    - #### isPaused

          public boolean isPaused()
                           throws Exception

      Description copied from interface: `JMSQueueControl`
      Returns whether the queue is paused.
      Specified by:
        `isPaused` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### pause

          public void pause()
                     throws Exception

      Description copied from interface: `JMSQueueControl`
      Pauses the queue. Messages are no longer delivered to its consumers.
      Specified by:
        `pause` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### resume

          public void resume()
                      throws Exception

      Description copied from interface: `JMSQueueControl`
      Resumes the queue. Messages are again delivered to its consumers.
      Specified by:
        `resume` in interface `JMSQueueControl`
      Throws:
        `Exception`

    - #### getSelector

          public String getSelector()

      Description copied from interface: `JMSQueueControl`
      returns the selector for the queue
      Specified by:
        `getSelector` in interface `JMSQueueControl`

    - #### flushExecutor

          public void flushExecutor()

      Description copied from interface: `JMSQueueControl`
      it will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you call any other measure. It is useful if you need the exact number of counts on a message
      Specified by:
        `flushExecutor` in interface `JMSQueueControl`

    - #### getMBeanInfo

          public MBeanInfo getMBeanInfo()

      Specified by:
        `getMBeanInfo` in interface `DynamicMBean`
      Overrides:
        `getMBeanInfo` in class `StandardMBean`

Copyright © 2017. All rights reserved.