/** * Returns a MessageCounterInfo corresponding to the JSON serialization returned * by {@link QueueControl#listMessageCounter()}. */ public static MessageCounterInfo fromJSON(final String jsonString) throws Exception { JsonObject data = JsonUtil.readJsonObject(jsonString); String name = data.getString("destinationName"); String subscription = data.getString("destinationSubscription", null); boolean durable = data.getBoolean("destinationDurable"); long count = data.getJsonNumber("count").longValue(); long countDelta = data.getJsonNumber("countDelta").longValue(); int depth = data.getInt("messageCount"); int depthDelta = data.getInt("messageCountDelta"); String lastAddTimestamp = data.getString("lastAddTimestamp"); String updateTimestamp = data.getString("updateTimestamp"); return new MessageCounterInfo(name, subscription, durable, count, countDelta, depth, depthDelta, lastAddTimestamp, updateTimestamp); }
/** * Returns a MessageCounterInfo corresponding to the JSON serialization returned * by {@link QueueControl#listMessageCounter()}. */ public static MessageCounterInfo fromJSON(final String jsonString) throws Exception { JsonObject data = JsonUtil.readJsonObject(jsonString); String name = data.getString("destinationName"); String subscription = data.getString("destinationSubscription", null); boolean durable = data.getBoolean("destinationDurable"); long count = data.getJsonNumber("count").longValue(); long countDelta = data.getJsonNumber("countDelta").longValue(); int depth = data.getInt("messageCount"); int depthDelta = data.getInt("messageCountDelta"); String lastAddTimestamp = data.getString("lastAddTimestamp"); String updateTimestamp = data.getString("updateTimestamp"); return new MessageCounterInfo(name, subscription, durable, count, countDelta, depth, depthDelta, lastAddTimestamp, updateTimestamp); }
/** * Returns a MessageCounterInfo corresponding to the JSON serialization returned * by {@link QueueControl#listMessageCounter()}. */ public static MessageCounterInfo fromJSON(final String jsonString) throws Exception { JsonObject data = JsonUtil.readJsonObject(jsonString); String name = data.getString("destinationName"); String subscription = data.getString("destinationSubscription", null); boolean durable = data.getBoolean("destinationDurable"); long count = data.getJsonNumber("count").longValue(); long countDelta = data.getJsonNumber("countDelta").longValue(); int depth = data.getInt("messageCount"); int depthDelta = data.getInt("messageCountDelta"); String lastAddTimestamp = data.getString("lastAddTimestamp"); String updateTimestamp = data.getString("updateTimestamp"); return new MessageCounterInfo(name, subscription, durable, count, countDelta, depth, depthDelta, lastAddTimestamp, updateTimestamp); }