org.apache.activemq.artemis.api.core.management

## Class MessageCounterInfo

- java.lang.Object
- - org.apache.activemq.artemis.api.core.management.MessageCounterInfo

-     public final class MessageCounterInfo
      extends Object

  Helper class to create Java Objects from the JSON serialization returned by `QueueControl.listMessageCounter()`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageCounterInfo(String name, String subscription, boolean durable, long count, long countDelta, int depth, int depthDelta, String lastAddTimestamp, String udpateTimestamp)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MessageCounterInfo` | `fromJSON(String jsonString)` Returns a MessageCounterInfo corresponding to the JSON serialization returned by `QueueControl.listMessageCounter()`.
    `long` | `getCount()` Returns the number of messages added to the queue since it was created.
    `long` | `getCountDelta()` Returns the number of messages added to the queue since the last counter sample.
    `int` | `getDepth()` Returns the number of messages currently in the queue.
    `int` | `getDepthDelta()` Returns the number of messages in the queue since last counter sample.
    `String` | `getLastAddTimestamp()` Returns the timestamp of the last time a message was added to the queue.
    `String` | `getName()` Returns the name of the queue.
    `String` | `getSubscription()` Returns the name of the subscription.
    `String` | `getUdpateTimestamp()` Returns the timestamp of the last time the queue was updated.
    `boolean` | `isDurable()` Returns whether the queue is durable.
    `static String` | `toJSon(org.apache.activemq.artemis.core.messagecounter.MessageCounter counter)` Returns a JSON String serialization of a `MessageCounter` object.

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

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

- - ### Constructor Detail

    - #### MessageCounterInfo

          public MessageCounterInfo(String name,
                                    String subscription,
                                    boolean durable,
                                    long count,
                                    long countDelta,
                                    int depth,
                                    int depthDelta,
                                    String lastAddTimestamp,
                                    String udpateTimestamp)

  - ### Method Detail

    - #### toJSon

          public static String toJSon(org.apache.activemq.artemis.core.messagecounter.MessageCounter counter)
                               throws Exception

      Returns a JSON String serialization of a `MessageCounter` object.
      Parameters:
        `counter` -
      Returns:
      Throws:
        `Exception`

    - #### fromJSON

          public static MessageCounterInfo fromJSON(String jsonString)
                                             throws Exception

      Returns a MessageCounterInfo corresponding to the JSON serialization returned by `QueueControl.listMessageCounter()`.
      Throws:
        `Exception`

    - #### getName

          public String getName()

      Returns the name of the queue.

    - #### getSubscription

          public String getSubscription()

      Returns the name of the subscription.

    - #### isDurable

          public boolean isDurable()

      Returns whether the queue is durable.

    - #### getCount

          public long getCount()

      Returns the number of messages added to the queue since it was created.

    - #### getCountDelta

          public long getCountDelta()

      Returns the number of messages added to the queue since the last counter sample.

    - #### getDepth

          public int getDepth()

      Returns the number of messages currently in the queue.

    - #### getDepthDelta

          public int getDepthDelta()

      Returns the number of messages in the queue since last counter sample.

    - #### getLastAddTimestamp

          public String getLastAddTimestamp()

      Returns the timestamp of the last time a message was added to the queue.

    - #### getUdpateTimestamp

          public String getUdpateTimestamp()

      Returns the timestamp of the last time the queue was updated.

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