/** * Set the hash and range key attributes of the item. * <p> * For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide * both. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param hashKey * a map entry including the name and value of the primary hash key. * @param rangeKey * a map entry including the name and value of the primary range key, or null if it is a hash-only table. */ public DeleteItemRequest withKey(java.util.Map.Entry<String, AttributeValue> hashKey, java.util.Map.Entry<String, AttributeValue> rangeKey) throws IllegalArgumentException { setKey(hashKey, rangeKey); return this; }
/** * <p> * A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to * delete. * </p> * <p> * For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only * need to provide a value for the partition key. For a composite primary key, you must provide values for both the * partition key and the sort key. * </p> * * @param key * A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item * to delete.</p> * <p> * For the primary key, you must provide all of the attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, you must provide values * for both the partition key and the sort key. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteItemRequest withKey(java.util.Map<String, AttributeValue> key) { setKey(key); return this; }
/** * Constructs a new DeleteItemRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param tableName * The name of the table from which to delete the item. * @param key * A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item * to delete.</p> * <p> * For the primary key, you must provide all of the attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, you must provide values * for both the partition key and the sort key. */ public DeleteItemRequest(String tableName, java.util.Map<String, AttributeValue> key) { setTableName(tableName); setKey(key); }
/** * Set the hash and range key attributes of the item. * <p> * For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide * both. * * @param hashKey * a map entry including the name and value of the primary hash key. * @param rangeKey * a map entry including the name and value of the primary range key, or null if it is a hash-only table. */ public void setKey(java.util.Map.Entry<String, AttributeValue> hashKey, java.util.Map.Entry<String, AttributeValue> rangeKey) throws IllegalArgumentException { java.util.HashMap<String, AttributeValue> key = new java.util.HashMap<String, AttributeValue>(); if (hashKey != null) { key.put(hashKey.getKey(), hashKey.getValue()); } else { throw new IllegalArgumentException("hashKey must be non-null object."); } if (rangeKey != null) { key.put(rangeKey.getKey(), rangeKey.getValue()); } setKey(key); }
setKey(key); setReturnValues(returnValues);
setKey(key); setReturnValues(returnValues.toString());
/** * Constructs a new DeleteItemRequest object. Callers should use the setter * or fluent setter (with...) methods to initialize any additional object * members. * * @param tableName <p> * The name of the table from which to delete the item. * </p> * @param key <p> * A map of attribute names to <code>AttributeValue</code> * objects, representing the primary key of the item to delete. * </p> * <p> * For the primary key, you must provide all of the attributes. * For example, with a simple primary key, you only need to * provide a value for the partition key. For a composite primary * key, you must provide values for both the partition key and * the sort key. * </p> */ public DeleteItemRequest(String tableName, java.util.Map<String, AttributeValue> key) { setTableName(tableName); setKey(key); }
String returnValues) { setTableName(tableName); setKey(key); setReturnValues(returnValues);
ReturnValue returnValues) { setTableName(tableName); setKey(key); setReturnValues(returnValues.toString());
DeleteItemRequest deleteItemRequest = new DeleteItemRequest(); deleteItemRequest.setTableName(tableName); deleteItemRequest.setKey(key); return deleteItem(deleteItemRequest);
DeleteItemRequest deleteItemRequest = new DeleteItemRequest(); deleteItemRequest.setTableName(tableName); deleteItemRequest.setKey(key); deleteItemRequest.setReturnValues(returnValues); return deleteItem(deleteItemRequest);
/** * Set the hash and range key attributes of the item. * <p> * For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide * both. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param hashKey * a map entry including the name and value of the primary hash key. * @param rangeKey * a map entry including the name and value of the primary range key, or null if it is a hash-only table. */ public DeleteItemRequest withKey(java.util.Map.Entry<String, AttributeValue> hashKey, java.util.Map.Entry<String, AttributeValue> rangeKey) throws IllegalArgumentException { setKey(hashKey, rangeKey); return this; }
/** * <p> * A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to * delete. * </p> * <p> * For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only * need to provide a value for the partition key. For a composite primary key, you must provide values for both the * partition key and the sort key. * </p> * * @param key * A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item * to delete.</p> * <p> * For the primary key, you must provide all of the attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, you must provide values * for both the partition key and the sort key. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteItemRequest withKey(java.util.Map<String, AttributeValue> key) { setKey(key); return this; }
public DeletePointRequest(GeoPoint geoPoint, AttributeValue rangeKeyValue) { deleteItemRequest = new DeleteItemRequest(); deleteItemRequest.setKey(new HashMap<String, AttributeValue>()); this.geoPoint = geoPoint; this.rangeKeyValue = rangeKeyValue; }
/** * Constructs a new DeleteItemRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param tableName * The name of the table from which to delete the item. * @param key * A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item * to delete.</p> * <p> * For the primary key, you must provide all of the attributes. For example, with a simple primary key, you * only need to provide a value for the partition key. For a composite primary key, you must provide values * for both the partition key and the sort key. */ public DeleteItemRequest(String tableName, java.util.Map<String, AttributeValue> key) { setTableName(tableName); setKey(key); }
/** * Set the hash and range key attributes of the item. * <p> * For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide * both. * * @param hashKey * a map entry including the name and value of the primary hash key. * @param rangeKey * a map entry including the name and value of the primary range key, or null if it is a hash-only table. */ public void setKey(java.util.Map.Entry<String, AttributeValue> hashKey, java.util.Map.Entry<String, AttributeValue> rangeKey) throws IllegalArgumentException { java.util.HashMap<String, AttributeValue> key = new java.util.HashMap<String, AttributeValue>(); if (hashKey != null) { key.put(hashKey.getKey(), hashKey.getValue()); } else { throw new IllegalArgumentException("hashKey must be non-null object."); } if (rangeKey != null) { key.put(rangeKey.getKey(), rangeKey.getValue()); } setKey(key); }
/** * {@inheritDoc} */ public void deleteAll() throws DependencyException, InvalidStateException, ProvisionedThroughputException { List<T> allLeases = listLeases(); LOG.warn("Deleting " + allLeases.size() + " items from table " + table); for (T lease : allLeases) { DeleteItemRequest deleteRequest = new DeleteItemRequest(); deleteRequest.setTableName(table); deleteRequest.setKey(serializer.getDynamoHashKey(lease)); dynamoDBClient.deleteItem(deleteRequest); } }
/** * {@inheritDoc} */ @Override public void deleteLease(T lease) throws DependencyException, InvalidStateException, ProvisionedThroughputException { verifyNotNull(lease, "lease cannot be null"); if (LOG.isDebugEnabled()) { LOG.debug(String.format("Deleting lease with leaseKey %s", lease.getLeaseKey())); } DeleteItemRequest deleteRequest = new DeleteItemRequest(); deleteRequest.setTableName(table); deleteRequest.setKey(serializer.getDynamoHashKey(lease)); try { dynamoDBClient.deleteItem(deleteRequest); } catch (AmazonClientException e) { throw convertAndRethrowExceptions("delete", lease.getLeaseKey(), e); } }
setKey(key); setReturnValues(returnValues.toString());
deleteItemRequest.setKey(record.getDynamodb().getKeys()); deleteItemRequest.setTableName(getTableName()); request = deleteItemRequest;