public interface Storage
All blocking methods return CompletableFutures, which will be
populated with the result once the data has been loaded/saved asynchronously.
Care should be taken when using such methods to ensure that the main server
thread is not blocked.
Methods such as CompletableFuture.get() and equivalent should
not be called on the main server thread. If you need to use
the result of these operations on the main server thread, register a
callback using CompletableFuture.thenAcceptAsync(Consumer, Executor).
@Nonnull String getName()
@Nonnull CompletableFuture<Log> getLog()
@Nonnull CompletableFuture<Set<UUID>> getUniqueUsers()
"Unique" meaning the user isn't just a member of the "default" group.
@Nonnull CompletableFuture<List<HeldPermission<UUID>>> getUsersWithPermission(@Nonnull String permission)
permission - the permission to search forNullPointerException - if the permission is null@Nonnull CompletableFuture<List<HeldPermission<String>>> getGroupsWithPermission(@Nonnull String permission)
permission - the permission to search forNullPointerException - if the permission is null@Nonnull CompletableFuture<Boolean> saveUUIDData(@Nonnull String username, @Nonnull UUID uuid)
username - the users usernameuuid - the users mojang unique idNullPointerException - if either parameters are nullIllegalArgumentException - if the username is invalid@Nonnull CompletableFuture<UUID> getUUID(@Nonnull String username)
username - the corresponding usernameNullPointerException - if either parameters are nullIllegalArgumentException - if the username is invalid@Nonnull CompletableFuture<String> getName(@Nonnull UUID uuid)
uuid - the corresponding uuidNullPointerException - if either parameters are null@Deprecated boolean isAcceptingLogins()
@Nonnull @Deprecated Executor getSyncExecutor()
This method is deprecated as plugins should create and use their own executor instances.
@Nonnull @Deprecated Executor getAsyncExecutor()
This method is deprecated as plugins should create and use their own executor instances.
@Nonnull @Deprecated CompletableFuture<Boolean> logAction(@Nonnull LogEntry entry)
ActionLogger.submit(LogEntry).entry - the log entry to be savedNullPointerException - if entry is null@Nonnull @Deprecated CompletableFuture<Boolean> loadUser(@Nonnull UUID uuid, @Nullable String username)
UserManager.loadUser(UUID, String)uuid - the uuid of the user to loadusername - the users username, or null if it is not known.NullPointerException - if uuid is null@Nonnull @Deprecated default CompletableFuture<Boolean> loadUser(@Nonnull UUID uuid)
UserManager.loadUser(UUID)uuid - the uuid of the user to loadNullPointerException - if uuid is null@Nonnull @Deprecated CompletableFuture<Boolean> saveUser(@Nonnull User user)
UserManager.saveUser(User)You should call this after you make any changes to a user.
user - the user to saveNullPointerException - if user is nullIllegalStateException - if the user instance was not obtained from LuckPerms.@Nonnull @Deprecated CompletableFuture<Boolean> createAndLoadGroup(@Nonnull String name)
GroupManager.createAndLoadGroup(String)name - the name of the groupNullPointerException - if name is nullIllegalArgumentException - if the name is invalid@Nonnull @Deprecated CompletableFuture<Boolean> loadGroup(@Nonnull String name)
GroupManager.loadGroup(String)name - the name of the groupNullPointerException - if name is nullIllegalArgumentException - if the name is invalid@Nonnull @Deprecated CompletableFuture<Boolean> loadAllGroups()
GroupManager.loadAllGroups()@Nonnull @Deprecated CompletableFuture<Boolean> saveGroup(@Nonnull Group group)
GroupManager.saveGroup(Group)You should call this after you make any changes to a group.
group - the group to saveNullPointerException - if group is nullIllegalStateException - if the group instance was not obtained from LuckPerms.@Nonnull @Deprecated CompletableFuture<Boolean> deleteGroup(@Nonnull Group group)
GroupManager.deleteGroup(Group)group - the group to deleteNullPointerException - if group is nullIllegalStateException - if the group instance was not obtained from LuckPerms.@Nonnull @Deprecated CompletableFuture<Boolean> createAndLoadTrack(@Nonnull String name)
TrackManager.createAndLoadTrack(String)name - the name of the trackNullPointerException - if name is nullIllegalArgumentException - if the name is invalid@Nonnull @Deprecated CompletableFuture<Boolean> loadTrack(@Nonnull String name)
TrackManager.loadTrack(String)name - the name of the trackNullPointerException - if name is nullIllegalArgumentException - if the name is invalid@Nonnull @Deprecated CompletableFuture<Boolean> loadAllTracks()
TrackManager.loadAllTracks()@Nonnull @Deprecated CompletableFuture<Boolean> saveTrack(@Nonnull Track track)
TrackManager.saveTrack(Track)track - the track to saveNullPointerException - if track is nullIllegalStateException - if the track instance was not obtained from LuckPerms.@Nonnull @Deprecated CompletableFuture<Boolean> deleteTrack(@Nonnull Track track)
TrackManager.deleteTrack(Track)track - the track to deleteNullPointerException - if track is nullIllegalStateException - if the track instance was not obtained from LuckPerms.Copyright © 2018. All rights reserved.