public class MostRecentProvider extends Object implements EncryptionMaterialsProvider
ProviderStore and decrypts using whichever version is appropriate. It also caches the
results from the ProviderStore to avoid excessive load on the backing systems. The cache
is not currently configurable.| Modifier and Type | Field and Description |
|---|---|
protected String |
defaultMaterialName |
| Constructor and Description |
|---|
MostRecentProvider(ProviderStore keystore,
String materialName,
long ttlInMillis)
Creates a new
MostRecentProvider. |
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrentVersion()
The current version of the materials being used for encryption.
|
DecryptionMaterials |
getDecryptionMaterials(EncryptionContext context)
Retrieves encryption materials matching the specified description from some source.
|
EncryptionMaterials |
getEncryptionMaterials(EncryptionContext context)
Returns EncryptionMaterials which the caller can use for encryption.
|
long |
getLastUpdated()
The last time the current version was updated.
|
String |
getMaterialName() |
protected String |
getMaterialName(EncryptionContext context) |
long |
getTtlInMills() |
void |
refresh()
Completely empties the cache of both the current and old versions.
|
protected final String defaultMaterialName
public MostRecentProvider(ProviderStore keystore, String materialName, long ttlInMillis)
MostRecentProvider.ttlInMillis - The length of time in milliseconds to cache the most recent providerpublic EncryptionMaterials getEncryptionMaterials(EncryptionContext context)
EncryptionMaterialsProvidergetEncryptionMaterials in interface EncryptionMaterialsProvidercontext - Information to assist in selecting a the proper return value. The implementation
is free to determine the minimum necessary for successful processing.public DecryptionMaterials getDecryptionMaterials(EncryptionContext context)
EncryptionMaterialsProvidergetDecryptionMaterials in interface EncryptionMaterialsProvidercontext - Information to assist in selecting a the proper return value. The implementation
is free to determine the minimum necessary for successful processing.public void refresh()
refresh in interface EncryptionMaterialsProviderpublic String getMaterialName()
public long getTtlInMills()
public long getCurrentVersion()
public long getLastUpdated()
protected String getMaterialName(EncryptionContext context)
Copyright © 2018. All rights reserved.