public class AuthAttemptCache
extends java.lang.Object
Constructor and Description |
---|
AuthAttemptCache()
Create an AuthAttemptCache using default values of ttl and maxSize
|
AuthAttemptCache(long ttlMs,
int maxSize,
org.apache.kafka.common.utils.Time time,
int maxEntriesPerCleanup)
Create an AuthAttemptCache.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String username,
java.lang.String password)
Return the hash for the [username, password] if any
|
void |
invalidate(java.lang.String username,
java.lang.String password)
Remove a cache entry, if it exists.
|
void |
put(java.lang.String username,
java.lang.String password,
java.lang.String hash)
Cache an authorisation.
|
public AuthAttemptCache(long ttlMs, int maxSize, org.apache.kafka.common.utils.Time time, int maxEntriesPerCleanup)
ttl
- How long to cache entries, in milliseconds.
The timer is reset on each access.maxSize
- The maximum number of entries in the cache.
When necessary, the cache will evict the oldest elements.time
- The Kafka time object to provide time.public AuthAttemptCache()
public java.lang.String get(java.lang.String username, java.lang.String password)
username
- The username.password
- The password.public void put(java.lang.String username, java.lang.String password, java.lang.String hash)
username
- The username.password
- The password.hash
- The hash.public void invalidate(java.lang.String username, java.lang.String password)
username
- The usernamepassword
- The password