Package com.palmergames.bukkit.towny.db
Class TownySQLSource
java.lang.Object
com.palmergames.bukkit.towny.db.TownyDataSource
com.palmergames.bukkit.towny.db.TownyDatabaseHandler
com.palmergames.bukkit.towny.db.TownySQLSource
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.palmergames.bukkit.towny.db.TownyDatabaseHandler
BACKUP_DATE_FORMAT, queryQueue
Fields inherited from class com.palmergames.bukkit.towny.db.TownyDataSource
plugin, universe
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cleanup()
boolean
Build the SQL string and execute to DELETEvoid
deleteDistrict
(District district) void
deleteHibernatedResident
(UUID uuid) void
deleteJail
(Jail jail) void
deleteNation
(Nation nation) void
deletePlotGroup
(PlotGroup group) void
deleteResident
(Resident resident) void
deleteTown
(Town town) void
deleteTownBlock
(TownBlock townBlock) void
deleteWorld
(TownyWorld world) void
com.zaxxer.hikari.HikariDataSource
boolean
isReady()
boolean
boolean
loadDistrict
(District district) boolean
boolean
boolean
boolean
boolean
boolean
loadNation
(Nation nation) boolean
boolean
boolean
loadPlotGroup
(PlotGroup group) boolean
boolean
boolean
loadResident
(Resident resident) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
loadWorld
(TownyWorld world) boolean
boolean
boolean
queueDeleteDB
(String tb_name, Map<String, ?> args) boolean
boolean
boolean
saveDistrict
(District district) boolean
saveHibernatedResident
(UUID uuid, long registered) boolean
boolean
saveNation
(Nation nation) boolean
savePlotGroup
(PlotGroup group) boolean
saveResident
(Resident resident) boolean
boolean
saveTownBlock
(TownBlock townBlock) boolean
saveWorld
(TownyWorld world) boolean
Build the SQL string and execute to INSERT/UPDATEMethods inherited from class com.palmergames.bukkit.towny.db.TownyDatabaseHandler
backup, deleteFile, deletePlotData, generateReplacementName, getLegacyPlotFilename, hasPlotData, loadPlotData, loadPlotData, loadRegenList, mergeNation, mergeTown, newNation, newNation, newResident, newResident, newWorld, removeDistrict, removeJail, removeNation, removePlotGroup, removeResident, removeTown, removeTownBlock, removeTownBlocks, removeWorld, renameDistrict, renameGroup, renameNation, renamePlayer, renameTown, savePlotData, saveRegenList, serializeMetadata, toUUIDArray, toUUIDList
Methods inherited from class com.palmergames.bukkit.towny.db.TownyDataSource
loadAll, removeNation, removeNation, removeTown, removeTown, removeTown, saveAll, saveAllWorlds, saveDistricts, saveJails, saveNations, savePlotGroups, saveQueues, saveResidents, saveTownBlocks, saveTowns, saveWorlds
-
Constructor Details
-
TownySQLSource
-
-
Method Details
-
finishTasks
public void finishTasks()- Overrides:
finishTasks
in classTownyDatabaseHandler
-
isReady
public boolean isReady()- Returns:
- Whether the datasource is initialized and running.
-
getConnection
- Returns:
- A connection from the pool
- Throws:
SQLException
-
updateDB
Build the SQL string and execute to INSERT/UPDATE- Parameters:
tb_name
- - Database Table name.args
- - Arguments.keys
- - Table keys.- Returns:
- true if the update was successful.
-
queueUpdateDB
-
DeleteDB
Build the SQL string and execute to DELETE- Parameters:
tb_name
- - Database Table nameargs
- - Arguments- Returns:
- true if the delete was a success.
-
queueDeleteDB
-
cleanup
public boolean cleanup()- Overrides:
cleanup
in classTownyDataSource
-
loadTownBlockList
public boolean loadTownBlockList()- Specified by:
loadTownBlockList
in classTownyDataSource
-
loadResidentList
public boolean loadResidentList()- Specified by:
loadResidentList
in classTownyDataSource
-
loadTownList
public boolean loadTownList()- Specified by:
loadTownList
in classTownyDataSource
-
loadNationList
public boolean loadNationList()- Specified by:
loadNationList
in classTownyDataSource
-
loadWorldList
public boolean loadWorldList()- Specified by:
loadWorldList
in classTownyDataSource
-
loadPlotGroupList
public boolean loadPlotGroupList()- Specified by:
loadPlotGroupList
in classTownyDataSource
-
loadDistrictList
public boolean loadDistrictList()- Specified by:
loadDistrictList
in classTownyDataSource
-
loadJailList
public boolean loadJailList()- Specified by:
loadJailList
in classTownyDataSource
-
loadResidents
public boolean loadResidents()- Overrides:
loadResidents
in classTownyDataSource
-
loadResident
- Specified by:
loadResident
in classTownyDataSource
-
loadTowns
public boolean loadTowns()- Overrides:
loadTowns
in classTownyDataSource
-
loadTown
- Specified by:
loadTown
in classTownyDataSource
-
loadNations
public boolean loadNations()- Overrides:
loadNations
in classTownyDataSource
-
loadNation
- Specified by:
loadNation
in classTownyDataSource
-
loadWorlds
public boolean loadWorlds()- Overrides:
loadWorlds
in classTownyDataSource
-
loadWorld
- Specified by:
loadWorld
in classTownyDataSource
-
loadTownBlocks
public boolean loadTownBlocks()- Specified by:
loadTownBlocks
in classTownyDataSource
-
loadPlotGroups
public boolean loadPlotGroups()- Overrides:
loadPlotGroups
in classTownyDataSource
-
loadDistricts
public boolean loadDistricts()- Overrides:
loadDistricts
in classTownyDataSource
-
loadCooldowns
public boolean loadCooldowns()- Specified by:
loadCooldowns
in classTownyDataSource
-
saveCooldowns
public boolean saveCooldowns()- Specified by:
saveCooldowns
in classTownyDataSource
-
loadPlotGroup
- Specified by:
loadPlotGroup
in classTownyDataSource
-
loadDistrict
- Specified by:
loadDistrict
in classTownyDataSource
-
loadJails
public boolean loadJails()- Overrides:
loadJails
in classTownyDataSource
-
loadJail
- Specified by:
loadJail
in classTownyDataSource
-
saveResident
- Specified by:
saveResident
in classTownyDataSource
-
saveHibernatedResident
- Specified by:
saveHibernatedResident
in classTownyDataSource
-
saveTown
- Specified by:
saveTown
in classTownyDataSource
-
savePlotGroup
- Specified by:
savePlotGroup
in classTownyDataSource
-
saveDistrict
- Specified by:
saveDistrict
in classTownyDataSource
-
saveNation
- Specified by:
saveNation
in classTownyDataSource
-
saveWorld
- Specified by:
saveWorld
in classTownyDataSource
-
saveTownBlock
- Specified by:
saveTownBlock
in classTownyDataSource
-
saveJail
- Specified by:
saveJail
in classTownyDataSource
-
deleteResident
- Specified by:
deleteResident
in classTownyDataSource
-
deleteHibernatedResident
- Specified by:
deleteHibernatedResident
in classTownyDataSource
-
deleteTown
- Specified by:
deleteTown
in classTownyDataSource
-
deleteNation
- Specified by:
deleteNation
in classTownyDataSource
-
deleteWorld
- Specified by:
deleteWorld
in classTownyDataSource
-
deleteTownBlock
- Specified by:
deleteTownBlock
in classTownyDataSource
-
deletePlotGroup
- Specified by:
deletePlotGroup
in classTownyDataSource
-
deleteDistrict
- Specified by:
deleteDistrict
in classTownyDataSource
-
deleteJail
- Specified by:
deleteJail
in classTownyDataSource
-
getHibernatedResidentRegistered
- Specified by:
getHibernatedResidentRegistered
in classTownyDataSource
-
getHikariDataSource
public com.zaxxer.hikari.HikariDataSource getHikariDataSource()
-