Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.asInt()


    JsonNode timeToLiveNode=bodyJson.findValue("time_to_live");

    if(!(timeToLiveNode==null)) {
      if(!(timeToLiveNode.isNumber())) throw new PushTimeToLiveFormatException("Time_to_live MUST be a positive number or equal zero");
      else if(timeToLiveNode.asInt() < 0) throw new PushTimeToLiveFormatException("Time_to_live MUST be a positive number or equal zero");
    }
    return true;

  }
View Full Code Here


    JsonNode contentAvailableNode=bodyJson.findValue("content-available");
    Integer contentAvailable = null;
    if(!(contentAvailableNode == null)) {
      if(!(contentAvailableNode.isInt())) throw new PushContentAvailableFormatException("Content-available MUST be an Integer (1 for silent notification)");
      contentAvailable=contentAvailableNode.asInt();
    }
    if(contentAvailable!=1) {

      JsonNode categoryNode=bodyJson.findValue("category");
      String category = null;
View Full Code Here

      JsonNode badgeNode=bodyJson.findValue("badge");
      int badge=0;
      if(!(badgeNode==null)) {
        if(!(badgeNode.isNumber())) throw new PushBadgeFormatException("Badge value MUST be a number");
        else badge=badgeNode.asInt();
      }

      if (Logger.isDebugEnabled()) Logger.debug("APN Push message: "+message+" to the device "+deviceid +" with sound: " + sound + " with badge: " + badge + " with Action-Localized-Key: " + actionLocKey + " with Localized-Key: "+locKey);
      if (Logger.isDebugEnabled()) Logger.debug("Localized arguments: " + locArgs.toString());
      if (Logger.isDebugEnabled()) Logger.debug("Custom Data: " + customData.toString());
View Full Code Here

    JsonNode contentAvailableNode=bodyJson.findValue("content-available");
    Integer contentAvailable = null;
    if(!(contentAvailableNode == null)) {
      if(!(contentAvailableNode.isInt())) throw new PushContentAvailableFormatException("Content-available MUST be an Integer (1 for silent notification)");
      contentAvailable=contentAvailableNode.asInt();
    }

    JsonNode categoryNode=bodyJson.findValue("category");
    String category = null;
    if(!(categoryNode == null)) {
View Full Code Here

    JsonNode badgeNode=bodyJson.findValue("badge");
    int badge=0;
    if(!(badgeNode==null)) {
      if(!(badgeNode.isNumber())) throw new PushBadgeFormatException("Badge value MUST be a number");
      else badge=badgeNode.asInt();
    }

    return true;
  }
View Full Code Here

        embeddedJmxTrans.getOutputWriters().addAll(outputWriters);
        logger.trace("Add global output writers: {}", outputWriters);

        JsonNode queryIntervalInSecondsNode = configurationRootNode.path("queryIntervalInSeconds");
        if (!queryIntervalInSecondsNode.isMissingNode()) {
            embeddedJmxTrans.setQueryIntervalInSeconds(queryIntervalInSecondsNode.asInt());
        }

        JsonNode exportBatchSizeNode = configurationRootNode.path("exportBatchSize");
        if (!exportBatchSizeNode.isMissingNode()) {
            embeddedJmxTrans.setExportBatchSize(exportBatchSizeNode.asInt());
View Full Code Here

            embeddedJmxTrans.setQueryIntervalInSeconds(queryIntervalInSecondsNode.asInt());
        }

        JsonNode exportBatchSizeNode = configurationRootNode.path("exportBatchSize");
        if (!exportBatchSizeNode.isMissingNode()) {
            embeddedJmxTrans.setExportBatchSize(exportBatchSizeNode.asInt());
        }

        JsonNode numQueryThreadsNode = configurationRootNode.path("numQueryThreads");
        if (!numQueryThreadsNode.isMissingNode()) {
            embeddedJmxTrans.setNumQueryThreads(numQueryThreadsNode.asInt());
View Full Code Here

            embeddedJmxTrans.setExportBatchSize(exportBatchSizeNode.asInt());
        }

        JsonNode numQueryThreadsNode = configurationRootNode.path("numQueryThreads");
        if (!numQueryThreadsNode.isMissingNode()) {
            embeddedJmxTrans.setNumQueryThreads(numQueryThreadsNode.asInt());
        }

        JsonNode exportIntervalInSecondsNode = configurationRootNode.path("exportIntervalInSeconds");
        if (!exportIntervalInSecondsNode.isMissingNode()) {
            embeddedJmxTrans.setExportIntervalInSeconds(exportIntervalInSecondsNode.asInt());
View Full Code Here

            embeddedJmxTrans.setNumQueryThreads(numQueryThreadsNode.asInt());
        }

        JsonNode exportIntervalInSecondsNode = configurationRootNode.path("exportIntervalInSeconds");
        if (!exportIntervalInSecondsNode.isMissingNode()) {
            embeddedJmxTrans.setExportIntervalInSeconds(exportIntervalInSecondsNode.asInt());
        }

        JsonNode numExportThreadsNode = configurationRootNode.path("numExportThreads");
        if (!numExportThreadsNode.isMissingNode()) {
            embeddedJmxTrans.setNumExportThreads(numExportThreadsNode.asInt());
View Full Code Here

            embeddedJmxTrans.setExportIntervalInSeconds(exportIntervalInSecondsNode.asInt());
        }

        JsonNode numExportThreadsNode = configurationRootNode.path("numExportThreads");
        if (!numExportThreadsNode.isMissingNode()) {
            embeddedJmxTrans.setNumExportThreads(numExportThreadsNode.asInt());
        }

        logger.info("Loaded {}", embeddedJmxTrans);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.