public class DBHelper
extends java.lang.Object
Constructor and Description |
---|
DBHelper() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes database connection.
|
void |
deleteUserData(java.lang.String uuid)
Deletes data for the provided uuid.
|
java.lang.String |
getUserData(java.lang.String uuid)
Gets the hashed password from DB.
|
boolean |
isClosed()
Tells whether DB connection is closed.
|
boolean |
isUserRegistered(java.lang.String uuid)
Checks if player is registered.
|
void |
openConnection()
Connects to the DB.
|
boolean |
registerUser(java.lang.String uuid,
java.lang.String data)
Inserts the data for the player.
|
void |
saveAll(java.util.HashMap<java.lang.String,PlayerCache> playerCacheMap) |
void |
updateUserData(java.lang.String uuid,
java.lang.String data)
Updates player's data.
|
public void openConnection()
public void close()
public boolean isClosed()
public boolean registerUser(java.lang.String uuid, java.lang.String data)
uuid
- uuid of the player to insert data fordata
- data to put inside databasepublic boolean isUserRegistered(java.lang.String uuid)
uuid
- player's uuidpublic void deleteUserData(java.lang.String uuid)
uuid
- uuid of player to delete data forpublic void updateUserData(java.lang.String uuid, java.lang.String data)
uuid
- uuid of the player to update data fordata
- data to put inside databasepublic java.lang.String getUserData(java.lang.String uuid)
uuid
- uuid of the player to get data for.public void saveAll(java.util.HashMap<java.lang.String,PlayerCache> playerCacheMap)