Class MongoPlayerData

java.lang.Object
dev.plex.cache.player.MongoPlayerData

public class MongoPlayerData extends Object
Mongo fetching utilities for players
  • Field Details

    • datastore

      private final dev.morphia.Datastore datastore
      The datastore object / database
  • Constructor Details

    • MongoPlayerData

      public MongoPlayerData()
      Creates an instance of the player data
  • Method Details

    • exists

      public boolean exists(UUID uuid)
      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

      public PlexPlayer getByUUID(UUID uuid)
      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

      public PlexPlayer getByName(String username)
    • getByIP

      public PlexPlayer getByIP(String ip)
      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

      public void update(PlexPlayer player)
      Updates a player's information in the mongo database
      Parameters:
      player - The PlexPlayer object
      See Also:
    • getPlayers

      public List<PlexPlayer> getPlayers()
    • save

      public void save(PlexPlayer plexPlayer)
      Saves the player's information in the database
      Parameters:
      plexPlayer - The PlexPlayer object
      See Also: