I am using Guava LoadingCache for caching auth requests for the external storage. The key is the object Auth:
public class Auth {
private String username;
private String password;
public boolean equals(Object o);
}
and the response is HttpStatus, OK or FORBIDDEN.
When the password for username
in external storage is changed, I need to remove cache record for username
, but the problem is that the passwords storing only as a hash, not the original value, so I can't just construct new Auth object for invalidation, like:
cache.invalidate(new Auth(<username>, <password>));
How can I invalidate cache record, using only username
value?
Auth
as the key? – mfulton26username
as the key"? – mfulton26