Examples of toJSON()


Examples of com.amazonaws.auth.policy.Policy.toJson()

                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
                    .withActions(SQSActions.SendMessage)
                    .withResources(new Resource(queueARN))
                    .withConditions(ConditionFactory.newSourceArnCondition(topicArn)));
        sqs.setQueueAttributes(new SetQueueAttributesRequest(queueUrl, newAttributes("Policy", sqsPolicy.toJson())));

        sns.subscribe(new SubscribeRequest(topicArn, "sqs", queueARN));
    }

    private Map<String, String> newAttributes(String... keyValuePairs) {
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.datamodeling.S3Link.toJson()

        if ( s3link.getBucketName() == null || s3link.getKey() == null ) {
            // insufficient S3 resource specification
            return null;
        }

        return new AttributeValue().withS(s3link.toJson());
    }
}
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.Item.toJSON()

            .withPrimaryKey(HASH_KEY_NAME, "howToPut_TopLevelJSON", RANGE_KEY_NAME, 1);
        table.putItem(item);
        // Retrieve the entire document and the entire document only
        Item documentItem = table.getItem(new GetItemSpec()
            .withPrimaryKey(HASH_KEY_NAME, "howToPut_TopLevelJSON", RANGE_KEY_NAME, 1));
        System.out.println(documentItem.toJSON());
        // Output: {"first_name":"Jeff","myRangeKey":1,"person_id":123,"current_city":"Tokyo","next_haircut":{"month":10,"year":2014,"day":30},"last_name":"Barr","children":["SJB","ASB","CGB","BGB","GTB"],"myHashKey":"howToPut_TopLevelJSON"}
        System.out.println(documentItem.toJSONPretty());
        // Output:
//        {
//            "first_name" : "Jeff",
View Full Code Here

Examples of com.atlassian.connect.play.java.token.Token.toJson()

    public static void refreshToken(boolean allowInsecurePolling)
    {
        final Token token = new Token(AC.getAcHost().getKey(), AC.getUser(), System.currentTimeMillis(), allowInsecurePolling);

        final String jsonToken = Base64.encodeBase64String(token.toJson().toString().getBytes());
        final String encryptedToken = Crypto.encryptAES(jsonToken);

        getHttpContext().args.put(AC_TOKEN, encryptedToken);
    }
View Full Code Here

Examples of com.avaje.ebean.text.json.JsonContext.toJson()

        ElPropertyValue elCmoney = descriptor.getElGetValue("cmoney");
//        ElPropertyValue elCmoneyAmt = descriptor.getElGetValue("cmoney.amount");
//        ElPropertyValue elCmoneyCur = descriptor.getElGetValue("cmoney.currency");
       
        JsonContext jsonContext = server.json();
        String json = jsonContext.toJson(p);
       
        DPerson bean = jsonContext.toBean(DPerson.class, json);
        Assert.assertEquals("first", bean.getFirstName());
        Assert.assertEquals(new Money("12200"), bean.getSalary());
        Assert.assertEquals(new Money("12"), bean.getCmoney().getAmount());
View Full Code Here

Examples of com.badlogic.gdx.utils.Json.toJson()

      }
    }
   
    //save
    Json json = new Json();
    json.toJson(data, parameter.file);
  }
 
  @Override
  public ParticleEffect loadSync (AssetManager manager, String fileName, FileHandle file, ParticleEffectLoadParameter parameter) {
    ResourceData<ParticleEffect> effectData = null;
View Full Code Here

Examples of com.cib.ajax.rpc.util.JavaBean2JSON.toJSON()

      JavaBean2JSON transform = new JavaBean2JSON();

      try {
        // FIXME: this only checks for String and not primitive types
        if (!(result instanceof java.lang.String)) {
          jsonResponse.put("result", transform.toJSON(result));
        } else {
          jsonResponse.put("result", result);
        }
        jsonResponse.putOpt("id", id);
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportEvent.toJson()

    }
    Assert.assertEquals(ok.get(), 100);

    ReportEvent rpt = sink.getMetrics();
    Writer out = new OutputStreamWriter(System.out);
    rpt.toJson(out);
    out.flush();

    // 100 good messages. every 4th message fails -- 3 good 1 bad.
    // 00 01 02 xx 03 04 05 xx 06 07 08 xx ...
    // so 100 good msgs, 133 total messages, 33 bad msgs
View Full Code Here

Examples of com.comcast.cns.model.CNSRetryPolicy.toJSON()

        assertTrue(rpolicy.getBackOffFunction() == CnsBackoffFunction.linear);
        logger.debug("retryPolicy2: " + retryPolicy2);
        logger.debug("rpolicy is: " + rpolicy.toString());
        assertTrue(rpolicy.toString().equals(retryPolicy2));
       
        JSONObject respJSON = rpolicy.toJSON();
        assertTrue(respJSON.has("backoffFunction"));
        assertTrue(respJSON.getString("backoffFunction").equals("linear"));
        assertTrue(respJSON.has("numMaxDelayRetries"));
        assertTrue(respJSON.getInt("numMaxDelayRetries") == 4);
        assertTrue(respJSON.has("numMinDelayRetries"));
View Full Code Here

Examples of com.comcast.cns.model.CNSSubscriptionDeliveryPolicy.toJSON()

  
   @Test
   public void testToStringToJSON() {
     try {
       CNSSubscriptionDeliveryPolicy subpolicy = new CNSSubscriptionDeliveryPolicy();
       JSONObject subpolicyJSON = subpolicy.toJSON();
       logger.info(subpolicy.toString());
       assertTrue(subpolicyJSON.has("healthyRetryPolicy"));
       JSONObject respJSON = subpolicyJSON.getJSONObject("healthyRetryPolicy");
      assertTrue(respJSON.has("backoffFunction"));
      assertTrue(respJSON.getString("backoffFunction").equals("linear"));
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.