public static class CachingCryptoMaterialsManager.Builder extends Object
Modifier and Type | Method and Description |
---|---|
CachingCryptoMaterialsManager |
build() |
CachingCryptoMaterialsManager.Builder |
withBackingMaterialsManager(CryptoMaterialsManager backingCMM)
Sets the
CryptoMaterialsManager that should be queried when the CachingCryptoMaterialsManager
incurs a cache miss. |
CachingCryptoMaterialsManager.Builder |
withByteUseLimit(long byteUseLimit)
Sets the maximum number of plaintext bytes that can be encrypted under the same a cached data key.
|
CachingCryptoMaterialsManager.Builder |
withCache(CryptoMaterialsCache cache)
Sets the cache to which this
CryptoMaterialsManager will be bound. |
CachingCryptoMaterialsManager.Builder |
withMasterKeyProvider(MasterKeyProvider mkp)
Sets the
MasterKeyProvider that should be queried when the CachingCryptoMaterialsManager
incurs a cache miss. |
CachingCryptoMaterialsManager.Builder |
withMaxAge(long maxAge,
TimeUnit units)
Sets the maximum lifetime for entries in the cache, for both encrypt and decrypt operations.
|
CachingCryptoMaterialsManager.Builder |
withMessageUseLimit(long messageUseLimit)
Sets the maximum number of individual messages that can be encrypted under the same a cached data key.
|
CachingCryptoMaterialsManager.Builder |
withPartitionId(String partitionId)
Sets the partition ID for this CMM.
|
public CachingCryptoMaterialsManager.Builder withBackingMaterialsManager(CryptoMaterialsManager backingCMM)
CryptoMaterialsManager
that should be queried when the CachingCryptoMaterialsManager
incurs a cache miss.
You can set either a MasterKeyProvider or a CryptoMaterialsManager to back the CCMM - the last value set will
be used.backingCMM
- The CryptoMaterialsManager to invoke on cache missespublic CachingCryptoMaterialsManager.Builder withMasterKeyProvider(MasterKeyProvider mkp)
MasterKeyProvider
that should be queried when the CachingCryptoMaterialsManager
incurs a cache miss.
You can set either a MasterKeyProvider or a CryptoMaterialsManager to back the CCMM - the last value set will
be used.
This method is equivalent to calling withBackingMaterialsManager(CryptoMaterialsManager)
passing a
DefaultCryptoMaterialsManager
constructed using your MasterKeyProvider
.mkp
- The MasterKeyProvider to invoke on cache missespublic CachingCryptoMaterialsManager.Builder withCache(CryptoMaterialsCache cache)
CryptoMaterialsManager
will be bound.cache
- The cache to associate with the CMMpublic CachingCryptoMaterialsManager.Builder withPartitionId(String partitionId)
partitionId
- The partition IDpublic CachingCryptoMaterialsManager.Builder withMaxAge(long maxAge, TimeUnit units)
maxAge
- The amount of time entries are allowed to live. Must be positive.units
- The units maxAge is expressed inpublic CachingCryptoMaterialsManager.Builder withMessageUseLimit(long messageUseLimit)
IllegalArgumentException
will be thrown.messageUseLimit
- The maximum number of messages that can be encrypted by the same data key. Must be
positive.public CachingCryptoMaterialsManager.Builder withByteUseLimit(long byteUseLimit)
byteUseLimit
- The maximum number of bytes that can be encrypted by the same data key. Must be
non-negative.public CachingCryptoMaterialsManager build()
Copyright © 2018. All rights reserved.