Package dev.plex.storage.player
Class MongoPlayerData
java.lang.Object
dev.plex.storage.player.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
boolean
Checks whether the player exists in mongo's databaseGets the player from cache or from 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
-
exists
-
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:
-
getByName
-
getByIP
Gets the player from cache or from mongo's database- Parameters:
ip
- The IP address 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:
-
getPlayers
-
save
Saves the player's information in the database- Parameters:
plexPlayer
- The PlexPlayer object- See Also:
-