Class Identifiers


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

      • dbSystem

        protected final DBSystem dbSystem
    • Constructor Detail

    • Method Detail

      • getServerUUID

        public java.util.UUID 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 java.util.Optional<java.util.UUID> getServerUUID​(java.lang.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 java.util.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 java.util.UUID getPlayerUUID​(java.lang.String name)
      • getTimestamp

        public static long getTimestamp​(Request request)