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)
java.util.UUID
getServerUUID(Request request)
Obtain UUID of the server.java.util.Optional<java.util.UUID>
getServerUUID(java.lang.String identifier)
Obtain UUID of the server.static 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 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)
-
-