Package com.amazonaws.services.simpledb.model

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


   
    return req;
  }
 
  public static DeleteAttributesRequest createDeleteRequest(String domain, Class<?> clazz, Object obj) {
    DeleteAttributesRequest req =
      new DeleteAttributesRequest().withDomainName(domain).withItemName(getItemName(clazz, obj));
   
    return req;
  }
View Full Code Here


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

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

  public boolean removeJob(SchedulingContext ctxt, String jobName,
      String groupName) {
    log.debug("Removing Job: " + groupName + "." + jobName);
    try {
      String key = JobWrapper.getJobNameKey(jobName, groupName);
      amazonSimpleDb.deleteAttributes(new DeleteAttributesRequest(
          jobDomain, key));
      return true;
    } catch (Exception e) {
      log.error("Could not remove Job: " + groupName + "." + jobName, e);
      return false;
View Full Code Here

      String groupName, boolean removeOrphanedJob) {
    log.debug("Removing Trigger: " + groupName + "." + triggerName);
    try {
      String key = TriggerWrapper.getTriggerNameKey(triggerName,
          groupName);
      amazonSimpleDb.deleteAttributes(new DeleteAttributesRequest(
          triggerDomain, key));
      return true;
    } catch (Exception e) {
      log.error("Could not remove Trigger: " + groupName + "."
          + triggerName, e);
View Full Code Here

                    Method getter = ai.getGetter(s);
                    String columnName = NamingHelper.getColumnName(getter);
                    attsToDelete2.add(new Attribute(columnName, null));
                }
                start2 = System.currentTimeMillis();
                this.em.getSimpleDb().deleteAttributes(new DeleteAttributesRequest()
                  .withDomainName(domainName)
                  .withItemName(id)
                  .withAttributes(attsToDelete2));
               
                // todo: what about lobs?  need to delete from s3
                duration2 = System.currentTimeMillis() - start2;
                logger.fine("deleteAttributes time=" + (duration2));
                em.statsAttsDeleted(attsToDelete2.size(), duration2);
            } else {
                logger.fine("deleteAttributes time= no nulled fields, nothing to delete.");
            }
        } else {
            if (!newObject && attsToDelete.size() > 0) {
                // not enhanced, but still have to deal with deleted attributes
                start2 = System.currentTimeMillis();
//                for (ItemAttribute itemAttribute : attsToDelete) {
//                    System.out.println("itemAttr=" + itemAttribute.getName() + ": " + itemAttribute.getValue());
//                }
                this.em.getSimpleDb().deleteAttributes(new DeleteAttributesRequest()
                .withDomainName(domainName)
                .withItemName(id)
                .withAttributes(attsToDelete));
                // todo: what about lobs?  need to delete from s3
                duration2 = System.currentTimeMillis() - start2;
View Full Code Here

                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

    private void deleteAll(AmazonSimpleDB db, String domainName, List<Item> itemList) throws AmazonClientException {
        System.out.println("Deleting " + itemList.size() + " items from domain " + domainName);
        for (Item item : itemList) {

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

        LOGGER.debug("Delete Domain\"{}\" ItemName \"{}\"", domainName, itemName);

        Assert.notNull(domainName, "Domain name should not be null");
        Assert.notNull(itemName, "Item name should not be null");

        getDB().deleteAttributes(new DeleteAttributesRequest(domainName, itemName));
    }
View Full Code Here

        if (id == null)
            throw new IllegalArgumentException("Id cannot be null.");

        String  table = jsoda.getModelTable(modelName);
        String  idValue = makeIdValue(modelName, id, rangeKey);
        sdbClient.deleteAttributes(new DeleteAttributesRequest(table, idValue));
    }
View Full Code Here

                    String columnName = ai.getPersistentProperty(s).getColumnName();
                    attsToDelete2.add(new Attribute(columnName, null));
                }
                start2 = System.currentTimeMillis();
                this.em.getSimpleDb().deleteAttributes(
                        new DeleteAttributesRequest().withDomainName(domainName).withItemName(id)
                                .withAttributes(attsToDelete2));

                // todo: what about lobs? need to delete from s3
                duration2 = System.currentTimeMillis() - start2;
                logger.fine("deleteAttributes time=" + (duration2));
                em.statsAttsDeleted(attsToDelete2.size(), duration2);
            } else {
                logger.fine("deleteAttributes time= no nulled fields, nothing to delete.");
            }
        } else {
            if (!newObject && attsToDelete.size() > 0) {
                // not enhanced, but still have to deal with deleted attributes
                start2 = System.currentTimeMillis();
                // for (ItemAttribute itemAttribute : attsToDelete) {
                // System.out.println("itemAttr=" + itemAttribute.getName() +
                // ": " + itemAttribute.getValue());
                // }
                this.em.getSimpleDb().deleteAttributes(
                        new DeleteAttributesRequest().withDomainName(domainName).withItemName(id)
                                .withAttributes(attsToDelete));
                // todo: what about lobs? need to delete from s3
                duration2 = System.currentTimeMillis() - start2;
                logger.fine("deleteAttributes time=" + (duration2));
                em.statsAttsDeleted(attsToDelete.size(), duration2);
View Full Code Here

TOP

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

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.