Class Identifiers
- java.lang.Object
-
- com.djrapitops.plan.identification.Identifiers
-
@Singleton public class Identifiers extends java.lang.Object
Utility for getting server identifier from different sources.
-
-
Constructor Summary
Constructors Constructor Description Identifiers(DBSystem dbSystem, UUIDUtility uuidUtility)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.UUID
getPlayerUUID(Request request)
Obtain UUID of the player.java.util.UUID
getPlayerUUID(java.lang.String name)
ServerUUID
getServerUUID(Request request)
Obtain UUID of the server.java.util.Optional<ServerUUID>
getServerUUID(java.lang.String identifier)
Obtain UUID of the server.static java.util.Optional<java.lang.Long>
getTimestamp(Request request)
-
-
-
Field Detail
-
dbSystem
protected final DBSystem dbSystem
-
-
Constructor Detail
-
Identifiers
@Inject public Identifiers(DBSystem dbSystem, UUIDUtility uuidUtility)
-
-
Method Detail
-
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 java.util.Optional<ServerUUID> 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 java.util.Optional<java.lang.Long> getTimestamp(Request request)
-
-