Class PunishmentCurrentIpCache
java.lang.Object
de.murmelmeister.murmelapi.punishment.ip.PunishmentCurrentIpCache
- All Implemented Interfaces:
RefreshListener,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final com.github.benmanes.caffeine.cache.LoadingCache<PunishmentCurrentIpCache.IpTypeKey, PunishmentCurrentIp> private final de.murmelmeister.library.database.Databaseprivate final Longprivate static final Patternprivate final com.github.benmanes.caffeine.cache.LoadingCache<String, List<PunishmentCurrentIp>> private final String -
Constructor Summary
ConstructorsConstructorDescriptionPunishmentCurrentIpCache(de.murmelmeister.library.database.Database database, String tableName, Long fetchLimit, long cacheCapcity, Duration refreshInterval) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclose()private List<PunishmentCurrentIp> private PunishmentCurrentIpvoidonRefresh(RefreshEvent<?> event) voidput(PunishmentCurrentIp punish) private voidprivate voidvoid
-
Field Details
-
ALL_KEY
- See Also:
-
KEY_PATTERN
-
database
private final de.murmelmeister.library.database.Database database -
tableName
-
cache
private final com.github.benmanes.caffeine.cache.LoadingCache<PunishmentCurrentIpCache.IpTypeKey,PunishmentCurrentIp> cache -
listCache
private final com.github.benmanes.caffeine.cache.LoadingCache<String,List<PunishmentCurrentIp>> listCache -
fetchLimit
-
-
Constructor Details
-
PunishmentCurrentIpCache
-
-
Method Details
-
onRefresh
- Specified by:
onRefreshin interfaceRefreshListener
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
refreshAll
private void refreshAll() -
refreshSingle
-
loadAllFromDatabase
-
loadFromDatabase
-
get
-
put
-
remove
-
clear
public void clear() -
getCachedPunishIPs
-