Examples of PutAttributesRequest


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

        Map<String, String> fieldToValueMap = cluster.getFieldToValueMap();
        for (Map.Entry<String, String> entry : fieldToValueMap.entrySet()) {
            attrs.add(new ReplaceableAttribute(entry.getKey(), StringUtils.left(entry.getValue(), MAX_ATTR_SIZE),
                    true));
        }
        PutAttributesRequest putReqest = new PutAttributesRequest(domain, getSimpleDBItemName(cluster), attrs);
        LOGGER.debug(String.format("Saving cluster %s to SimpleDB domain %s",
                cluster.getName(), domain));
        this.simpleDBClient.putAttributes(putReqest);
        LOGGER.debug("Successfully saved.");
    }
View Full Code Here

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

            }
            attrs.add(new ReplaceableAttribute(pair.getKey(), pair.getValue(), true));
        }
        // Let pk contain the timestamp so that the same resource can have multiple events.
        String pk = String.format("%s-%s-%s-%s", evt.monkeyType().name(), evt.id(), region, evtTime);
        PutAttributesRequest putReq = new PutAttributesRequest(domain, pk, attrs);
        sdbClient().putAttributes(putReq);

    }
View Full Code Here

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

        List<ReplaceableAttribute> attrs = new ArrayList<ReplaceableAttribute>();
        Map<String, String> fieldToValueMap = resource.getFieldToValueMap();
        for (Map.Entry<String, String> entry : fieldToValueMap.entrySet()) {
            attrs.add(new ReplaceableAttribute(entry.getKey(), entry.getValue(), true));
        }
        PutAttributesRequest putReqest = new PutAttributesRequest(domain, getSimpleDBItemName(resource), attrs);
        LOGGER.debug(String.format("Saving resource %s to SimpleDB domain %s",
                resource.getId(), domain));
        this.simpleDBClient.putAttributes(putReqest);
        LOGGER.debug("Successfully saved.");
    }
View Full Code Here

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

  private void updateState(TriggerWrapper tw) {
    logDebug("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

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

     * @throws AmazonServiceException
     */
    public void createInstance(PriamInstance instance) throws AmazonServiceException
    {
        AmazonSimpleDBClient simpleDBClient = getSimpleDBClient();
        PutAttributesRequest putReq = new PutAttributesRequest(DOMAIN, getKey(instance), createAttributesToRegister(instance));
        simpleDBClient.putAttributes(putReq);
    }
View Full Code Here

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

     * @throws AmazonServiceException
     */
    public void registerInstance(PriamInstance instance) throws AmazonServiceException
    {
        AmazonSimpleDBClient simpleDBClient = getSimpleDBClient();
        PutAttributesRequest putReq = new PutAttributesRequest(DOMAIN, getKey(instance), createAttributesToRegister(instance));
        UpdateCondition expected = new UpdateCondition();
        expected.setName(Attributes.INSTANCE_ID);
        expected.setExists(false);
        putReq.setExpected(expected);
        simpleDBClient.putAttributes(putReq);
    }
View Full Code Here

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

        if (succeeded) {
            attributes.add(new ReplaceableAttribute("ProcessedTimestamp",
                    format.format(new Date()), true));
        }
        // create an item in SimpleDB for this message
        PutAttributesRequest request = new PutAttributesRequest("sqs_log", // simpledb
                // domain
                // name
                message.getMessageId(), // item name
                attributes);
View Full Code Here

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

        if (!domainSet.contains(ctx.getDomain()))
            service.createDomain(new CreateDomainRequest(ctx.domain));
    }

    private void putAttribute(PutAttributesContext ctx, ObjectNode objectNode) {
        PutAttributesRequest request = new PutAttributesRequest();

        request.setDomainName(ctx.getDomain());

        Iterator<String> itFieldName = objectNode.getFieldNames();

        while (itFieldName.hasNext()) {
            String key = itFieldName.next();

            if ("name".equals(key)) {
                String value = objectNode.get("name").getTextValue();

                request.setItemName(value);
            } else if ("append".equals(key) || "replace".equals(key)) {
                boolean replaceP = "replace".equals(key);

                ArrayNode attributesNode = (ArrayNode) objectNode.get(key);

                Collection<ReplaceableAttribute> value = getAttributesFrom(attributesNode, replaceP);

                request.getAttributes().addAll(value);
            } else if ("expect".equals(key)) {
                ObjectNode expectNode = (ObjectNode) objectNode.get("expect");

                request.setExpected(getUpdateCondition(expectNode));
            }
        }

        service.putAttributes(request);
    }
View Full Code Here

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

        // 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)
                            .withExpected(expected));
            duration2 = System.currentTimeMillis() - start2;
            if (logger.isLoggable(Level.FINE))
                logger.fine("putAttributes time=" + (duration2));
            em.statsAttsPut(attsToPut.size(), duration2);
View Full Code Here

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

        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
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.