Class PunishmentLogProvider
java.lang.Object
de.murmelmeister.murmelapi.punishment.log.PunishmentLogProvider
- All Implemented Interfaces:
PunishmentLog
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLogIp(int executorId, int typeId, InetAddress inetAddress, int reasonId) Adds a punishment log associated with an IP address to the system.addLogUser(int executorId, int typeId, int userId, InetAddress inetAddress, int reasonId) Adds a new log entry for a user to the punishment log.voiddeleteUserLogs(int userId) Deletes all logs associated with the specified user.booleanChecks if a log entry exists based on the specified log ID and type ID.getCreatedAt(UUID logId, int typeId) Retrieves the timestamp at which a punishment log was created.intgetCreatedBy(UUID logId, int typeId) Retrieves the ID of the user or entity that created the specified punishment log entry.getExpiredDate(UUID logId, int typeId) Retrieves the expiration date of a punishment log as a string.longgetExpiredTime(UUID logId, int typeId) Retrieves the expiration time for a specific punishment log entry.getIpAddress(UUID logId, int typeId) Retrieves the IP address associated with a specific punishment log.getLogs(int userId, int typeId) Retrieves a list of log identifiers associated with the specified user and punishment type.getLogs(InetAddress inetAddress, int typeId) Retrieves a list of log identifiers associated with a specific IP address and type.getModifiedAt(UUID logId, int typeId) Retrieves the timestamp of when the specified punishment log was last modified.intgetModifiedBy(UUID logId, int typeId) Retrieves the ID of the user who last modified the punishment log entry.intgetReasonId(UUID logId, int typeId) Retrieves the reason ID associated with a specific punishment log entry.intRetrieves the user ID associated with a specific punishment log.booleanDetermines if the punishment log entry associated with the specified log ID and type ID is expired.setExpiredTime(UUID logId, int typeId, int executorId, long duration) Sets the expiration time for a specific punishment log entry.voidsetReasonId(UUID logId, int typeId, int executorId, int reasonId) Updates the reason ID for a specific punishment log entry.static void
-
Constructor Details
-
PunishmentLogProvider
-
-
Method Details
-
setup
-
existsLog
Description copied from interface:PunishmentLogChecks if a log entry exists based on the specified log ID and type ID.- Specified by:
existsLogin interfacePunishmentLog- Parameters:
logId- The unique identifier of the log entrytypeId- The identifier for the type of the log entry- Returns:
- true if a log entry with the given log ID and type ID exists, otherwise false
-
addLogIp
Description copied from interface:PunishmentLogAdds a punishment log associated with an IP address to the system.- Specified by:
addLogIpin interfacePunishmentLog- Parameters:
executorId- The ID of the user responsible for executing the actiontypeId- The type ID of the punishment loginetAddress- The IP address associated with the punishment logreasonId- The reason ID for the punishment- Returns:
- The unique identifier (UUID) of the newly created punishment log
-
addLogUser
public UUID addLogUser(int executorId, int typeId, int userId, InetAddress inetAddress, int reasonId) Description copied from interface:PunishmentLogAdds a new log entry for a user to the punishment log.- Specified by:
addLogUserin interfacePunishmentLog- Parameters:
executorId- The ID of the user performing the actiontypeId- The ID representing the type of log entryuserId- The ID of the target user associated with the loginetAddress- The IP address of the target userreasonId- The ID representing the reason for the log entry- Returns:
- A UUID representing the unique identifier of the newly added log entry
-
deleteUserLogs
public void deleteUserLogs(int userId) Description copied from interface:PunishmentLogDeletes all logs associated with the specified user.- Specified by:
deleteUserLogsin interfacePunishmentLog- Parameters:
userId- The unique identifier of the user whose logs are to be deleted
-
getLogs
Description copied from interface:PunishmentLogRetrieves a list of log identifiers associated with the specified user and punishment type.- Specified by:
getLogsin interfacePunishmentLog- Parameters:
userId- The unique identifier of the user whose logs are to be retrievedtypeId- The type of punishment associated with the logs- Returns:
- A list of UUIDs representing the logs for the specified user and punishment type
-
getLogs
Description copied from interface:PunishmentLogRetrieves a list of log identifiers associated with a specific IP address and type.- Specified by:
getLogsin interfacePunishmentLog- Parameters:
inetAddress- The IP address used to filter the logstypeId- The type identifier used to filter the logs- Returns:
- A list of UUIDs representing the matching logs
-
getUserId
Description copied from interface:PunishmentLogRetrieves the user ID associated with a specific punishment log.- Specified by:
getUserIdin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment logtypeId- The type identifier of the punishment log- Returns:
- The user ID associated with the specified punishment log
-
getIpAddress
Description copied from interface:PunishmentLogRetrieves the IP address associated with a specific punishment log.- Specified by:
getIpAddressin interfacePunishmentLog- Parameters:
logId- The unique identifier of the log entrytypeId- The type identifier of the log entry- Returns:
- The IP address as a string, or null if no IP address is associated with the specified log
-
getReasonId
Description copied from interface:PunishmentLogRetrieves the reason ID associated with a specific punishment log entry.- Specified by:
getReasonIdin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log.typeId- The type identifier of the punishment log.- Returns:
- The ID of the reason linked to the specified punishment log entry.
-
setReasonId
Description copied from interface:PunishmentLogUpdates the reason ID for a specific punishment log entry.- Specified by:
setReasonIdin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log entry to be updated.typeId- The type identifier of the punishment log entry.executorId- The identifier of the user making the update.reasonId- The new reason identifier to set for the log entry.
-
getExpiredTime
Description copied from interface:PunishmentLogRetrieves the expiration time for a specific punishment log entry.- Specified by:
getExpiredTimein interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log entrytypeId- The type ID of the punishment log- Returns:
- The expiration time of the punishment log in milliseconds since epoch
-
getExpiredDate
Description copied from interface:PunishmentLogRetrieves the expiration date of a punishment log as a string.- Specified by:
getExpiredDatein interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment logtypeId- The type identifier associated with the punishment log- Returns:
- The expiration date of the specified punishment log in string format
-
setExpiredTime
Description copied from interface:PunishmentLogSets the expiration time for a specific punishment log entry.- Specified by:
setExpiredTimein interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log entry.typeId- The type identifier of the punishment log entry.executorId- The identifier of the user making this change.duration- The duration in milliseconds that determines the new expiration time.- Returns:
- A string representation of the updated expiration date and time.
-
isExpired
Description copied from interface:PunishmentLogDetermines if the punishment log entry associated with the specified log ID and type ID is expired.- Specified by:
isExpiredin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log entry.typeId- The type identifier of the punishment log entry.- Returns:
- true if the punishment log entry is expired, otherwise false.
-
getCreatedBy
Description copied from interface:PunishmentLogRetrieves the ID of the user or entity that created the specified punishment log entry.- Specified by:
getCreatedByin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log entrytypeId- The type identifier of the punishment log entry- Returns:
- The ID of the creator of the punishment log entry
-
getCreatedAt
Description copied from interface:PunishmentLogRetrieves the timestamp at which a punishment log was created.- Specified by:
getCreatedAtin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment logtypeId- The type identifier of the punishment log- Returns:
- The creation timestamp of the specified punishment log
-
getModifiedBy
Description copied from interface:PunishmentLogRetrieves the ID of the user who last modified the punishment log entry.- Specified by:
getModifiedByin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log entrytypeId- The type identifier for the log entry- Returns:
- The ID of the user who last modified the log entry
-
getModifiedAt
Description copied from interface:PunishmentLogRetrieves the timestamp of when the specified punishment log was last modified.- Specified by:
getModifiedAtin interfacePunishmentLog- Parameters:
logId- The unique identifier of the punishment log.typeId- The type identifier of the punishment log.- Returns:
- The timestamp representing the last modification date and time of the specified log.
-