summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java
diff options
context:
space:
mode:
authormd_5 <md_5@bigpond.com>2012-06-27 20:23:06 +1000
committermd_5 <md_5@bigpond.com>2012-06-27 20:23:06 +1000
commit4561a7f0106adb7bd62e2d42114cb80a3a30b570 (patch)
treee7e57e5ab8832bb1fbd0fafeacc9bcd9ee1fc48c /EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java
parent7bef2d3817634a4c396e61930460126dde3606ba (diff)
downloadEssentials-4561a7f0106adb7bd62e2d42114cb80a3a30b570.tar
Essentials-4561a7f0106adb7bd62e2d42114cb80a3a30b570.tar.gz
Essentials-4561a7f0106adb7bd62e2d42114cb80a3a30b570.tar.lz
Essentials-4561a7f0106adb7bd62e2d42114cb80a3a30b570.tar.xz
Essentials-4561a7f0106adb7bd62e2d42114cb80a3a30b570.zip
Fairly expansive cleanup of ess protect.
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java
index e24a71b80..53d5de945 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java
@@ -34,12 +34,12 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
protected abstract PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException;
- public ProtectedBlockJDBC(String driver, String url) throws PropertyVetoException
+ public ProtectedBlockJDBC(final String driver, final String url) throws PropertyVetoException
{
this(driver, url, null, null);
}
- public ProtectedBlockJDBC(String driver, String url, String username, String password) throws PropertyVetoException
+ public ProtectedBlockJDBC(final String driver, final String url, final String username, final String password) throws PropertyVetoException
{
cpds = new ComboPooledDataSource();
cpds.setDriverClass(driver);
@@ -97,6 +97,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
+ @Override
public void clearProtections()
{
Connection conn = null;
@@ -138,7 +139,8 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
- public void importProtections(List<OwnedBlock> blocks)
+ @Override
+ public void importProtections(final List<OwnedBlock> blocks)
{
for (OwnedBlock ownedBlock : blocks)
{
@@ -150,6 +152,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
+ @Override
public List<OwnedBlock> exportProtections()
{
Connection conn = null;
@@ -216,12 +219,13 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
- public void protectBlock(Block block, String playerName)
+ @Override
+ public void protectBlock(final Block block, final String playerName)
{
protectBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), playerName);
}
- private void protectBlock(String world, int x, int y, int z, String playerName)
+ private void protectBlock(final String world, final int x, final int y, final int z, final String playerName)
{
Connection conn = null;
PreparedStatement ps = null;
@@ -262,7 +266,8 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
- public boolean isProtected(Block block, String playerName)
+ @Override
+ public boolean isProtected(final Block block, final String playerName)
{
Connection conn = null;
PreparedStatement ps = null;
@@ -317,7 +322,8 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
- public List<String> getOwners(Block block)
+ @Override
+ public List<String> getOwners(final Block block)
{
Connection conn = null;
PreparedStatement ps = null;
@@ -377,7 +383,8 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
- public int unprotectBlock(Block block)
+ @Override
+ public int unprotectBlock(final Block block)
{
Connection conn = null;
PreparedStatement ps = null;
@@ -419,6 +426,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock
}
}
+ @Override
public void onPluginDeactivation()
{
cpds.close();