Class PunishmentLogProviderImpl
java.lang.Object
de.murmelmeister.murmelapi.punishment.audit.PunishmentLogProviderImpl
- All Implemented Interfaces:
PunishmentLogProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RefreshTypeprivate final PunishmentLogCacheprivate final de.murmelmeister.library.database.Databaseprivate final RefreshTypeprivate static final String -
Constructor Summary
ConstructorsConstructorDescriptionPunishmentLogProviderImpl(de.murmelmeister.library.database.Database database, Long fetchLimit, long cacheCapacity, Duration refreshInterval) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(Integer userId, String ipAddress, PunishmentReason reason, int createdBy) getLogs()getLogsByIpAddress(String ipAddress) getLogsByUserId(int userId) private PunishmentLoginsertAndLoadLog(PunishmentLog.Action action, Integer userId, String ipAddress, PunishmentReason reason, int createdBy) modify(Integer userId, String ipAddress, PunishmentReason reason, int createdBy) voidrevoke(Integer userId, String ipAddress, PunishmentLog log, int createdBy) static voidsetup(de.murmelmeister.library.database.Database database)
-
Field Details
-
TABLE_NAME
- See Also:
-
database
private final de.murmelmeister.library.database.Database database -
cache
-
all
-
single
-
-
Constructor Details
-
PunishmentLogProviderImpl
-
-
Method Details
-
setup
public static void setup(de.murmelmeister.library.database.Database database) -
closeCache
public void closeCache()- Specified by:
closeCachein interfacePunishmentLogProvider
-
refreshCache
public void refreshCache()- Specified by:
refreshCachein interfacePunishmentLogProvider
-
getLog
- Specified by:
getLogin interfacePunishmentLogProvider
-
getLogsByUserId
- Specified by:
getLogsByUserIdin interfacePunishmentLogProvider
-
getLogsByIpAddress
- Specified by:
getLogsByIpAddressin interfacePunishmentLogProvider
-
getLogs
- Specified by:
getLogsin interfacePunishmentLogProvider
-
insertAndLoadLog
private PunishmentLog insertAndLoadLog(PunishmentLog.Action action, Integer userId, String ipAddress, PunishmentReason reason, int createdBy) -
create
public PunishmentLog create(Integer userId, String ipAddress, PunishmentReason reason, int createdBy) - Specified by:
createin interfacePunishmentLogProvider
-
modify
public PunishmentLog modify(Integer userId, String ipAddress, PunishmentReason reason, int createdBy) - Specified by:
modifyin interfacePunishmentLogProvider
-
revoke
- Specified by:
revokein interfacePunishmentLogProvider
-