|
Squid Web Cache master
|
Cache of Auth::User credentials, keyed by Auth::User::userKey. More...
#include <CredentialsCache.h>
Public Member Functions | |
| CredentialsCache (const char *name, const char *const eventName) | |
| ~CredentialsCache ()=default | |
| CredentialsCache (const CredentialsCache &)=delete | |
| CredentialsCache & | operator= (const CredentialsCache &)=delete |
| Auth::User::Pointer | lookup (const SBuf &userKey) const |
| void | insert (const SBuf &userKey, const Auth::User::Pointer &anAuth_user) |
| add an user to the cache with the provided key | |
| void | reset () |
| clear cache | |
| size_t | size () const |
| void | cleanup () |
| cache garbage collection, removes timed-out entries | |
| void | doConfigChangeCleanup () |
| std::vector< Auth::User::Pointer > | sortedUsersList () const |
Static Public Member Functions | |
| static void | Cleanup (void *) |
Private Types | |
| typedef std::unordered_map< SBuf, Auth::User::Pointer > | StoreType |
| key is User::userKey(), mapped value is User::Pointer | |
Private Member Functions | |
| CBDATA_CLASS (CredentialsCache) | |
| void | scheduleCleanup () |
Private Attributes | |
| bool | gcScheduled_ |
| whether a cleanup (garbage collection) event has been scheduled | |
| StoreType | store_ |
| const char *const | cacheCleanupEventName |
Definition at line 21 of file CredentialsCache.h.
|
private |
Definition at line 70 of file CredentialsCache.h.
|
explicit |
Definition at line 56 of file CredentialsCache.cc.
References debugs, and RegisterRunner().
|
default |
|
delete |
|
private |
| void Auth::CredentialsCache::cleanup | ( | ) |
Definition at line 84 of file CredentialsCache.cc.
References Auth::Config::credentialsTtl, current_time, debugs, gcScheduled_, scheduleCleanup(), store_, and Auth::TheConfig.
Referenced by Cleanup(), and doConfigChangeCleanup().
|
static |
periodic cleanup function, removes timed-out entries
Must be static to support EVH interface. Argument will be this
Definition at line 75 of file CredentialsCache.cc.
References cleanup(), and debugs.
Referenced by scheduleCleanup().
| void Auth::CredentialsCache::doConfigChangeCleanup | ( | ) |
Cleanup cache data after a reconfiguration has occurred. Similar to cleanup() but also flushes stale config dependent state from retained entries.
Definition at line 140 of file CredentialsCache.cc.
References aclCacheMatchFlush(), cleanup(), and store_.
| void Auth::CredentialsCache::insert | ( | const SBuf & | userKey, |
| const Auth::User::Pointer & | anAuth_user | ||
| ) |
Definition at line 105 of file CredentialsCache.cc.
References debugs, scheduleCleanup(), and store_.
| Auth::User::Pointer Auth::CredentialsCache::lookup | ( | const SBuf & | userKey | ) | const |
Definition at line 65 of file CredentialsCache.cc.
|
delete |
|
inline |
Definition at line 39 of file CredentialsCache.h.
References store_.
|
private |
Definition at line 130 of file CredentialsCache.cc.
References cacheCleanupEventName, Cleanup(), eventAdd(), gcScheduled_, store_, and Auth::TheConfig.
|
inline |
Definition at line 42 of file CredentialsCache.h.
References store_.
Referenced by sortedUsersList().
| std::vector< Auth::User::Pointer > Auth::CredentialsCache::sortedUsersList | ( | ) | const |
Definition at line 115 of file CredentialsCache.cc.
|
private |
Definition at line 74 of file CredentialsCache.h.
Referenced by scheduleCleanup().
|
private |
Definition at line 67 of file CredentialsCache.h.
Referenced by cleanup(), and scheduleCleanup().
|
private |
Definition at line 71 of file CredentialsCache.h.
Referenced by cleanup(), doConfigChangeCleanup(), insert(), lookup(), reset(), scheduleCleanup(), size(), and sortedUsersList().