for (int i = 0; i < msgs.length(); i++) JSONObject msgJson = msgs.getJSONObject(i); JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES); StringBuilder propstr = new StringBuilder();
for (int i = 0; i < msgs.length(); i++) JSONObject msgJson = msgs.getJSONObject(i); JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES); StringBuilder propstr = new StringBuilder();
for (int i = 0; i < msgs.length(); i++) JSONObject msgJson = msgs.getJSONObject(i); JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES); StringBuilder propstr = new StringBuilder();
public static JMSSessionInfo[] from(final String jsonString) throws JSONException { JSONArray array = new JSONArray(jsonString); JMSSessionInfo[] infos = new JMSSessionInfo[array.length()]; for (int i = 0; i < array.length(); i++) { JSONObject obj = array.getJSONObject(i); JMSSessionInfo info = new JMSSessionInfo(obj.getString("sessionID"), obj.getLong("creationTime")); infos[i] = info; } return infos; }
public static JMSConnectionInfo[] from(final String jsonString) throws Exception { JSONArray array = new JSONArray(jsonString); JMSConnectionInfo[] infos = new JMSConnectionInfo[array.length()]; for (int i = 0; i < array.length(); i++) { JSONObject obj = array.getJSONObject(i); String cid = obj.isNull("clientID") ? null : obj.getString("clientID"); String uname = obj.isNull("principal") ? null : obj.getString("principal"); JMSConnectionInfo info = new JMSConnectionInfo(obj.getString("connectionID"), obj.getString("clientAddress"), obj.getLong("creationTime"), cid, uname); infos[i] = info; } return infos; }
/** * Returns an array of SubscriptionInfo corresponding to the JSON serialization returned * by {@link TopicControl#listAllSubscriptionsAsJSON()} and related methods. */ public static SubscriptionInfo[] from(final String jsonString) throws Exception { JSONArray array = new JSONArray(jsonString); SubscriptionInfo[] infos = new SubscriptionInfo[array.length()]; for (int i = 0; i < array.length(); i++) { JSONObject sub = array.getJSONObject(i); SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"), sub.optString("clientID", null), sub.optString("name", null), sub.getBoolean("durable"), sub.optString("selector", null), sub.getInt("messageCount"), sub.getInt("deliveringCount")); infos[i] = info; } return infos; }
/** * Returns an array of RoleInfo corresponding to the JSON serialization returned * by {@link AddressControl#getRolesAsJSON()}. */ public static final RoleInfo[] from(final String jsonString) throws Exception { JSONArray array = new JSONArray(jsonString); RoleInfo[] roles = new RoleInfo[array.length()]; for (int i = 0; i < array.length(); i++) { JSONObject r = array.getJSONObject(i); RoleInfo role = new RoleInfo(r.getString("name"), r.getBoolean("send"), r.getBoolean("consume"), r.getBoolean("createDurableQueue"), r.getBoolean("deleteDurableQueue"), r.getBoolean("createNonDurableQueue"), r.getBoolean("deleteNonDurableQueue"), r.getBoolean("manage")); roles[i] = role; } return roles; }
/** * Returns an array of SubscriptionInfo corresponding to the JSON serialization returned * by {@link TopicControl#listAllSubscriptionsAsJSON()} and related methods. */ public static JMSConsumerInfo[] from(final String jsonString) throws Exception { JSONArray array = new JSONArray(jsonString); JMSConsumerInfo[] infos = new JMSConsumerInfo[array.length()]; for (int i = 0; i < array.length(); i++) { JSONObject sub = array.getJSONObject(i); JMSConsumerInfo info = new JMSConsumerInfo(sub.getString("consumerID"), sub.getString("connectionID"), sub.getString("destinationName"), sub.getString("destinationType"), sub.getBoolean("browseOnly"), sub.getLong("creationTime"), sub.getBoolean("durable"), sub.optString("filter", null)); infos[i] = info; } return infos; }
/** * Returns an array of RoleInfo corresponding to the JSON serialization returned * by {@link AddressControl#getRolesAsJSON()}. */ public static RoleInfo[] from(final String jsonString) throws Exception { JSONArray array = new JSONArray(jsonString); RoleInfo[] roles = new RoleInfo[array.length()]; for (int i = 0; i < array.length(); i++) { JSONObject r = array.getJSONObject(i); RoleInfo role = new RoleInfo(r.getString("name"), r.getBoolean("send"), r.getBoolean("consume"), r.getBoolean("createDurableQueue"), r.getBoolean("deleteDurableQueue"), r.getBoolean("createNonDurableQueue"), r.getBoolean("deleteNonDurableQueue"), r.getBoolean("manage")); roles[i] = role; } return roles; }