Class CachingResolver
java.lang.Object
com.ulisesbocchio.jasyptspringboot.caching.CachingResolver
CachingResolver class.
Handles the actual caching and resolution logic.- Version:
- $Id: $Id
- Author:
- Sergio.U.Bocchio
-
Constructor Summary
ConstructorsConstructorDescriptionCachingResolver(EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter, org.springframework.core.env.PropertySource<?> delegate) Constructor for CachingResolver. -
Method Summary
Modifier and TypeMethodDescriptionvoidrefresh()Refresh the cache.resolveProperty(String name) Resolve property with caching.
-
Constructor Details
-
CachingResolver
public CachingResolver(EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter, org.springframework.core.env.PropertySource<?> delegate) Constructor for CachingResolver.
- Parameters:
resolver- aEncryptablePropertyResolverobjectfilter- aEncryptablePropertyFilterobjectdelegate- the delegate PropertySource to retrieve values from
-
-
Method Details
-
resolveProperty
Resolve property with caching.
Retrieves the property value from the delegate and resolves it if needed. The purpose of this cache is to reduce the cost of decryption, so it's not a bad idea to read the original property every time, it's generally fast.- Parameters:
name- the property name- Returns:
- the resolved property value or the original value
-
refresh
public void refresh()Refresh the cache.
-