Class Identifiers

java.lang.Object
com.djrapitops.plan.identification.Identifiers

@Singleton public class Identifiers extends Object
Utility for getting server identifier from different sources.
  • Field Details

    • dbSystem

      protected final DBSystem dbSystem
  • Constructor Details

  • Method Details

    • getServerUUID

      public ServerUUID getServerUUID(Request request)
      Obtain UUID of the server.
      Parameters:
      request - for Request, URIQuery needs a 'server' parameter.
      Returns:
      UUID of the server.
      Throws:
      BadRequestException - If server parameter is not defined or the server is not in the database.
    • getServerUUID

      public Optional<ServerUUID> getServerUUID(String identifier)
      Obtain UUID of the server.
      Parameters:
      identifier - Identifier (name or uuid string) of the server
      Returns:
      UUID of the server.
      Throws:
      BadRequestException - If the server is not in the database.
    • getPlayerUUID

      public UUID getPlayerUUID(Request request)
      Obtain UUID of the player.
      Parameters:
      request - for Request, URIQuery needs a 'player' parameter.
      Returns:
      UUID of the player.
      Throws:
      BadRequestException - If player parameter is not defined or the player is not in the database.
    • getPlayerUUID

      public UUID getPlayerUUID(String name)
    • getTimestamp

      public static Optional<Long> getTimestamp(Request request)