Package com.amazonaws.services.simpledb.model

Examples of com.amazonaws.services.simpledb.model.PutAttributesRequest


    return keyVal;
 
 
  public static PutAttributesRequest createPutRequest(String domain, Class<?> clazz, ClassInfo info, Object obj) {
    PutAttributesRequest req = new PutAttributesRequest().withDomainName(domain);
    req.withItemName(getItemName(clazz, obj));
   
    for (Field field : ClassInfo.getClassInfo(clazz).updateFields) {
      try {
        String value = objectFieldToString(obj, field);
        if(value != null){
          ReplaceableAttribute attr = new ReplaceableAttribute(getAttributeName(field), value, true);
          req.withAttributes(attr);
        }else {
          if (ClassInfo.isEmbeddedNative(field)){
            SdbNativeSerializer.embed(req, ClassInfo.getSingleColumnName(field), value);           
          }
        }
View Full Code Here


    public PutAttributesCommand(AmazonSimpleDB sdbClient, SdbConfiguration configuration, Exchange exchange) {
        super(sdbClient, configuration, exchange);
    }

    public void execute() {
        PutAttributesRequest request = new PutAttributesRequest()
            .withDomainName(determineDomainName())
            .withItemName(determineItemName())
            .withAttributes(determineReplaceableAttributes())
            .withExpected(determineUpdateCondition());
        log.trace("Sending request [{}] for exchange [{}]...", request, exchange);
View Full Code Here

  private void updateState(TriggerWrapper tw) {
    log.debug("Updating state of Trigger: " + tw.trigger.getFullName());
    String key = TriggerWrapper.getTriggerNameKey(tw.trigger);
    ReplaceableAttribute attr = new ReplaceableAttribute(TRIGGER_STATE,
        String.valueOf(tw.state), true);
    amazonSimpleDb.putAttributes(new PutAttributesRequest(triggerDomain,
        key, Collections.singletonList(attr)));
  }
View Full Code Here

       
        sdbClient.createDomain(new CreateDomainRequest().withDomainName(domainName));
        try {
          for(int i = 0; i < 10; i++) {
              sdbClient.putAttributes(
                  new PutAttributesRequest()
                    .withItemName("thing" + i)
                    .withDomainName(domainName)
                    .withAttributes(new ReplaceableAttribute("name", "value", true)));           
          }
         
View Full Code Here

       
        sdbClient.createDomain(new CreateDomainRequest().withDomainName(domainName));
        try {
          for(int i = 0; i < 10; i++) {
              sdbClient.putAttributes(
                  new PutAttributesRequest()
                    .withItemName("thing" + i)                   
                    .withDomainName(domainName)
                    .withAttributes(new ReplaceableAttribute("name", "value", true)));           
          }
         
View Full Code Here

        // Now finally send it for storage (If have attributes to add)
        long start2 = System.currentTimeMillis();
        long duration2;
        if (!attsToPut.isEmpty()) {       
            this.em.getSimpleDb().putAttributes(new PutAttributesRequest()
               .withDomainName(domainName)
               .withItemName(id)
               .withAttributes(attsToPut));
            duration2 = System.currentTimeMillis() - start2;
            if(logger.isLoggable(Level.FINE))logger.fine("putAttributes time=" + (duration2));
View Full Code Here

        AmazonSimpleDB db = factory.getSimpleDb();
        for (Item item : items) {
            List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();

            atts.add(new ReplaceableAttribute(dtype, newClassName, true));
            db.putAttributes(new PutAttributesRequest(domainName, item.getName(), atts));
        }
    }
View Full Code Here

            if (oldAtts.size() > 0) {
                Attribute oldAtt = oldAtts.get(0);
                List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();
                atts.add(new ReplaceableAttribute(newAttributeName, oldAtt.getValue(), true));

                db.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(item.getName()).withAttributes(atts));

                db.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(item.getName()).withAttributes(oldAtts));
            }
        }
    }
View Full Code Here

       
        String id = "abc123";
        List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();
        atts.add(new ReplaceableAttribute("id", id, true));
        atts.add(new ReplaceableAttribute("nameOld", "Bullwinkle", true));
        db.putAttributes(new PutAttributesRequest()
          .withDomainName(domainName)
          .withItemName(id)
          .withAttributes(atts));

        MyTestObject object;
View Full Code Here

        List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();
        atts.add(new ReplaceableAttribute("id", id, true));
        atts.add(new ReplaceableAttribute(EntityManagerFactoryImpl.DTYPE, "MyInheritanceObjectOld", true));
        atts.add(new ReplaceableAttribute("fieldInSubClass2", "Bullwinkle", true));
       
        db.putAttributes(new PutAttributesRequest()
        .withDomainName(domainName)
        .withItemName(id)
        .withAttributes(atts));

        MyInheritanceObject1 object;
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpledb.model.PutAttributesRequest

Copyright © 2018 www.massapicom. 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.