Package dev.plex.cache
Class MongoPlayerData
java.lang.Object
dev.plex.cache.MongoPlayerData
Mongo fetching utilities for players
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final dev.morphia.DatastoreThe datastore object / database -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether the player exists in mongo's databaseGets the player from cache or from mongo's databasevoidsave(PlexPlayer plexPlayer) Saves the player's information in the databasevoidupdate(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:
-