public class FileActiveBanStorage extends Object implements ActiveBanStorage
Constructor and Description |
---|
FileActiveBanStorage(Path banDir) |
Modifier and Type | Method and Description |
---|---|
List<Ban> |
getAll()
Get all active bans
|
@Nullable Ban |
load(UUID playerId)
Loads the active ban of the player identified by the given UUID.
|
List<Ban> |
loadBanOnIP(String ip)
Get all active ban on given IP
|
void |
remove(UUID playerId)
Removes the ban associated to the player identified by the given UUID.
|
void |
save(Ban ban)
Saves the given active ban.
|
public FileActiveBanStorage(Path banDir)
public @Nullable Ban load(UUID playerId)
ActiveBanStorage
load
in interface ActiveBanStorage
playerId
- the UUID of a player.null
if the player is not bannedpublic List<Ban> loadBanOnIP(String ip)
ActiveBanStorage
loadBanOnIP
in interface ActiveBanStorage
ip
- which we are looking for banspublic void save(Ban ban)
ActiveBanStorage
save
in interface ActiveBanStorage
ban
- the active ban to save.public void remove(UUID playerId)
ActiveBanStorage
remove
in interface ActiveBanStorage
playerId
- the UUID of the playerpublic List<Ban> getAll()
ActiveBanStorage
getAll
in interface ActiveBanStorage