Class ProviderStore
java.lang.Object
com.amazonaws.services.dynamodbv2.datamodeling.encryption.providers.store.ProviderStore
- Direct Known Subclasses:
MetaStore
Provides a standard way to retrieve and optionally create
EncryptionMaterialsProvider
s
backed by some form of persistent storage.- Author:
- rubin
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract long
getMaxVersion
(String materialName) Returns the maximum version number associated withmaterialName
.getOrCreate
(String materialName, long nextId) Returns the provider with the specified name and version and creates it if it doesn't exist.getProvider
(String materialName) Returns the most recent provider with the specified name.abstract EncryptionMaterialsProvider
getProvider
(String materialName, long version) Returns the provider with the specified name and version.abstract long
getVersionFromMaterialDescription
(Map<String, String> description) Extracts the material version fromdescription
.newProvider
(String materialName) Creates a new provider with a version one greater than the current max version.
-
Constructor Details
-
ProviderStore
public ProviderStore()
-
-
Method Details
-
getProvider
Returns the most recent provider with the specified name. If there are no providers with this name, it will create one with version 0. -
getProvider
Returns the provider with the specified name and version.- Throws:
IndexOutOfBoundsException
- ifversion
is not a valid version
-
newProvider
Creates a new provider with a version one greater than the current max version. If multiple clients attempt to create a provider with this same version simultaneously, they will properly coordinate and the result will be that a single provider is created and that all ProviderStores return the same one. -
getOrCreate
Returns the provider with the specified name and version and creates it if it doesn't exist.- Throws:
UnsupportedOperationException
- if a new provider cannot be created
-
getMaxVersion
Returns the maximum version number associated withmaterialName
. If there are no versions, returns -1. -
getVersionFromMaterialDescription
Extracts the material version fromdescription
.
-