public interface ProfileRepository
Profile instances
for given unique ids or names.
Methods which are prefixed with get perform a quick local search, and return no result if no value is cached locally.
Methods which are prefixed with lookup perform a more complete search, usually querying an underlying database.
| Modifier and Type | Method and Description |
|---|---|
Collection<Profile> |
getKnownProfiles()
Gets a collection of profiles known to the repository.
|
Optional<Profile> |
getProfile(String name)
Gets a profile from this repository, using the name as the base
for the request.
|
Profile |
getProfile(UUID uniqueId)
Gets a profile from this repository, using the unique id as the base for
the request.
|
default Map<UUID,Profile> |
getProfiles(Iterable<UUID> uniqueIds)
Populates a map of unique id to profile for the given iterable of unique ids.
|
default Map<String,Profile> |
getProfilesByName(Iterable<String> names)
Populates a map of name to profile for the given iterable of names.
|
Promise<Collection<Profile>> |
lookupKnownProfiles()
Gets a collection of profiles known to the repository.
|
Promise<Optional<Profile>> |
lookupProfile(String name)
Gets a profile from this repository, using the name as the base
for the request.
|
Promise<Profile> |
lookupProfile(UUID uniqueId)
Gets a profile from this repository, using the unique id as the base for
the request.
|
Promise<Map<UUID,Profile>> |
lookupProfiles(Iterable<UUID> uniqueIds)
Populates a map of unique id to profile for the given iterable of unique ids.
|
Promise<Map<String,Profile>> |
lookupProfilesByName(Iterable<String> names)
Populates a map of name to profile for the given iterable of names.
|
@Nonnull Profile getProfile(@Nonnull UUID uniqueId)
If this repository does not contain a profile matching the unique id, a profile will still be returned, but will not be populated with a name.
uniqueId - the unique id to get a profile for@Nonnull Optional<Profile> getProfile(@Nonnull String name)
If this repository does not contain a profile matching the name, an empty optional will be returned.
In the case that there is more than one profile in the repository matching the name, the most up-to-date record is returned.
name - the name to get a profile for@Nonnull Collection<Profile> getKnownProfiles()
Returned profiles will always be populated with both a unique id and a username.
@Nonnull default Map<UUID,Profile> getProfiles(@Nonnull Iterable<UUID> uniqueIds)
The map will only contain an entry for each given unique id if there is a corresponding profile for the unique id in the repository.
uniqueIds - the unique ids to get profiles forgetProfile(UUID)@Nonnull default Map<String,Profile> getProfilesByName(@Nonnull Iterable<String> names)
The map will only contain an entry for each given name if there is a corresponding profile for the name in the repository.
names - the names to get profiles forgetProfile(String)@Nonnull Promise<Profile> lookupProfile(@Nonnull UUID uniqueId)
If this repository does not contain a profile matching the unique id, a profile will still be returned, but will not be populated with a name.
uniqueId - the unique id to get a profile for@Nonnull Promise<Optional<Profile>> lookupProfile(@Nonnull String name)
If this repository does not contain a profile matching the name, an empty optional will be returned.
In the case that there is more than one profile in the repository matching the name, the most up-to-date record is returned.
name - the name to get a profile for@Nonnull Promise<Collection<Profile>> lookupKnownProfiles()
Returned profiles will always be populated with both a unique id and a username.
@Nonnull Promise<Map<UUID,Profile>> lookupProfiles(@Nonnull Iterable<UUID> uniqueIds)
The map will only contain an entry for each given unique id if there is a corresponding profile for the unique id in the repository.
uniqueIds - the unique ids to get profiles forgetProfile(UUID)@Nonnull Promise<Map<String,Profile>> lookupProfilesByName(@Nonnull Iterable<String> names)
The map will only contain an entry for each given name if there is a corresponding profile for the name in the repository.
names - the names to get profiles forgetProfile(String)Copyright © 2022. All rights reserved.