public interface CommonQueries
This exists so that SQL does not necessarily need to be written.
Obtain an instance from QueryService
.
Modifier and Type | Method and Description |
---|---|
boolean |
doesDBHaveTable(java.lang.String table) |
boolean |
doesDBHaveTableColumn(java.lang.String table,
java.lang.String column) |
long |
fetchCurrentSessionPlaytime(java.util.UUID playerUUID)
Get playtime of current online session.
|
long |
fetchLastSeen(java.util.UUID playerUUID,
java.util.UUID serverUUID)
Fetch last seen Epoch ms for a player on a server.
|
java.util.Optional<java.lang.String> |
fetchNameOf(java.util.UUID playerUUID) |
long |
fetchPlaytime(java.util.UUID playerUUID,
java.util.UUID serverUUID,
long after,
long before)
Fetch playtime of a player on a server.
|
java.util.Set<java.util.UUID> |
fetchServerUUIDs() |
java.util.Optional<java.util.UUID> |
fetchUUIDOf(java.lang.String playerName) |
long fetchPlaytime(java.util.UUID playerUUID, java.util.UUID serverUUID, long after, long before)
Returns 0 for any non existing players or servers.
playerUUID
- UUID of the player.serverUUID
- UUID of the Plan server.after
- Data after this Epoch ms should be fetchedbefore
- Data before this Epoch ms should be fetchedlong fetchCurrentSessionPlaytime(java.util.UUID playerUUID)
Requires Capability QUERY_API_ACTIVE_SESSION_PLAYTIME
playerUUID
- UUID of the player.long fetchLastSeen(java.util.UUID playerUUID, java.util.UUID serverUUID)
playerUUID
- UUID of the player.serverUUID
- UUID of the Plan server.java.util.Set<java.util.UUID> fetchServerUUIDs()
java.util.Optional<java.util.UUID> fetchUUIDOf(java.lang.String playerName)
java.util.Optional<java.lang.String> fetchNameOf(java.util.UUID playerUUID)
boolean doesDBHaveTable(java.lang.String table)
boolean doesDBHaveTableColumn(java.lang.String table, java.lang.String column)