Class SecretCacheItem
java.lang.Object
com.amazonaws.secretsmanager.caching.cache.SecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>
com.amazonaws.secretsmanager.caching.cache.SecretCacheItem
public class SecretCacheItem
extends SecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>
The cached secret item which contains information from the DescribeSecret
request to AWS Secrets Manager along with any associated GetSecretValue
results.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSecretCacheItem(String secretId, software.amazon.awssdk.services.secretsmanager.SecretsManagerClient client, SecretCacheConfiguration config) Construct a new cached item for the secret. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponseExecute the logic to perform the actual refresh of the item.protected software.amazon.awssdk.services.secretsmanager.model.GetSecretValueResponsegetSecretValue(software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse describeResponse) Return the cached result from AWS Secrets Manager for GetSecretValue.inthashCode()protected booleanDetermine if the secret object should be refreshed.toString()Methods inherited from class com.amazonaws.secretsmanager.caching.cache.SecretCacheObject
getSecretValue, refreshNow
-
Constructor Details
-
SecretCacheItem
public SecretCacheItem(String secretId, software.amazon.awssdk.services.secretsmanager.SecretsManagerClient client, SecretCacheConfiguration config) Construct a new cached item for the secret.- Parameters:
secretId- The secret identifier. This identifier could be the full ARN or the friendly name for the secret.client- The AWS Secrets Manager client to use for requesting the secret.config- Cache configuration.
-
-
Method Details
-
equals
- Specified by:
equalsin classSecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>
-
hashCode
public int hashCode()- Specified by:
hashCodein classSecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>
-
toString
- Specified by:
toStringin classSecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>
-
isRefreshNeeded
protected boolean isRefreshNeeded()Determine if the secret object should be refreshed. This method extends the base class functionality to check if a refresh is needed based on the configured TTL for the item.- Overrides:
isRefreshNeededin classSecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>- Returns:
- True if the secret item should be refreshed.
-
executeRefresh
protected software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse executeRefresh()Execute the logic to perform the actual refresh of the item.- Specified by:
executeRefreshin classSecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>- Returns:
- The result from AWS Secrets Manager for the refresh.
-
getSecretValue
protected software.amazon.awssdk.services.secretsmanager.model.GetSecretValueResponse getSecretValue(software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse describeResponse) Return the cached result from AWS Secrets Manager for GetSecretValue.- Specified by:
getSecretValuein classSecretCacheObject<software.amazon.awssdk.services.secretsmanager.model.DescribeSecretResponse>- Parameters:
describeResponse- The result of the Describe Secret request to AWS Secrets Manager.- Returns:
- The cached GetSecretValue result.
-