public class IPsTable extends UserIDTable
columnUserID, usersTable
db, tableName, usingMySQL
Modifier and Type | Method and Description |
---|---|
void |
createTable() |
Map<UUID,List<String>> |
getAllGeolocations() |
Map<UUID,Map<String,String>> |
getAllIPsAndGeolocations() |
Optional<String> |
getGeolocation(String ip) |
List<String> |
getGeolocations(UUID uuid) |
List<String> |
getIps(UUID uuid) |
void |
insertIPsAndGeolocations(Map<UUID,Map<String,String>> allIPsAndGeolocations) |
void |
saveIP(UUID uuid,
String ip,
String geolocation) |
removeUser
addColumns, close, commit, createTable, equals, execute, executeUnsafe, getConnection, getDb, getTableName, getVersion, hashCode, removeAllData, removeColumns, toString
public IPsTable(SQLDB db, boolean usingMySQL)
db
- The databaseusingMySQL
- if the server is using MySQLpublic void createTable() throws DBCreateTableException
createTable
in class Table
DBCreateTableException
public List<String> getGeolocations(UUID uuid) throws SQLException
uuid
- UUID of the user.SQLException
- when an error at retrieval happenspublic List<String> getIps(UUID uuid) throws SQLException
SQLException
public void saveIP(UUID uuid, String ip, String geolocation) throws SQLException
SQLException
public Optional<String> getGeolocation(String ip) throws SQLException
SQLException
public Map<UUID,List<String>> getAllGeolocations() throws SQLException
SQLException
public Map<UUID,Map<String,String>> getAllIPsAndGeolocations() throws SQLException
SQLException
public void insertIPsAndGeolocations(Map<UUID,Map<String,String>> allIPsAndGeolocations) throws SQLException
SQLException
Copyright © 2017. All rights reserved.