public interface GameProfileManager
GameProfile
creation and data population.
The manager may cache the data of a request for faster lookups. Note that the cached data may not always be up to date.
Modifier and Type | Method and Description |
---|---|
GameProfile |
createProfile(UUID uniqueId,
String name)
Creates a
GameProfile from the provided ID and name. |
ProfileProperty |
createProfileProperty(String name,
String value,
String signature)
Creates a
ProfileProperty from the provided name, value,
and optional signature. |
default CompletableFuture<GameProfile> |
fill(GameProfile profile)
Fills a
GameProfile . |
default CompletableFuture<GameProfile> |
fill(GameProfile profile,
boolean signed)
Fills a
GameProfile . |
CompletableFuture<GameProfile> |
fill(GameProfile profile,
boolean signed,
boolean useCache)
Fills a
GameProfile . |
default CompletableFuture<GameProfile> |
get(String name)
Looks up a
GameProfile by its user name (case-insensitive). |
CompletableFuture<GameProfile> |
get(String name,
boolean useCache)
Looks up a
GameProfile by its user name (case-insensitive). |
default CompletableFuture<GameProfile> |
get(UUID uniqueId)
Looks up a
GameProfile by its unique ID. |
CompletableFuture<GameProfile> |
get(UUID uniqueId,
boolean useCache)
Looks up a
GameProfile by its unique ID. |
CompletableFuture<Collection<GameProfile>> |
getAllById(Iterable<UUID> uniqueIds,
boolean useCache)
Gets a collection of
GameProfile s by their unique IDs. |
CompletableFuture<Collection<GameProfile>> |
getAllByName(Iterable<String> names,
boolean useCache)
Gets a collection of
GameProfile s by their user names
(case-insensitive). |
GameProfileCache |
getCache()
Gets the active
GameProfile cache. |
GameProfileCache |
getDefaultCache()
Gets the default cache.
|
void |
setCache(GameProfileCache cache)
Sets the
GameProfile cache. |
GameProfile createProfile(UUID uniqueId, @Nullable String name)
GameProfile
from the provided ID and name.uniqueId
- The unique IDname
- The nameGameProfile.of(UUID, String)
ProfileProperty createProfileProperty(String name, String value, @Nullable String signature)
ProfileProperty
from the provided name, value,
and optional signature.name
- The name for the propertyvalue
- The value of the propertysignature
- The signature of the propertyProfileProperty.of(String, String)
,
ProfileProperty.of(String, String, String)
default CompletableFuture<GameProfile> get(UUID uniqueId)
GameProfile
by its unique ID.
This method checks the local profile cache before contacting the
profile servers. Use get(UUID, boolean)
to disable the cache
lookup.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
uniqueId
- The unique IDdefault CompletableFuture<GameProfile> get(String name)
GameProfile
by its user name (case-insensitive).
This method checks the local profile cache before contacting the
profile servers. Use get(String, boolean)
to disable the cache
lookup.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
name
- The usernameCompletableFuture<GameProfile> get(UUID uniqueId, boolean useCache)
GameProfile
by its unique ID.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
uniqueId
- The unique IDuseCache
- true to perform a cache lookup firstCompletableFuture<GameProfile> get(String name, boolean useCache)
GameProfile
by its user name (case-insensitive).
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
name
- The usernameuseCache
- true to perform a cache lookup firstCompletableFuture<Collection<GameProfile>> getAllById(Iterable<UUID> uniqueIds, boolean useCache)
GameProfile
s by their unique IDs.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
uniqueIds
- The UUIDsuseCache
- true to perform a cache lookup firstCompletableFuture<Collection<GameProfile>> getAllByName(Iterable<String> names, boolean useCache)
GameProfile
s by their user names
(case-insensitive).
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
names
- The user namesuseCache
- true to perform a cache lookup firstdefault CompletableFuture<GameProfile> fill(GameProfile profile)
GameProfile
.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
profile
- The profile to filldefault CompletableFuture<GameProfile> fill(GameProfile profile, boolean signed)
GameProfile
.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
profile
- The profile to fillsigned
- true if we should request that the profile data be signedCompletableFuture<GameProfile> fill(GameProfile profile, boolean signed, boolean useCache)
GameProfile
.
The returned CompletableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
profile
- The profile to fillsigned
- true if we should request that the profile data be signeduseCache
- true to perform a cache lookup firstGameProfileCache getCache()
GameProfile
cache.void setCache(GameProfileCache cache)
GameProfile
cache.
To restore the original cache, pass the result of getDefaultCache()
.
cache
- The new cacheGameProfileCache getDefaultCache()