public interface BanService
GameProfiles or IP addresses.
Implementors of this service should treat expired bans as non-existent, even if they choose to retain them in a way not accessible through the ban service API (e.g. writing them to a database). In essence, expired bans should be treated the same as user-removed bans.
For example, getBans() would not include any expired bans,
and hasBan(Ban) would return false.
| Modifier and Type | Method and Description |
|---|---|
Optional<? extends Ban> |
addBan(Ban ban)
Adds a ban.
|
Optional<Ban.Profile> |
getBanFor(GameProfile profile)
Gets the ban for the given
GameProfile, if available. |
Optional<Ban.Ip> |
getBanFor(InetAddress address)
Gets the ban for the given address, if available.
|
Collection<? extends Ban> |
getBans()
Gets all bans registered.
|
Collection<Ban.Ip> |
getIpBans()
Gets all IP bans registered.
|
Collection<Ban.Profile> |
getProfileBans()
Gets all
GameProfile bans registered. |
boolean |
hasBan(Ban ban)
Checks if the specified ban is present.
|
boolean |
isBanned(GameProfile profile)
Checks if a
GameProfile has a ban. |
boolean |
isBanned(InetAddress address)
Checks if an IP has a ban.
|
boolean |
pardon(GameProfile profile)
Pardons a profile, or removes its ban, if present.
|
boolean |
pardon(InetAddress address)
Pardons an IP address, or removes its ban, if present.
|
boolean |
removeBan(Ban ban)
Removes a ban.
|
Collection<? extends Ban> getBans()
Collection<Ban.Profile> getProfileBans()
GameProfile bans registered.GameProfile bansCollection<Ban.Ip> getIpBans()
Optional<Ban.Profile> getBanFor(GameProfile profile)
GameProfile, if available.profile - The profileOptional<Ban.Ip> getBanFor(InetAddress address)
address - The address.boolean isBanned(GameProfile profile)
GameProfile has a ban.profile - The profileboolean isBanned(InetAddress address)
address - The addressboolean pardon(GameProfile profile)
profile - The profileboolean pardon(InetAddress address)
address - The IP addressboolean removeBan(Ban ban)
ban - The banOptional<? extends Ban> addBan(Ban ban)
If the GameProfile or IP address of the ban already has a ban set, the passed in ban will replace the existing ban.
ban - The ban to add to this ban serviceboolean hasBan(Ban ban)
ban - The ban