public interface GameProfileResolver
GameProfile
by a given UUID or name.
The service may cache the data of a request for faster lookups. Note that the cached data may not always be up to date.
The returned ListenableFuture
throws an ExecutionException
caused by a ProfileNotFoundException
if the profile does not exist or
an IOException
if a network error occurred.
Modifier and Type | Method and Description |
---|---|
ListenableFuture<GameProfile> |
get(String name)
Looks up a
GameProfile by its user name (case-insensitive). |
ListenableFuture<GameProfile> |
get(String name,
boolean useCache)
Looks up a
GameProfile by its user name (case-insensitive). |
ListenableFuture<GameProfile> |
get(UUID uniqueId)
Looks up a
GameProfile by its unique ID. |
ListenableFuture<GameProfile> |
get(UUID uniqueId,
boolean useCache)
Looks up a
GameProfile by its unique ID. |
ListenableFuture<Collection<GameProfile>> |
getAllById(Iterable<UUID> uniqueIds,
boolean useCache)
Gets a collection of
GameProfile s by their unique IDs. |
ListenableFuture<Collection<GameProfile>> |
getAllByName(Iterable<String> names,
boolean useCache)
Gets a collection of
GameProfile s by their user names
(case-insensitive). |
Collection<GameProfile> |
getCachedProfiles()
Gets a collection of all cached
GameProfile s. |
Collection<GameProfile> |
match(String lastKnownName)
Returns a collection of matching cached
GameProfile s whose last
known user names start with the given string (case-insensitive). |
ListenableFuture<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.
uniqueId
- The unique IDListenableFuture<GameProfile> get(UUID uniqueId, boolean useCache)
GameProfile
by its unique ID.uniqueId
- The unique IDuseCache
- true to perform a cache lookup firstListenableFuture<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.
name
- The usernameListenableFuture<GameProfile> get(String name, boolean useCache)
GameProfile
by its user name (case-insensitive).name
- The usernameuseCache
- true to perform a cache lookup firstListenableFuture<Collection<GameProfile>> getAllByName(Iterable<String> names, boolean useCache)
GameProfile
s by their user names
(case-insensitive).names
- The user namesuseCache
- true to perform a cache lookup firstListenableFuture<Collection<GameProfile>> getAllById(Iterable<UUID> uniqueIds, boolean useCache)
GameProfile
s by their unique IDs.uniqueIds
- The UUIDsuseCache
- true to perform a cache lookup firstCollection<GameProfile> getCachedProfiles()
GameProfile
s.Collection
of GameProfile
sCollection<GameProfile> match(String lastKnownName)
GameProfile
s whose last
known user names start with the given string (case-insensitive).
This collection may also contain profiles of players who never played on the server!
Use
UserStorage.match(String)
for
a collection that only contains GameProfile
s with attached
User
data.
This method only searches the local cache, so the data may not be up to date.
lastKnownName
- The user name