Examples of DeleteAttributesRequest


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

                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

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

    public void deleteClusters(Cluster... clusters) {
        Validate.notNull(clusters);
        LOGGER.info(String.format("Deleting %d clusters", clusters.length));
        for (Cluster cluster : clusters) {
            LOGGER.info(String.format("Deleting cluster %s", cluster.getName()));
            simpleDBClient.deleteAttributes(new DeleteAttributesRequest(domain, getSimpleDBItemName(cluster)));
            LOGGER.info(String.format("Successfully deleted cluster %s", cluster.getName()));
        }
    }
View Full Code Here

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

     * @throws AmazonServiceException
     */
    public void deregisterInstance(PriamInstance instance) throws AmazonServiceException
    {
        AmazonSimpleDBClient simpleDBClient = getSimpleDBClient();
        DeleteAttributesRequest delReq = new DeleteAttributesRequest(DOMAIN, getKey(instance), createAttributesToDeRegister(instance));
        simpleDBClient.deleteAttributes(delReq);
    }
View Full Code Here

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

                    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

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

    public Object call() throws Exception {
        String domainName = em.getOrCreateDomain(toDelete.getClass());
        if(logger.isLoggable(Level.FINE)) logger.fine("deleting item with id: " + id);
        em.invokeEntityListener(toDelete, PreRemove.class);
        this.em.getSimpleDb().deleteAttributes(new DeleteAttributesRequest()
          .withDomainName(domainName)
          .withItemName(id));
        em.invokeEntityListener(toDelete, PostRemove.class);
        return toDelete;
    }
View Full Code Here

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

                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

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

        String domain = delete.getTable().getName();
        Expression express = delete.getWhere();

        String[] vals = express.toString().split("=");

        DeleteAttributesRequest req = new DeleteAttributesRequest();
        req.setDomainName(domain);
        //if vals doesn't include id, then find one with an id
        if (vals[0].equalsIgnoreCase("id")) {
            String value = SimpleDBUtils.quoteValue(this.args.get(0));           
            req.setItemName(value);
            this.connection.getSimpleDB().deleteAttributes(req);
            returnval = 1;
        } else {
            String qury = "SELECT * FROM " + SimpleDBUtils.quoteName(domain) +
                    " WHERE " + express.toString();
                       
            int argsSize = this.args.size();
            for (int x = 0; x < argsSize; x++) {
                qury = qury.replaceFirst("\\?", SimpleDBUtils.quoteValue(this.args.get(x)));
            }
           
            SelectRequest selectRequest = new SelectRequest(qury);
            List<Item> items = this.connection.getSimpleDB().select(selectRequest).getItems();

            for (Item item : items) {
                req.setItemName(item.getName());
                this.connection.getSimpleDB().deleteAttributes(req);
                returnval++;
            }
        }
        return returnval;
View Full Code Here

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

            System.out.println();

            // Delete values from an attribute
            System.out.println("Deleting Blue attributes in Item_O3.\n");
            Attribute deleteValueAttribute = new Attribute("Color", "Blue");
            sdb.deleteAttributes(new DeleteAttributesRequest(myDomain, "Item_03")
                    .withAttributes(deleteValueAttribute));

            // Delete an attribute and all of its values
            System.out.println("Deleting attribute Year in Item_O3.\n");
            sdb.deleteAttributes(new DeleteAttributesRequest(myDomain, "Item_03")
                    .withAttributes(new Attribute().withName("Year")));

            // Replace an attribute
            System.out.println("Replacing Size of Item_03 with Medium.\n");
            List<ReplaceableAttribute> replaceableAttributes = new ArrayList<ReplaceableAttribute>();
            replaceableAttributes.add(new ReplaceableAttribute("Size", "Medium", true));
            sdb.putAttributes(new PutAttributesRequest(myDomain, "Item_03", replaceableAttributes));

            // Delete an item and all of its attributes
            System.out.println("Deleting Item_03.\n");
            sdb.deleteAttributes(new DeleteAttributesRequest(myDomain, "Item_03"));

            // Delete a domain
            System.out.println("Deleting " + myDomain + " domain.\n");
            sdb.deleteDomain(new DeleteDomainRequest(myDomain));
        } catch (AmazonServiceException ase) {
View Full Code Here

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

  public boolean removeJob(SchedulingContext ctxt, String jobName,
      String groupName) {
    logDebug("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

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

      String groupName, boolean removeOrphanedJob) {
    logDebug("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
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.