Package com.amazonaws.services.dynamodb.model

Examples of com.amazonaws.services.dynamodb.model.DeleteRequest


      for (WriteRequest writeRequest : writeRequests) {
        PutRequest putRequest = writeRequest.getPutRequest();
        if (putRequest != null) {
          this.tables.get(tableName).putItem(putRequest.getItem());
        }
        DeleteRequest deleteRequest = writeRequest.getDeleteRequest();
        if (deleteRequest != null) {
          Key key = deleteRequest.getKey();
          if (key != null) {
            this.tables.get(tableName).removeItem(key.getHashKeyElement().getS());
          }
        }
      }
View Full Code Here


                    jsonWriter.key(tableKey).array();
                    for (WriteRequest request : unprocessedItems.get(tableKey)) {
                        //begin each object of array
                        jsonWriter.object();
                        PutRequest putRequest = request.getPutRequest();
                        DeleteRequest deleteRequest = request.getDeleteRequest();
                        if (putRequest != null) {
                            //Begin put request
                            jsonWriter.key("PutRequest").object();
                            Map<String, AttributeValue> item = putRequest.getItem();
                            if (item != null) {
                                for (String itemKey : item.keySet()) {
                                    //begin attribute value
                                    jsonWriter.key(itemKey).object();
                                    AttributeValue value = item.get(itemKey);
                                    if (value.getN() != null) {
                                        jsonWriter.key("N").value(value.getN());
                                    } else if (value.getS() != null) {
                                        jsonWriter.key("S").value(value.getS());
                                    } else if (value.getB() != null) {
                                        jsonWriter.key("B").value(value.getS());
                                    } else if (value.getSS() != null) {
                                        jsonWriter.key("SS").value(value.getS());
                                    } else if (value.getNS() != null) {
                                        jsonWriter.key("NS").value(value.getNS());
                                    } else if (value.getBS() != null) {
                                        jsonWriter.key("BS").value(value.getSS());
                                    }
                                    //end attribute value
                                    jsonWriter.endObject();
                                }
                            }
                            //end put request
                            jsonWriter.endObject();
                        } else if (deleteRequest != null) {
                            //Begin delete request
                            jsonWriter.key("DeleteRequest").object();
                            Key key = deleteRequest.getKey();
                            if (key != null) {
                                //begin key
                                jsonWriter.key("Key").object();
                                AttributeValue hashKeyElemenet = key.getHashKeyElement();
                                AttributeValue rangeKeyElement = key.getRangeKeyElement();
View Full Code Here

            if ( !requestItems.containsKey(tableName) ) {
                requestItems.put(tableName, new LinkedList<WriteRequest>());
            }

            requestItems.get(tableName).add(
                    new WriteRequest().withDeleteRequest(new DeleteRequest().withKey(objectKey)));
        }

        // Break into chunks of 25 items and make service requests to DynamoDB
        while ( !requestItems.isEmpty() ) {
            HashMap<String, List<WriteRequest>> batch = new HashMap<String, List<WriteRequest>>();
View Full Code Here

            if ( !requestItems.containsKey(tableName) ) {
                requestItems.put(tableName, new LinkedList<WriteRequest>());
            }

            requestItems.get(tableName).add(
                    new WriteRequest().withDeleteRequest(new DeleteRequest().withKey(objectKey)));
        }

        // Break into chunks of 25 items and make service requests to DynamoDB
        while ( !requestItems.isEmpty() ) {
            HashMap<String, List<WriteRequest>> batch = new HashMap<String, List<WriteRequest>>();
View Full Code Here

            if ( !requestItems.containsKey(tableName) ) {
                requestItems.put(tableName, new LinkedList<WriteRequest>());
            }

            requestItems.get(tableName).add(
                    new WriteRequest().withDeleteRequest(new DeleteRequest().withKey(objectKey)));
        }

        // Break into chunks of 25 items and make service requests to DynamoDB
        while ( !requestItems.isEmpty() ) {
            HashMap<String, List<WriteRequest>> batch = new HashMap<String, List<WriteRequest>>();
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.model.DeleteRequest

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.