Class SessionQueries
java.lang.Object
com.djrapitops.plan.storage.database.queries.objects.SessionQueries
Queries for
FinishedSession
objects.-
Method Summary
Modifier and TypeMethodDescriptionactivePlaytime
(long after, long before) activePlaytime
(long after, long before, ServerUUID serverUUID) afkTime
(long after, long before) afkTime
(long after, long before, ServerUUID serverUUID) averageAfkPerPlayer
(long after, long before) Fetch average Afk per ALL players.averageAfkPerPlayer
(long after, long before, ServerUUID serverUUID) averagePlaytimePerDay
(long after, long before, long timeZoneOffset, ServerUUID serverUUID) averagePlaytimePerPlayer
(long after, long before) Fetch average playtime per ALL players.averagePlaytimePerPlayer
(long after, long before, ServerUUID serverUUID) static Query
<List<FinishedSession>> Query the database for Session data with kill, death or world data.static Query
<List<FinishedSession>> fetchLatestSessions
(int limit) static Query
<List<FinishedSession>> fetchLatestSessionsOfServer
(ServerUUID serverUUID, int limit) static Query
<List<FinishedSession>> fetchServerSessionsWithoutKillOrWorldData
(long after, long before, ServerUUID serverUUID) static Query
<Map<ServerUUID, List<FinishedSession>>> fetchSessionsOfPlayer
(UUID playerUUID) Query the database for Session data of a player with kill and world data.lastSeen
(ServerUUID serverUUID) lastSeen
(UUID playerUUID, ServerUUID serverUUID) playtime
(long after, long before) playtime
(long after, long before, ServerUUID serverUUID) static Query
<Map<ServerUUID, Long>> playtimeOfPlayer
(long after, long before, UUID playerUUID) static Query
<NavigableMap<Long, Long>> playtimePerDay
(long after, long before, long timeZoneOffset) Query playtime for each day within range across the whole network.static Query
<NavigableMap<Long, Long>> playtimePerDay
(long after, long before, long timeZoneOffset, ServerUUID serverUUID) Query playtime for each day within range on a server.playtimePerServer
(long after, long before) sessionCount
(long after, long before) sessionCount
(long after, long before, ServerUUID serverUUID) static Query
<NavigableMap<Long, Integer>> sessionCountPerDay
(long after, long before, long timeZoneOffset) Query session count for each day within range across the whole network.static Query
<NavigableMap<Long, Integer>> sessionCountPerDay
(long after, long before, long timeZoneOffset, ServerUUID serverUUID) Query session count for each day within range on a server.summaryOfPlayers
(Set<Integer> userIds, List<ServerUUID> serverUUIDs, long after, long before) userIdsOfPlayedBetween
(long after, long before, List<ServerUUID> serverUUIDs)
-
Method Details
-
fetchAllSessions
Query the database for Session data with kill, death or world data.- Returns:
- List of sessions
-
fetchSessionsOfPlayer
Query the database for Session data of a player with kill and world data.- Parameters:
playerUUID
- UUID of the Player.- Returns:
- Map: Server UUID - List of sessions on the server.
-
fetchServerSessionsWithoutKillOrWorldData
public static Query<List<FinishedSession>> fetchServerSessionsWithoutKillOrWorldData(long after, long before, ServerUUID serverUUID) -
fetchLatestSessionsOfServer
public static Query<List<FinishedSession>> fetchLatestSessionsOfServer(ServerUUID serverUUID, int limit) -
fetchLatestSessions
-
sessionCount
-
sessionCount
-
sessionCountPerDay
public static Query<NavigableMap<Long,Integer>> sessionCountPerDay(long after, long before, long timeZoneOffset, ServerUUID serverUUID) Query session count for each day within range on a server.- Parameters:
after
- After epoch msbefore
- Before epoch mstimeZoneOffset
- Offset in ms to determine start of day.serverUUID
- UUID of the Plan server.- Returns:
- Map - Epoch ms (Start of day at 0 AM, no offset) : Session count of that day
-
sessionCountPerDay
public static Query<NavigableMap<Long,Integer>> sessionCountPerDay(long after, long before, long timeZoneOffset) Query session count for each day within range across the whole network.- Parameters:
after
- After epoch msbefore
- Before epoch mstimeZoneOffset
- Offset in ms to determine start of day.- Returns:
- Map - Epoch ms (Start of day at 0 AM, no offset) : Session count of that day
-
playtime
-
playtimeOfPlayer
public static Query<Map<ServerUUID,Long>> playtimeOfPlayer(long after, long before, UUID playerUUID) -
playtime
-
playtimePerDay
public static Query<NavigableMap<Long,Long>> playtimePerDay(long after, long before, long timeZoneOffset, ServerUUID serverUUID) Query playtime for each day within range on a server.- Parameters:
after
- After epoch msbefore
- Before epoch mstimeZoneOffset
- Offset in ms to determine start of day.serverUUID
- UUID of the Plan server.- Returns:
- Map - Epoch ms (Start of day at 0 AM, no offset) : Playtime of that day
-
playtimePerDay
public static Query<NavigableMap<Long,Long>> playtimePerDay(long after, long before, long timeZoneOffset) Query playtime for each day within range across the whole network.- Parameters:
after
- After epoch msbefore
- Before epoch mstimeZoneOffset
- Offset in ms to determine start of day.- Returns:
- Map - Epoch ms (Start of day at 0 AM, no offset) : Playtime of that day
-
averagePlaytimePerDay
public static Query<Long> averagePlaytimePerDay(long after, long before, long timeZoneOffset, ServerUUID serverUUID) -
averagePlaytimePerPlayer
-
averagePlaytimePerPlayer
Fetch average playtime per ALL players.- Parameters:
after
- After epoch msbefore
- Before epoch ms- Returns:
- Average ms played / player, calculated with grouped sums from sessions table.
-
averageAfkPerPlayer
-
averageAfkPerPlayer
Fetch average Afk per ALL players.- Parameters:
after
- After epoch msbefore
- Before epoch ms- Returns:
- Average ms afk / player, calculated with grouped sums from sessions table.
-
afkTime
-
afkTime
-
playtimePerServer
-
lastSeen
-
lastSeen
-
activePlaytime
-
activePlaytime
-
userIdsOfPlayedBetween
public static Query<Set<Integer>> userIdsOfPlayedBetween(long after, long before, List<ServerUUID> serverUUIDs) -
summaryOfPlayers
-
earliestSessionStart
-
lastSeen
-