public final class DynamoDbPersistenceAdapter extends Object implements PersistenceAdapter
Modifier and Type | Class and Description |
---|---|
static class |
DynamoDbPersistenceAdapter.Builder
Static builder class to build an instance of
DynamoDbPersistenceAdapter . |
Modifier and Type | Method and Description |
---|---|
static DynamoDbPersistenceAdapter.Builder |
builder()
Static method to build an instance of Builder.
|
void |
deleteAttributes(com.amazon.ask.model.RequestEnvelope envelope)
Deletes attributes from DynamoDB table.
|
Optional<Map<String,Object>> |
getAttributes(com.amazon.ask.model.RequestEnvelope envelope)
Gets attributes from DynamoDB table.
|
void |
saveAttributes(com.amazon.ask.model.RequestEnvelope envelope,
Map<String,Object> attributes)
Saves attributes to a DynamoDB table.
|
public static DynamoDbPersistenceAdapter.Builder builder()
DynamoDbPersistenceAdapter.Builder
.public Optional<Map<String,Object>> getAttributes(com.amazon.ask.model.RequestEnvelope envelope) throws PersistenceException
getAttributes
in interface PersistenceAdapter
envelope
- instance of RequestEnvelope
.Map
of String, Object if attributes exist, or an empty Optional
if not.PersistenceException
- if table doesn't exist or attributes retrieval fails.public void saveAttributes(com.amazon.ask.model.RequestEnvelope envelope, Map<String,Object> attributes) throws PersistenceException
saveAttributes
in interface PersistenceAdapter
envelope
- instance of RequestEnvelope
.attributes
- to be stored in the table.PersistenceException
- if table doesn't exist or save attributes operation fails.public void deleteAttributes(com.amazon.ask.model.RequestEnvelope envelope) throws PersistenceException
deleteAttributes
in interface PersistenceAdapter
envelope
- instance of RequestEnvelope
.PersistenceException
- if table doesn't exist or save attributes operation fails.Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.