Class ProviderStore
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.datamodeling.encryption.providers.store.ProviderStore
-
- Direct Known Subclasses:
MetaStore
public abstract class ProviderStore extends Object
Provides a standard way to retrieve and optionally createEncryptionMaterialsProviders backed by some form of persistent storage.- Author:
- rubin
-
-
Constructor Summary
Constructors Constructor Description ProviderStore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract longgetMaxVersion(String materialName)Returns the maximum version number associated withmaterialName.EncryptionMaterialsProvidergetOrCreate(String materialName, long nextId)Returns the provider with the specified name and version and creates it if it doesn't exist.EncryptionMaterialsProvidergetProvider(String materialName)Returns the most recent provider with the specified name.abstract EncryptionMaterialsProvidergetProvider(String materialName, long version)Returns the provider with the specified name and version.abstract longgetVersionFromMaterialDescription(Map<String,String> description)Extracts the material version fromdescription.EncryptionMaterialsProvidernewProvider(String materialName)Creates a new provider with a version one greater than the current max version.
-
-
-
Method Detail
-
getProvider
public EncryptionMaterialsProvider getProvider(String materialName)
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
public abstract EncryptionMaterialsProvider getProvider(String materialName, long version)
Returns the provider with the specified name and version.- Throws:
IndexOutOfBoundsException- ifversionis not a valid version
-
newProvider
public EncryptionMaterialsProvider newProvider(String materialName)
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
public EncryptionMaterialsProvider getOrCreate(String materialName, long nextId)
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
public abstract long getMaxVersion(String materialName)
Returns the maximum version number associated withmaterialName. If there are no versions, returns -1.
-
-