Class PunishmentIPProvider
java.lang.Object
de.murmelmeister.murmelapi.punishment.PunishmentIPProvider
- All Implemented Interfaces:
PunishmentIP
-
Constructor Summary
ConstructorsConstructorDescriptionPunishmentIPProvider(Database database, PunishmentReason reason, PunishmentLog log) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists(InetAddress inetAddress, int typeId) Checks if a punishment record exists for the given type ID and IP address.getCreatedAt(InetAddress inetAddress, int typeId) Retrieves the timestamp indicating when the specified punishment record was created.intgetCreatedBy(InetAddress inetAddress, int typeId) Retrieves the identifier of the user who created a punishment for the specified type and IP address.longgetDuration(InetAddress inetAddress, int typeId) Retrieves the duration associated with a specific type and IP address.getExpiredDate(InetAddress inetAddress, int typeId) Retrieves the expiration date as a string for a specific punishment type and IP address.longgetExpiredTime(InetAddress inetAddress, int typeId) Retrieves the expiration time of the punishment for the specified type and IP address.getIps(int typeId) Retrieves a list of IP addresses associated with the specified type.getLogId(InetAddress inetAddress, int typeId) Retrieves the log identifier associated with the specified type ID and IP address.getModifiedAt(InetAddress inetAddress, int typeId) Retrieves the timestamp when the specified punishment was last modified.intgetModifiedBy(InetAddress inetAddress, int typeId) Retrieves the ID of the entity or executor that last modified the punishment record based on the provided punishment type ID and IP address.getReason(InetAddress inetAddress, int typeId) Retrieves the reason associated with a specific punishment type and IP address.intgetReasonId(InetAddress inetAddress, int typeId) Retrieves the reason identifier associated with a specific type and IP address.booleanisPunished(InetAddress inetAddress, int typeId) Checks if a specific IP address is currently punished for a given type.voidpunish(InetAddress inetAddress, int typeId, int executorId, int reasonId) Applies a punishment for a given IP address with specific type and reason.voidsetExpiredTime(InetAddress inetAddress, int typeId, int executorId, long time) Sets the expiration time for a specific punishment on an IP address.voidsetReasonId(InetAddress inetAddress, int typeId, int executorId, int reasonId) Updates the reason ID for an existing punishment associated with the specified type, IP address, and executor.static voidvoidunpunished(InetAddress inetAddress, int typeId) Removes the punishment associated with the given type and IP address.
-
Constructor Details
-
PunishmentIPProvider
-
-
Method Details
-
setup
-
exists
Description copied from interface:PunishmentIPChecks if a punishment record exists for the given type ID and IP address.- Specified by:
existsin interfacePunishmentIP- Parameters:
inetAddress- The IP address to check for existence of a punishmenttypeId- The ID representing the type of punishment- Returns:
trueif a punishment record exists for the specified type ID and IP address,falseotherwise
-
punish
Description copied from interface:PunishmentIPApplies a punishment for a given IP address with specific type and reason.- Specified by:
punishin interfacePunishmentIP- Parameters:
inetAddress- The IP address to which the punishment will be appliedtypeId- The type identifier of the punishmentexecutorId- The identifier of the executor applying the punishmentreasonId- The identifier of the reason for the punishment
-
unpunished
Description copied from interface:PunishmentIPRemoves the punishment associated with the given type and IP address.- Specified by:
unpunishedin interfacePunishmentIP- Parameters:
inetAddress- The IP address for which the punishment is removedtypeId- The identifier of the punishment type to remove
-
getIps
Description copied from interface:PunishmentIPRetrieves a list of IP addresses associated with the specified type.- Specified by:
getIpsin interfacePunishmentIP- Parameters:
typeId- The identifier for the type of punishment or record for which the IPs are to be retrieved- Returns:
- A list of IP addresses corresponding to the specified type
-
getLogId
Description copied from interface:PunishmentIPRetrieves the log identifier associated with the specified type ID and IP address.- Specified by:
getLogIdin interfacePunishmentIP- Parameters:
inetAddress- The IP address for which the log ID is being queriedtypeId- An integer representing the type identifier for the punishment or operation- Returns:
- A UUID representing the log identifier, or null if no log is associated with the given parameters
-
getReasonId
Description copied from interface:PunishmentIPRetrieves the reason identifier associated with a specific type and IP address.- Specified by:
getReasonIdin interfacePunishmentIP- Parameters:
inetAddress- The IP address for which the reason identifier is being requested.typeId- The identifier representing the punishment type.- Returns:
- The reason identifier associated with the specified type and IP address.
-
setReasonId
Description copied from interface:PunishmentIPUpdates the reason ID for an existing punishment associated with the specified type, IP address, and executor.- Specified by:
setReasonIdin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishmenttypeId- The type identifier for the punishmentexecutorId- The identifier of the executor making the changereasonId- The new reason identifier to be set
-
getReason
Description copied from interface:PunishmentIPRetrieves the reason associated with a specific punishment type and IP address.- Specified by:
getReasonin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishmenttypeId- The identifier for the punishment type- Returns:
- The reason for the punishment as a String
-
getDuration
Description copied from interface:PunishmentIPRetrieves the duration associated with a specific type and IP address.- Specified by:
getDurationin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the entitytypeId- The identifier of the type for which the duration is being retrieved- Returns:
- The duration in milliseconds
-
getExpiredTime
Description copied from interface:PunishmentIPRetrieves the expiration time of the punishment for the specified type and IP address.- Specified by:
getExpiredTimein interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishmenttypeId- The identification number of the punishment type- Returns:
- The expiration time of the punishment in milliseconds since epoch
-
getExpiredDate
Description copied from interface:PunishmentIPRetrieves the expiration date as a string for a specific punishment type and IP address.- Specified by:
getExpiredDatein interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishmenttypeId- The identifier of the punishment type- Returns:
- The expiration date as a string, or null if no expiration date is set
-
setExpiredTime
Description copied from interface:PunishmentIPSets the expiration time for a specific punishment on an IP address.- Specified by:
setExpiredTimein interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishment.typeId- The type identifier of the punishment.executorId- The ID of the executor making this change.time- The new expiration time for the punishment in milliseconds since epoch.
-
isPunished
Description copied from interface:PunishmentIPChecks if a specific IP address is currently punished for a given type.- Specified by:
isPunishedin interfacePunishmentIP- Parameters:
inetAddress- The IP address to checktypeId- The unique identifier of the type of punishment- Returns:
- true if the IP address is punished for the specified type, false otherwise
-
getCreatedBy
Description copied from interface:PunishmentIPRetrieves the identifier of the user who created a punishment for the specified type and IP address.- Specified by:
getCreatedByin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishmenttypeId- The type identifier associated with the punishment- Returns:
- The identifier of the creator of the punishment
-
getCreatedAt
Description copied from interface:PunishmentIPRetrieves the timestamp indicating when the specified punishment record was created.- Specified by:
getCreatedAtin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishment recordtypeId- The unique identifier of the punishment type- Returns:
- The timestamp of the creation time for the punishment record
-
getModifiedBy
Description copied from interface:PunishmentIPRetrieves the ID of the entity or executor that last modified the punishment record based on the provided punishment type ID and IP address.- Specified by:
getModifiedByin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishment.typeId- The type identifier of the punishment.- Returns:
- The identifier of the entity or executor who last modified the punishment record.
-
getModifiedAt
Description copied from interface:PunishmentIPRetrieves the timestamp when the specified punishment was last modified.- Specified by:
getModifiedAtin interfacePunishmentIP- Parameters:
inetAddress- The IP address associated with the punishmenttypeId- The identifier of the punishment type- Returns:
- The timestamp indicating the last modification time of the punishment
-