Package dev.plex.cache
Class MongoPlayerData
java.lang.Object
dev.plex.cache.MongoPlayerData
Mongo fetching utilities for players
-
Field Summary
Modifier and TypeFieldDescriptionprivate final dev.morphia.Datastore
The datastore object / database -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether the player exists in mongo's databaseGets the player from cache or from mongo's databasevoid
save
(PlexPlayer plexPlayer) Saves the player's information in the databasevoid
update
(PlexPlayer player) Updates a player's information in the mongo database
-
Field Details
-
datastore
private final dev.morphia.Datastore datastoreThe datastore object / database
-
-
Constructor Details
-
MongoPlayerData
public MongoPlayerData()Creates an instance of the player data
-
-
Method Details
-
exists
Checks whether the player exists in mongo's database- Parameters:
uuid
- The unique ID of the player- Returns:
- true if the player was found
-
getByUUID
Gets the player from cache or from mongo's database- Parameters:
uuid
- The unique ID of the player- Returns:
- a PlexPlayer object
- See Also:
-
update
Updates a player's information in the mongo database- Parameters:
player
- The PlexPlayer object- See Also:
-
save
Saves the player's information in the database- Parameters:
plexPlayer
- The PlexPlayer object- See Also:
-