public interface DynamoDBItemTransformer<K,V>
To specify an entry transformer for a given Infinispan cache that is
backed by a DynamoDB store, provide its class name to the
store configuration
.
Modifier and Type | Interface and Description |
---|---|
static interface |
DynamoDBItemTransformer.InitContext
Initialisation context.
|
Modifier and Type | Method and Description |
---|---|
String |
getHashKeyAttributeName()
Returns the DynamoDB hash key attribute name.
|
default String |
getRangeKeyAttributeName()
Returns the optional DynamoDB range key attribute name.
|
String |
getTableName()
Returns the base name of the DynamoDB table.
|
default String |
getTTLAttributeName()
Returns the optional DynamoDB time-to-live attribute name.
|
default void |
init(DynamoDBItemTransformer.InitContext initContext)
Provides initialisation.
|
String |
resolveHashKey(K key)
Deprecated.
|
default PrimaryKeyValue |
resolvePrimaryKey(K key)
Resolves the DynamoDB primary key (hash key value of scalar
attribute type string, with optional additional range key value) for
the specified Infinispan entry key.
|
com.nimbusds.infinispan.persistence.common.InfinispanEntry<K,V> |
toInfinispanEntry(com.amazonaws.services.dynamodbv2.document.Item item)
Transforms the specified DynamoDB item to an Infinispan entry (key /
value / metadata triple).
|
com.amazonaws.services.dynamodbv2.document.Item |
toItem(com.nimbusds.infinispan.persistence.common.InfinispanEntry<K,V> infinispanEntry)
Transforms the specified Infinispan entry (key / value pair with
optional metadata) to a DynamoDB item.
|
default void init(DynamoDBItemTransformer.InitContext initContext)
initContext
- The initialisation context.String getTableName()
table-prefix
to the base name.String getHashKeyAttributeName()
default String getRangeKeyAttributeName()
null
if none.default String getTTLAttributeName()
null
if none.@Deprecated String resolveHashKey(K key)
Use resolvePrimaryKey(Object)
instead.
key
- The Infinispan entry key. Not null
.default PrimaryKeyValue resolvePrimaryKey(K key)
key
- The Infinispan entry key. Not null
.com.amazonaws.services.dynamodbv2.document.Item toItem(com.nimbusds.infinispan.persistence.common.InfinispanEntry<K,V> infinispanEntry)
Example:
Infinispan entry:
uid=cae7t
,
givenName=Alice
, surname=Adams
and
[email protected]
.
Resulting DynamoDB item:
uid: cae7t (key) surname: Adams given_name: Alice email: [email protected]
infinispanEntry
- The Infinispan entry. Not null
.com.nimbusds.infinispan.persistence.common.InfinispanEntry<K,V> toInfinispanEntry(com.amazonaws.services.dynamodbv2.document.Item item)
Example:
DynamoDB item:
uid: cae7t surname: Adams given_name: Alice email: [email protected]
Resulting Infinispan entry:
uid=cae7t
,
givenName=Alice
, surname=Adams
and
[email protected]
.
item
- The DynamoDB item. Must not be null
.Copyright © 2021 Connect2id Ltd.. All rights reserved.