Package com.plotsquared.core.database
Class DBFunc
java.lang.Object
com.plotsquared.core.database.DBFunc
Database Functions
- These functions do not update the local plot objects and only make changes to the DB
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPersistentMeta(UUID uuid, String key, byte[] meta, boolean delete)
static void
clearInbox(Plot plot, String inbox)
static void
close()
static void
createCluster(PlotCluster cluster)
static void
createPlotAndSettings(Plot plot, Runnable whenDone)
Create a plot.static void
createPlotSafe(Plot plot, Runnable success, Runnable failure)
static void
createPlotsAndData(List<Plot> plots, Runnable whenDone)
Create all settings + (trusted, denied, members)static void
createPlotSettings(int id, Plot plot)
Create plot settings.static void
Create tables.static void
Delete a plot.static void
delete(PlotCluster toDelete)
static void
deleteComments(Plot plot)
Delete the comments in a plot.static void
deleteDenied(Plot plot)
Delete the denied list for a plot.static void
deleteMembers(Plot plot)
Delete the members list for a plot.static void
deleteRatings(Plot plot)
Delete the ratings for a plot.static void
deleteSettings(Plot plot)
Deleting settings will 1) Delete any settings (flags and such) associated with the plot 2) Prevent any local changes to the plot from saving properly to the dbstatic boolean
static void
deleteTrusted(Plot plot)
Delete the trusted list for a plot.static HashMap<String,Set<PlotCluster>>
static void
getComments(Plot plot, String inbox, RunnableVal<List<PlotComment>> whenDone)
static int
Get a plot id.static void
getPersistentMeta(UUID uuid, RunnableVal<Map<String,byte[]>> result)
getPlots()
getRatings(Plot plot)
static boolean
Deprecated.static void
static void
static void
static void
removeComment(Plot plot, PlotComment comment)
static void
removeDenied(Plot plot, UUID uuid)
static void
removeFlag(Plot plot, PlotFlag<?,?> flag)
static void
removeHelper(PlotCluster cluster, UUID uuid)
static void
removeInvited(PlotCluster cluster, UUID uuid)
static void
removeMember(Plot plot, UUID uuid)
static void
removePersistentMeta(UUID uuid, String key)
static void
removeTrusted(Plot plot, UUID uuid)
static void
replaceUUID(UUID old, UUID now)
Replace all occurrences of a uuid in the database with another onestatic void
replaceWorld(String oldWorld, String newWorld, PlotId min, PlotId max)
static void
resizeCluster(PlotCluster current, PlotId min, PlotId max)
static void
static void
setComment(Plot plot, PlotComment comment)
static void
static void
static void
setHelper(PlotCluster cluster, UUID uuid)
static void
setInvited(PlotCluster cluster, UUID uuid)
static void
static void
static void
Set the owner of a plotstatic void
setPosition(PlotCluster cluster, String position)
static void
setPosition(Plot plot, String position)
static void
static void
setTrusted(Plot plot, UUID uuid)
static CompletableFuture<Boolean>
static void
updateTables(int[] oldVersion)
static void
validatePlots(Set<Plot> plots)
-
Field Details
-
EVERYONE
The "global" uuid. -
SERVER
-
dbManager
Abstract Database Manager
-
-
Constructor Details
-
DBFunc
public DBFunc()
-
-
Method Details
-
updateTables
public static void updateTables(int[] oldVersion) -
addPersistentMeta
-
getPersistentMeta
-
removePersistentMeta
-
swapPlots
-
deleteTables
public static boolean deleteTables() -
movePlot
-
validatePlots
-
hasColumn
Deprecated.Check if aResultSet
contains a column.- Parameters:
resultSet
-name
-- Returns:
-
setOwner
Set the owner of a plot- Parameters:
plot
- Plot Objectuuid
- New Owner
-
createPlotsAndData
Create all settings + (trusted, denied, members)- Parameters:
plots
- List containing all plot objects
-
createPlotSafe
-
createPlotAndSettings
Create a plot.- Parameters:
plot
- Plot to create
-
createTables
Create tables.- Throws:
Exception
-
delete
Delete a plot.- Parameters:
plot
- Plot to delete
-
deleteRatings
Delete the ratings for a plot.- Parameters:
plot
-
-
deleteTrusted
Delete the trusted list for a plot.- Parameters:
plot
-
-
deleteMembers
Delete the members list for a plot.- Parameters:
plot
-
-
deleteDenied
Delete the denied list for a plot.- Parameters:
plot
-
-
deleteComments
Delete the comments in a plot.- Parameters:
plot
-
-
deleteSettings
Deleting settings will 1) Delete any settings (flags and such) associated with the plot 2) Prevent any local changes to the plot from saving properly to the dbThis shouldn't ever be needed
- Parameters:
plot
-
-
delete
-
createPlotSettings
Create plot settings.- Parameters:
id
- Plot IDplot
- Plot Object
-
getId
Get a plot id.- Parameters:
plot
- Plot Object- Returns:
- ID
-
getPlots
- Returns:
- Plots
-
setMerged
-
setFlag
-
removeFlag
-
setAlias
- Parameters:
plot
-alias
-
-
purgeIds
-
purge
-
setPosition
- Parameters:
plot
-position
-
-
removeComment
- Parameters:
plot
-comment
-
-
clearInbox
-
setComment
- Parameters:
plot
-comment
-
-
getComments
- Parameters:
plot
-
-
removeTrusted
- Parameters:
plot
-uuid
-
-
removeHelper
- Parameters:
cluster
-uuid
-
-
createCluster
- Parameters:
cluster
-
-
resizeCluster
- Parameters:
current
-min
-max
-
-
removeMember
- Parameters:
plot
-uuid
-
-
removeInvited
- Parameters:
cluster
-uuid
-
-
setTrusted
- Parameters:
plot
-uuid
-
-
setHelper
-
setMember
- Parameters:
plot
-uuid
-
-
setInvited
-
removeDenied
- Parameters:
plot
-uuid
-
-
setDenied
- Parameters:
plot
-uuid
-
-
getRatings
-
setRating
-
getClusters
-
setPosition
-
replaceWorld
-
replaceUUID
Replace all occurrences of a uuid in the database with another one- Parameters:
old
-now
-
-
close
public static void close()
-