Class PunishmentLogCache
java.lang.Object
de.murmelmeister.murmelapi.punishment.audit.PunishmentLogCache
- All Implemented Interfaces:
RefreshListener,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final com.github.benmanes.caffeine.cache.LoadingCache<UUID, PunishmentLog> private final com.github.benmanes.caffeine.cache.LoadingCache<String, List<PunishmentLog>> private final com.github.benmanes.caffeine.cache.LoadingCache<Integer, List<PunishmentLog>> private final de.murmelmeister.library.database.Databaseprivate final Longprivate final com.github.benmanes.caffeine.cache.LoadingCache<String, List<PunishmentLog>> private final String -
Constructor Summary
ConstructorsConstructorDescriptionPunishmentLogCache(de.murmelmeister.library.database.Database database, String tableName, Long fetchLimit, long cacheCapcity, Duration refreshInterval) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclose()getByUser(int userId) private List<PunishmentLog> private PunishmentLogprivate List<PunishmentLog> loadByIpAddress(String ipAddress) private List<PunishmentLog> loadByUserId(int userId) voidonRefresh(RefreshEvent<?> event) voidput(PunishmentLog log) private voidprivate voidrefreshSingle(UUID logId) void
-
Field Details
-
ALL_KEY
- See Also:
-
database
private final de.murmelmeister.library.database.Database database -
tableName
-
cacheById
-
cacheByUser
private final com.github.benmanes.caffeine.cache.LoadingCache<Integer,List<PunishmentLog>> cacheByUser -
cacheByIp
-
listCache
-
fetchLimit
-
-
Constructor Details
-
PunishmentLogCache
-
-
Method Details
-
onRefresh
- Specified by:
onRefreshin interfaceRefreshListener
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
refreshAll
private void refreshAll() -
refreshSingle
-
loadAllFromDatabase
-
loadByUserId
-
loadByIpAddress
-
loadById
-
getById
-
getByUser
-
getByIp
-
put
-
remove
-
clear
public void clear() -
getCachedPunishLogs
-