Interface PunishmentIP
- All Known Implementing Classes:
PunishmentIPProvider
Represents an IP address that has been punished or is subject to a punishment.
-
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.voidunpunished(InetAddress inetAddress, int typeId) Removes the punishment associated with the given type and IP address.
-
Method Details
-
exists
Checks if a punishment record exists for the given type ID and IP address.- 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
Applies a punishment for a given IP address with specific type and reason.- 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
Removes the punishment associated with the given type and IP address.- Parameters:
inetAddress- The IP address for which the punishment is removedtypeId- The identifier of the punishment type to remove
-
getIps
Retrieves a list of IP addresses associated with the specified type.- 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
Retrieves the log identifier associated with the specified type ID and IP address.- 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
Retrieves the reason identifier associated with a specific type and IP address.- 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
Updates the reason ID for an existing punishment associated with the specified type, IP address, and executor.- 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
Retrieves the reason associated with a specific punishment type and IP address.- 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
Retrieves the duration associated with a specific type and IP address.- 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
Retrieves the expiration time of the punishment for the specified type and IP address.- 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
Retrieves the expiration date as a string for a specific punishment type and IP address.- 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
Sets the expiration time for a specific punishment on an IP address.- 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
Checks if a specific IP address is currently punished for a given type.- 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
Retrieves the identifier of the user who created a punishment for the specified type and IP address.- 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
Retrieves the timestamp indicating when the specified punishment record was created.- 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
Retrieves the ID of the entity or executor that last modified the punishment record based on the provided punishment type ID and IP address.- 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
Retrieves the timestamp when the specified punishment was last modified.- 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
-