Class AwsSecretCache.Options.Builder
java.lang.Object
codes.grow.packages.awssecretsmanager.AwsSecretCache.Options.Builder
- Enclosing class:
AwsSecretCache.Options
Builder of
AwsSecretCache.Options.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and validates the options.Sets the clock (tests).maxEntries(int maxEntries) Sets the LRU capacity (default 1 024).onRefreshError(Consumer<Throwable> handler) Sets a handler called when a refresh fails and the cached value is served instead.Sets the refresh interval (default 1 h).versionStage(String versionStage) Sets the default stage label (defaultAWSCURRENT).
-
Method Details
-
ttl
Sets the refresh interval (default 1 h).- Parameters:
ttl- positive duration- Returns:
- this builder
-
maxEntries
Sets the LRU capacity (default 1 024).- Parameters:
maxEntries- at least 1- Returns:
- this builder
-
versionStage
Sets the default stage label (defaultAWSCURRENT).- Parameters:
versionStage- stage- Returns:
- this builder
-
clock
Sets the clock (tests).- Parameters:
clock- clock- Returns:
- this builder
-
onRefreshError
Sets a handler called when a refresh fails and the cached value is served instead.- Parameters:
handler- handler- Returns:
- this builder
-
build
Builds and validates the options.- Returns:
- the options
- Throws:
ValidationException- when a value is out of range
-