Package com.djrapitops.plan.query
Class CommonQueriesImplementation
java.lang.Object
com.djrapitops.plan.query.CommonQueriesImplementation
- All Implemented Interfaces:
CommonQueries
-
Method Summary
Modifier and TypeMethodDescriptionbooleandoesDBHaveTable(String table) Check that schema has table you are using in your queries.booleandoesDBHaveTableColumn(String table, String column) Check that schema table has a column you are using in your queries.doublefetchActivityIndexOf(UUID playerUUID, long epochMs) Calculates the activity index for the player at a specific date.longfetchCurrentSessionPlaytime(UUID playerUUID) Get playtime of current online session.longfetchLastSeen(UUID playerUUID, UUID serverUUID) Fetch last seen Epoch ms for a player on a server.fetchNameOf(UUID playerUUID) Fetch name of a player by UUID.longfetchPlaytime(UUID playerUUID, UUID serverUUID, long after, long before) Fetch playtime of a player on a server.Get the UUIDs of all servers Plan has registered.fetchUUIDOf(String playerName) Fetch UUID of a player by name.getActivityGroupForIndex(double activityIndex) Get a String that represents the Activity group for an index.
-
Method Details
-
fetchPlaytime
Description copied from interface:CommonQueriesFetch playtime of a player on a server.Returns 0 for any non existing players or servers.
- Specified by:
fetchPlaytimein interfaceCommonQueries- Parameters:
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 fetched- Returns:
- Milliseconds the player has played with the defined parameters.
-
fetchCurrentSessionPlaytime
Description copied from interface:CommonQueriesGet playtime of current online session.Requires Capability QUERY_API_ACTIVE_SESSION_PLAYTIME
- Specified by:
fetchCurrentSessionPlaytimein interfaceCommonQueries- Parameters:
playerUUID- UUID of the player.- Returns:
- Milliseconds the player has played during current online session. 0 if player is offline.
-
fetchLastSeen
Description copied from interface:CommonQueriesFetch last seen Epoch ms for a player on a server.- Specified by:
fetchLastSeenin interfaceCommonQueries- Parameters:
playerUUID- UUID of the player.serverUUID- UUID of the Plan server.- Returns:
- Epoch ms the player was last seen, 0 if player has not played on server.
-
fetchServerUUIDs
Description copied from interface:CommonQueriesGet the UUIDs of all servers Plan has registered.- Specified by:
fetchServerUUIDsin interfaceCommonQueries- Returns:
- Set of Server UUIDs
-
fetchUUIDOf
Description copied from interface:CommonQueriesFetch UUID of a player by name.- Specified by:
fetchUUIDOfin interfaceCommonQueries- Parameters:
playerName- Name of the player- Returns:
- UUID if it is found by Plan or empty if not found.
-
fetchNameOf
Description copied from interface:CommonQueriesFetch name of a player by UUID.- Specified by:
fetchNameOfin interfaceCommonQueries- Parameters:
playerUUID- UUID of the player- Returns:
- Name if it is known by Plan or empty if not.
-
doesDBHaveTable
Description copied from interface:CommonQueriesCheck that schema has table you are using in your queries.- Specified by:
doesDBHaveTablein interfaceCommonQueries- Parameters:
table- Name of the table, e.g. plan_users.- Returns:
- true if table exists.
-
doesDBHaveTableColumn
Description copied from interface:CommonQueriesCheck that schema table has a column you are using in your queries.- Specified by:
doesDBHaveTableColumnin interfaceCommonQueries- Parameters:
table- Name of the table, e.g. plan_users.column- Name of the column, e.g. id- Returns:
- true if table and column exist.
-
fetchActivityIndexOf
Description copied from interface:CommonQueriesCalculates the activity index for the player at a specific date.- Specified by:
fetchActivityIndexOfin interfaceCommonQueries- Parameters:
playerUUID- UUID of the player.epochMs- Epoch millisecond to use for calculation- Returns:
- a double between 0.0 and 5.0.
-
getActivityGroupForIndex
Description copied from interface:CommonQueriesGet a String that represents the Activity group for an index.- Specified by:
getActivityGroupForIndexin interfaceCommonQueries- Parameters:
activityIndex- a double between 0.0 and 5.0.- Returns:
- Name of the group (in English) that this activityIndex falls within.
-