Use the CachingMostRecentProvider, which uses a user defined TTL value to also expire the cached materials themselves, forcing the keystore to regularly re-obtain materials.
@Deprecated 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
Deprecated.
|
| Constructor and Description |
|---|
MostRecentProvider(ProviderStore keystore,
String materialName,
long ttlInMillis)
Deprecated.
Creates a new
MostRecentProvider. |
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrentVersion()
Deprecated.
The current version of the materials being used for encryption.
|
DecryptionMaterials |
getDecryptionMaterials(EncryptionContext context)
Deprecated.
Retrieves encryption materials matching the specified description from some source.
|
EncryptionMaterials |
getEncryptionMaterials(EncryptionContext context)
Deprecated.
Returns EncryptionMaterials which the caller can use for encryption.
|
long |
getLastUpdated()
Deprecated.
The last time the current version was updated.
|
String |
getMaterialName()
Deprecated.
|
protected String |
getMaterialName(EncryptionContext context)
Deprecated.
|
long |
getTtlInMills()
Deprecated.
|
void |
refresh()
Deprecated.
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 © 2022. All rights reserved.