public class AuthAttemptCache extends 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 |
---|---|
String |
get(String username,
String password)
Return the hash for the [username, password] if any
|
void |
invalidate(String username,
String password)
Remove a cache entry, if it exists.
|
void |
put(String username,
String password,
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 String get(String username, String password)
username
- The username.password
- The password.public void put(String username, String password, String hash)
username
- The username.password
- The password.hash
- The hash.