public class BanCache
extends java.lang.Object
| Constructor and Description |
|---|
BanCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBannedIP(java.lang.String address,
java.lang.String message,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID)
Adds a banned IP to the cache
|
boolean |
addBannedUUID(java.lang.String uuid,
java.lang.String message,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID)
Adds a banned UUID to the cache.
|
boolean |
addBannedUUID(java.util.UUID uuid,
java.lang.String message,
java.lang.Enum<DatabaseManager.BannerType> type,
java.util.UUID bannerUUID)
Adds a banned UUID to the cache.
|
void |
addFriendlyDate(java.lang.String s,
java.lang.String unparsedDate)
Used to add the pure form of the date to the ban cache for the purpose of storing it in the database.
|
void |
addTempBannedUUID(java.lang.String uuid,
java.lang.String message,
java.util.Date unbanDate,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID,
java.lang.String unparsedDate)
Adds a player to the tempbanned list
|
void |
addTempBannedUUID(java.util.UUID uuid,
java.lang.String message,
java.util.Date unbanDate,
java.lang.Enum<DatabaseManager.BannerType> type,
java.util.UUID bannerUUID,
java.lang.String unparsedDate)
Adds a player to the tempbanned list
|
java.lang.String |
getBanMessage(java.lang.String uuid)
Used to get the particular ban message from a UUID
|
java.lang.String |
getBanMessage(java.util.UUID uuid)
Used to get the particular ban message from a UUID
|
java.util.Set<java.lang.String> |
getBannedPlayers()
Used to fetch a bulk list of all banned players
|
java.lang.String |
getBanner(java.lang.String uuid)
Gets the banner of supplied UUID.
|
java.lang.String |
getBannerIP(java.lang.String address)
Gets the banner of supplied IP.
|
java.lang.Enum<DatabaseManager.BannerType> |
getBannerType(java.lang.String uuid)
Used to find out what entity banned the player in question
|
java.lang.Enum<DatabaseManager.BannerType> |
getBannerTypeIP(java.lang.String address)
Used to get the entity that banned the address in question
|
java.lang.String |
getFriendlyDate(java.lang.String s)
Used to fetch the pure form of the stored date.
|
java.lang.String |
getIPBanMessage(java.lang.String address)
Used to get the particular IP ban message from a UUID
|
java.util.Set<java.lang.String> |
getIPBans()
Returns a list of all the banned IPs
|
java.util.Date |
getIPTempBanEndDate(java.lang.String address)
Used to get the date the tempban should be lifted
|
java.util.Date |
getTempBanEndDate(java.lang.String uuid)
Used to get the date the tempban should be lifted
|
java.util.Date |
getTempBanEndDate(java.util.UUID uuid)
Used to get the date the tempban should be lifted
|
boolean |
isIPBanned(java.lang.String address)
Used to determine if an IP is already banned
|
boolean |
isIPTempBanned(java.lang.String address)
Returns if an IP is temp banned
|
boolean |
isTempBanned(java.lang.String uuid)
Used to check if a player is tempbanned
|
boolean |
isTempBanned(java.util.UUID uuid)
Used to check if a player is tempbanned
|
boolean |
isUUIDBanned(java.lang.String uuid)
Used to check if a particular UUID is banned
|
boolean |
isUUIDBanned(java.util.UUID uuid)
Used to check if a particular UUID is banned
|
boolean |
removeBan(java.lang.String uuid)
Used to delete both normal bans and temp bans
|
boolean |
removeBan(java.util.UUID uuid)
Used to delete both normal bans and temp bans
|
void |
tempBanIP(java.lang.String address,
java.lang.String message,
java.util.Date unbanDate,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID,
java.lang.String unparsedDate)
Used to temp ban and IP address
|
boolean |
unbanIP(java.lang.String address)
Used to unban an IP
|
public boolean addBannedUUID(java.lang.String uuid,
java.lang.String message,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID)
uuid - The uuid to ban (in string form)message - The message to set with the ban (set to null if default should be used)type - The banner type (ie console player etc)public boolean addBannedUUID(java.util.UUID uuid,
java.lang.String message,
java.lang.Enum<DatabaseManager.BannerType> type,
java.util.UUID bannerUUID)
uuid - The uuid to banmessage - The message to set with the ban (set to null if default should be used)public boolean isUUIDBanned(java.lang.String uuid)
uuid - The UUID to check if banned (in string form)public boolean isUUIDBanned(java.util.UUID uuid)
uuid - The UUID to check if bannedpublic java.lang.String getBanMessage(java.lang.String uuid)
uuid - The UUID of the player to get the ban message for (in String form)public java.lang.String getBanMessage(java.util.UUID uuid)
uuid - The UUID of the player to get the ban message forpublic boolean isTempBanned(java.lang.String uuid)
uuid - The uuid of the player to check (in String form)public boolean isTempBanned(java.util.UUID uuid)
uuid - The uuid of the player to check (in String form)public java.util.Date getTempBanEndDate(java.lang.String uuid)
uuid - The uuid of the player to get the tempban datepublic java.util.Date getTempBanEndDate(java.util.UUID uuid)
uuid - The uuid of the player to get the tempban datepublic void addTempBannedUUID(java.lang.String uuid,
java.lang.String message,
java.util.Date unbanDate,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID,
java.lang.String unparsedDate)
uuid - The uuid to ban (in string form)message - The message to tie with it (set to null to use default)unbanDate - The date to unban the player atpublic void addTempBannedUUID(java.util.UUID uuid,
java.lang.String message,
java.util.Date unbanDate,
java.lang.Enum<DatabaseManager.BannerType> type,
java.util.UUID bannerUUID,
java.lang.String unparsedDate)
uuid - The uuid to banmessage - The message to tie with it (set to null to use default)unbanDate - The date to unban the player atpublic boolean removeBan(java.lang.String uuid)
uuid - The uuid to unban (In string form)public boolean removeBan(java.util.UUID uuid)
uuid - The uuid to unban (In string form)public java.util.Set<java.lang.String> getBannedPlayers()
public void addBannedIP(java.lang.String address,
java.lang.String message,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID)
address - The IP address to be bannedmessage - The message to be tied with the ban (optional)public boolean isIPBanned(java.lang.String address)
address - The address to check forpublic boolean isIPTempBanned(java.lang.String address)
address - The ip in questionpublic void tempBanIP(java.lang.String address,
java.lang.String message,
java.util.Date unbanDate,
java.lang.Enum<DatabaseManager.BannerType> type,
java.lang.String bannerUUID,
java.lang.String unparsedDate)
address - The address to temp banmessage - The message to go with the ban (optional)unbanDate - The unban date of the playerpublic boolean unbanIP(java.lang.String address)
address - The IP to unbanpublic java.lang.String getIPBanMessage(java.lang.String address)
uuid - The UUID of the player to get the ban message for (in String form)public java.util.Date getIPTempBanEndDate(java.lang.String address)
uuid - The uuid of the player to get the tempban datepublic java.util.Set<java.lang.String> getIPBans()
public java.lang.Enum<DatabaseManager.BannerType> getBannerType(java.lang.String uuid)
uuid - The uuid of the player to check forpublic java.lang.Enum<DatabaseManager.BannerType> getBannerTypeIP(java.lang.String address)
address - The address of the player to check forpublic java.lang.String getBanner(java.lang.String uuid)
uuid - The uuid of banned playerpublic java.lang.String getBannerIP(java.lang.String address)
address - The banned addresspublic void addFriendlyDate(java.lang.String s,
java.lang.String unparsedDate)
s - A UUID or ip address.. just make sure you remember which one you put it under!unparsedDate - public java.lang.String getFriendlyDate(java.lang.String s)
s - Either the UUID or ip address you used to store this dtate