JSONObject.getLong
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.hornetq.utils.json.JSONObject.getLong(Showing top 13 results out of 315)

origin: org.hornetq/hornetq-jms-client

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;
}
origin: org.hornetq/hornetq-core

public static final AddressSettingsInfo from(final String jsonString) throws Exception
{
 JSONObject object = new JSONObject(jsonString);
 return new AddressSettingsInfo(object.getString("addressFullMessagePolicy"),
                 object.getLong("maxSizeBytes"),
                 object.getInt("pageSizeBytes"),
                 object.getInt("pageCacheMaxSize"),
                 object.getInt("maxDeliveryAttempts"),
                 object.getLong("redeliveryDelay"),
                 object.getString("DLA"),
                 object.getString("expiryAddress"),
                 object.getBoolean("lastValueQueue"),
                 object.getLong("redistributionDelay"),
                 object.getBoolean("sendToDLAOnNoRoute"));
}
origin: org.hornetq/hornetq-core

/**
* Get an optional long value associated with a key,
* or the default if there is no such key or if the value is not a number.
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
* @param key   A key string.
* @param defaultValue     The default.
* @return      An object which is the value.
*/
public long optLong(final String key, final long defaultValue)
{
 try
 {
   return getLong(key);
 }
 catch (Exception e)
 {
   return defaultValue;
 }
}
origin: org.hornetq/hornetq-server

/**
* Returns an array of RoleInfo corresponding to the JSON serialization returned
* by {@link QueueControl#listMessageCounter()}.
*/
public static MessageCounterInfo fromJSON(final String jsonString) throws Exception
{
 JSONObject data = new JSONObject(jsonString);
 String name = data.getString("destinationName");
 String subscription = data.getString("destinationSubscription");
 boolean durable = data.getBoolean("destinationDurable");
 long count = data.getLong("count");
 long countDelta = data.getLong("countDelta");
 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);
}
origin: org.hornetq/hornetq-jms

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;
}
origin: org.hornetq/hornetq-core-client

public static AddressSettingsInfo from(final String jsonString) throws Exception
{
 JSONObject object = new JSONObject(jsonString);
 return new AddressSettingsInfo(object.getString("addressFullMessagePolicy"),
                 object.getLong("maxSizeBytes"),
                 object.getInt("pageSizeBytes"),
                 object.getInt("pageCacheMaxSize"),
                 object.getInt("maxDeliveryAttempts"),
                 object.getLong("redeliveryDelay"),
                 object.getDouble("redeliveryMultiplier"),
                 object.getLong("maxRedeliveryDelay"),
                 object.getString("DLA"),
                 object.getString("expiryAddress"),
                 object.getBoolean("lastValueQueue"),
                 object.getLong("redistributionDelay"),
                 object.getBoolean("sendToDLAOnNoRoute"),
                 object.getLong("slowConsumerThreshold"),
                 object.getLong("slowConsumerCheckPeriod"),
                 object.getString("slowConsumerPolicy"));
}
origin: org.hornetq/hornetq-jms-client

/**
* 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;
}
origin: org.hornetq/hornetq-jms

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;
}
origin: org.hornetq/hornetq-jms-client

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;
}
origin: org.hornetq/hornetq-core

/**
* Get an optional long value associated with a key,
* or the default if there is no such key or if the value is not a number.
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
* @param key   A key string.
* @param defaultValue     The default.
* @return      An object which is the value.
*/
public long optLong(final String key, final long defaultValue)
{
 try
 {
   return getLong(key);
 }
 catch (Exception e)
 {
   return defaultValue;
 }
}
origin: org.hornetq/hornetq-core-client

/**
* Get an optional long value associated with a key,
* or the default if there is no such key or if the value is not a number.
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
* @param key   A key string.
* @param defaultValue     The default.
* @return      An object which is the value.
*/
public long optLong(final String key, final long defaultValue)
{
 try
 {
   return getLong(key);
 }
 catch (Exception e)
 {
   return defaultValue;
 }
}
origin: org.hornetq/hornetq-jms

/**
* 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;
}
origin: org.hornetq/hornetq-core

/**
* Returns an array of RoleInfo corresponding to the JSON serialization returned
* by {@link QueueControl#listMessageCounter()}.
*/
public static MessageCounterInfo fromJSON(final String jsonString) throws Exception
{
 JSONObject data = new JSONObject(jsonString);
 String name = data.getString("destinationName");
 String subscription = data.getString("destinationSubscription");
 boolean durable = data.getBoolean("destinationDurable");
 long count = data.getLong("count");
 long countDelta = data.getLong("countDelta");
 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);
}
org.hornetq.utils.jsonJSONObjectgetLong

Javadoc

Get the long value associated with a key. If the number value is too long for a long, it will be clipped.

Popular methods of JSONObject

  • <init>
    Construct a JSONObject from a JSONTokener.
  • get
    Get the value object associated with a key.
  • getBoolean
    Get the boolean value associated with a key.
  • getInt
    Get the int value associated with a key. If the number value is too large for an int, it will be cli
  • getJSONArray
    Get the JSONArray value associated with a key.
  • getString
    Get the string associated with a key.
  • keys
    Get an enumeration of the keys of the JSONObject.
  • put
    Put a key/boolean pair in the JSONObject.
  • getJSONObject
    Get the JSONObject value associated with a key.
  • optString
    Get an optional string associated with a key. It returns the defaultValue if there is no such key.
  • toString
    Make a prettyprinted JSON text of this JSONObject. Warning: This method assumes that the data struct
  • getDouble
    Get the double value associated with a key.
  • toString,
  • getDouble,
  • isNull,
  • isStandardProperty,
  • length,
  • numberToString,
  • opt,
  • optBoolean,
  • optDouble

Popular classes and methods

  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Component (java.awt)
  • GridLayout (java.awt)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ArrayList (java.util)
    Resizable-array implementation of the List interface.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)