public class UsersTable extends UserIDTable
Modifier and Type | Field and Description |
---|---|
String |
statementSelectID |
columnUserID, usersTable
db, tableName, usingMySQL
Constructor and Description |
---|
UsersTable(SQLDB db,
boolean usingMySQL) |
Modifier and Type | Method and Description |
---|---|
void |
createTable() |
Map<UUID,Integer> |
getAllTimesKicked() |
String |
getColumnID() |
String |
getColumnName() |
String |
getColumnUUID() |
List<String> |
getMatchingNames(String name)
Gets the names of the players which names or nicknames match
name . |
int |
getPlayerCount() |
String |
getPlayerName(UUID uuid) |
Map<UUID,String> |
getPlayerNames() |
Optional<Long> |
getRegisterDate(UUID uuid) |
List<Long> |
getRegisterDates() |
Set<UUID> |
getSavedUUIDs() |
int |
getTimesKicked(UUID uuid) |
Map<UUID,UserInfo> |
getUsers() |
UUID |
getUuidOf(String playerName)
Get UUID of a player.
|
void |
insertUsers(Map<UUID,UserInfo> users)
Inserts UUIDs, Register dates and Names to the table.
|
boolean |
isRegistered(UUID uuid) |
void |
kicked(UUID uuid) |
void |
registerUser(UUID uuid,
long registered,
String name)
Register a new user (UUID) to the database.
|
void |
removeUser(UUID uuid)
Remove a user from Users Table.
|
void |
updateKicked(Map<UUID,Integer> timesKicked) |
void |
updateName(UUID uuid,
String name) |
addColumns, close, commit, createTable, equals, execute, executeUnsafe, getConnection, getDb, getTableName, getVersion, hashCode, removeAllData, removeColumns, toString
public final String statementSelectID
public UsersTable(SQLDB db, boolean usingMySQL)
public void createTable() throws DBCreateTableException
createTable
in class Table
DBCreateTableException
public Set<UUID> getSavedUUIDs() throws SQLException
Set
of the saved UUIDs.SQLException
- when an error at retrieving the UUIDs happenspublic void removeUser(UUID uuid) throws SQLException
removeUser
in class UserIDTable
uuid
- the UUID of the user that should be removed.SQLException
- DB Errorpublic String getColumnID()
public String getColumnUUID()
public UUID getUuidOf(String playerName) throws SQLException
playerName
- Name of a playerSQLException
- DB Errorpublic List<Long> getRegisterDates() throws SQLException
SQLException
public void registerUser(UUID uuid, long registered, String name) throws SQLException
uuid
- UUID of the player.registered
- Register date.name
- Name of the player.SQLException
- DB ErrorIllegalArgumentException
- If uuid or name are null.public boolean isRegistered(UUID uuid) throws SQLException
SQLException
public void updateName(UUID uuid, String name) throws SQLException
SQLException
public int getTimesKicked(UUID uuid) throws SQLException
SQLException
public void kicked(UUID uuid) throws SQLException
SQLException
public String getPlayerName(UUID uuid) throws SQLException
SQLException
public List<String> getMatchingNames(String name) throws SQLException
name
.name
- the name / nickname.SQLException
- when an error at fetching the names happens.public String getColumnName()
public void insertUsers(Map<UUID,UserInfo> users) throws SQLException
This method is for batch operations, and should not be used to add information of users. Use UserInfoTable instead.
users
- Users to insertSQLException
- DB Errorpublic Map<UUID,UserInfo> getUsers() throws SQLException
SQLException
public void updateKicked(Map<UUID,Integer> timesKicked) throws SQLException
SQLException
public Map<UUID,Integer> getAllTimesKicked() throws SQLException
SQLException
public Map<UUID,String> getPlayerNames() throws SQLException
SQLException
public int getPlayerCount() throws SQLException
SQLException
public Optional<Long> getRegisterDate(UUID uuid) throws SQLException
SQLException
Copyright © 2017. All rights reserved.