diff --git a/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiGroupManager.java b/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiGroupManager.java index a860e6c56..754587d4b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiGroupManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiGroupManager.java @@ -115,7 +115,7 @@ public class ApiGroupManager extends ApiAbstractManager>> getWithPermission(@NonNull String permission) { Objects.requireNonNull(permission, "permission"); - return (CompletableFuture) this.plugin.getStorage().getGroupsWithPermission(StandardNodeMatchers.key(permission)); + return (CompletableFuture) this.plugin.getStorage().searchGroupNodes(StandardNodeMatchers.key(permission)); } @SuppressWarnings("unchecked") @@ -123,7 +123,7 @@ public class ApiGroupManager extends ApiAbstractManager CompletableFuture>> searchAll(@NonNull NodeMatcher matcher) { Objects.requireNonNull(matcher, "matcher"); ConstraintNodeMatcher constraint = (ConstraintNodeMatcher) matcher; - return this.plugin.getStorage().getGroupsWithPermission(constraint).thenApply(list -> { + return this.plugin.getStorage().searchGroupNodes(constraint).thenApply(list -> { ImmutableListMultimap.Builder builder = ImmutableListMultimap.builder(); for (NodeEntry row : list) { builder.put(row.getHolder(), row.getNode()); diff --git a/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiUserManager.java b/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiUserManager.java index cba5a3a73..4e5e425a4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiUserManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/implementation/ApiUserManager.java @@ -124,7 +124,7 @@ public class ApiUserManager extends ApiAbstractManager>> getWithPermission(@NonNull String permission) { Objects.requireNonNull(permission, "permission"); - return (CompletableFuture) this.plugin.getStorage().getUsersWithPermission(StandardNodeMatchers.key(permission)); + return (CompletableFuture) this.plugin.getStorage().searchUserNodes(StandardNodeMatchers.key(permission)); } @SuppressWarnings("unchecked") @@ -132,7 +132,7 @@ public class ApiUserManager extends ApiAbstractManager @NonNull CompletableFuture>> searchAll(@NonNull NodeMatcher matcher) { Objects.requireNonNull(matcher, "matcher"); ConstraintNodeMatcher constraint = (ConstraintNodeMatcher) matcher; - return this.plugin.getStorage().getUsersWithPermission(constraint).thenApply(list -> { + return this.plugin.getStorage().searchUserNodes(constraint).thenApply(list -> { ImmutableListMultimap.Builder builder = ImmutableListMultimap.builder(); for (NodeEntry row : list) { builder.put(row.getHolder(), row.getNode()); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java index a359637f8..1133bb6f7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/group/GroupListMembers.java @@ -88,7 +88,7 @@ public class GroupListMembers extends ChildCommand { Message.SEARCH_SEARCHING_MEMBERS.send(sender, group.getName()); - List> matchedUsers = plugin.getStorage().getUsersWithPermission(matcher).join().stream() + List> matchedUsers = plugin.getStorage().searchUserNodes(matcher).join().stream() .filter(n -> n.getNode().getValue()) .collect(Collectors.toList()); @@ -105,7 +105,7 @@ public class GroupListMembers extends ChildCommand { Message.SEARCH_RESULT_GROUP_DEFAULT.send(sender); } - List> matchedGroups = plugin.getStorage().getGroupsWithPermission(matcher).join().stream() + List> matchedGroups = plugin.getStorage().searchGroupNodes(matcher).join().stream() .filter(n -> n.getNode().getValue()) .collect(Collectors.toList()); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java index 79102142c..4badc8ce8 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java @@ -95,7 +95,7 @@ public class EditorCommand extends SingleCommand { // include all online players Map users = new LinkedHashMap<>(plugin.getUserManager().getAll()); - // then fill up with other users + // then fill up with other users with permissions if (type.includingOffline && users.size() < MAX_USERS) { plugin.getStorage().getUniqueUsers().join().stream() .filter(uuid -> !users.containsKey(uuid)) diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java index a50864f4f..a64a37040 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java @@ -87,8 +87,8 @@ public class SearchCommand extends SingleCommand { Message.SEARCH_SEARCHING.send(sender, matcher); - List> matchedUsers = plugin.getStorage().getUsersWithPermission(matcher).join(); - List> matchedGroups = plugin.getStorage().getGroupsWithPermission(matcher).join(); + List> matchedUsers = plugin.getStorage().searchUserNodes(matcher).join(); + List> matchedGroups = plugin.getStorage().searchGroupNodes(matcher).join(); int users = matchedUsers.size(); int groups = matchedGroups.size(); diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java b/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java index 5ee595189..2226f7e06 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java @@ -162,9 +162,9 @@ public class Storage { return makeFuture(this.implementation::getUniqueUsers); } - public CompletableFuture>> getUsersWithPermission(ConstraintNodeMatcher constraint) { + public CompletableFuture>> searchUserNodes(ConstraintNodeMatcher constraint) { return makeFuture(() -> { - List> result = this.implementation.getUsersWithPermission(constraint); + List> result = this.implementation.searchUserNodes(constraint); result.removeIf(entry -> entry.getNode().hasExpired()); return ImmutableList.copyOf(result); }); @@ -208,9 +208,9 @@ public class Storage { }); } - public CompletableFuture>> getGroupsWithPermission(ConstraintNodeMatcher constraint) { + public CompletableFuture>> searchGroupNodes(ConstraintNodeMatcher constraint) { return makeFuture(() -> { - List> result = this.implementation.getGroupsWithPermission(constraint); + List> result = this.implementation.searchGroupNodes(constraint); result.removeIf(entry -> entry.getNode().hasExpired()); return ImmutableList.copyOf(result); }); diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/StorageImplementation.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/StorageImplementation.java index d3ea7fc51..df6404da3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/StorageImplementation.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/StorageImplementation.java @@ -72,7 +72,7 @@ public interface StorageImplementation { Set getUniqueUsers() throws Exception; - List> getUsersWithPermission(ConstraintNodeMatcher constraint) throws Exception; + List> searchUserNodes(ConstraintNodeMatcher constraint) throws Exception; Group createAndLoadGroup(String name) throws Exception; @@ -84,7 +84,7 @@ public interface StorageImplementation { void deleteGroup(Group group) throws Exception; - List> getGroupsWithPermission(ConstraintNodeMatcher constraint) throws Exception; + List> searchGroupNodes(ConstraintNodeMatcher constraint) throws Exception; Track createAndLoadTrack(String name) throws Exception; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/CombinedConfigurateStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/CombinedConfigurateStorage.java index 4802fe83e..55955aa4e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/CombinedConfigurateStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/CombinedConfigurateStorage.java @@ -261,7 +261,7 @@ public class CombinedConfigurateStorage extends AbstractConfigurateStorage { } @Override - public List> getUsersWithPermission(ConstraintNodeMatcher constraint) throws Exception { + public List> searchUserNodes(ConstraintNodeMatcher constraint) throws Exception { List> held = new ArrayList<>(); this.usersLoader.apply(false, true, root -> { for (Map.Entry entry : root.getChildrenMap().entrySet()) { @@ -301,7 +301,7 @@ public class CombinedConfigurateStorage extends AbstractConfigurateStorage { } @Override - public List> getGroupsWithPermission(ConstraintNodeMatcher constraint) throws Exception { + public List> searchGroupNodes(ConstraintNodeMatcher constraint) throws Exception { List> held = new ArrayList<>(); this.groupsLoader.apply(false, true, root -> { for (Map.Entry entry : root.getChildrenMap().entrySet()) { diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/SeparatedConfigurateStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/SeparatedConfigurateStorage.java index 73d28efc1..2d182e5ce 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/SeparatedConfigurateStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/SeparatedConfigurateStorage.java @@ -254,7 +254,7 @@ public class SeparatedConfigurateStorage extends AbstractConfigurateStorage { } @Override - public List> getUsersWithPermission(ConstraintNodeMatcher constraint) throws Exception { + public List> searchUserNodes(ConstraintNodeMatcher constraint) throws Exception { List> held = new ArrayList<>(); try (Stream stream = Files.list(getDirectory(StorageLocation.USER))) { stream.filter(getFileTypeFilter()) @@ -297,7 +297,7 @@ public class SeparatedConfigurateStorage extends AbstractConfigurateStorage { } @Override - public List> getGroupsWithPermission(ConstraintNodeMatcher constraint) throws Exception { + public List> searchGroupNodes(ConstraintNodeMatcher constraint) throws Exception { List> held = new ArrayList<>(); try (Stream stream = Files.list(getDirectory(StorageLocation.GROUP))) { stream.filter(getFileTypeFilter()) diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/mongodb/MongoStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/mongodb/MongoStorage.java index 67354164a..99bf70827 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/mongodb/MongoStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/mongodb/MongoStorage.java @@ -360,7 +360,7 @@ public class MongoStorage implements StorageImplementation { } @Override - public List> getUsersWithPermission(ConstraintNodeMatcher constraint) throws Exception { + public List> searchUserNodes(ConstraintNodeMatcher constraint) throws Exception { List> held = new ArrayList<>(); MongoCollection c = this.database.getCollection(this.prefix + "users"); try (MongoCursor cursor = c.find().iterator()) { @@ -470,7 +470,7 @@ public class MongoStorage implements StorageImplementation { } @Override - public List> getGroupsWithPermission(ConstraintNodeMatcher constraint) throws Exception { + public List> searchGroupNodes(ConstraintNodeMatcher constraint) throws Exception { List> held = new ArrayList<>(); MongoCollection c = this.database.getCollection(this.prefix + "groups"); try (MongoCursor cursor = c.find().iterator()) { diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/split/SplitStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/split/SplitStorage.java index 986c1b398..dc79afb95 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/split/SplitStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/split/SplitStorage.java @@ -154,8 +154,8 @@ public class SplitStorage implements StorageImplementation { } @Override - public List> getUsersWithPermission(ConstraintNodeMatcher constraint) throws Exception { - return implFor(SplitStorageType.USER).getUsersWithPermission(constraint); + public List> searchUserNodes(ConstraintNodeMatcher constraint) throws Exception { + return implFor(SplitStorageType.USER).searchUserNodes(constraint); } @Override @@ -184,8 +184,8 @@ public class SplitStorage implements StorageImplementation { } @Override - public List> getGroupsWithPermission(ConstraintNodeMatcher constraint) throws Exception { - return implFor(SplitStorageType.GROUP).getGroupsWithPermission(constraint); + public List> searchGroupNodes(ConstraintNodeMatcher constraint) throws Exception { + return implFor(SplitStorageType.GROUP).searchGroupNodes(constraint); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/sql/SqlStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/sql/SqlStorage.java index 3c67a7d5c..5eee8815a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/sql/SqlStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/sql/SqlStorage.java @@ -363,7 +363,7 @@ public class SqlStorage implements StorageImplementation { } @Override - public List> getUsersWithPermission(ConstraintNodeMatcher constraint) throws SQLException { + public List> searchUserNodes(ConstraintNodeMatcher constraint) throws SQLException { PreparedStatementBuilder builder = new PreparedStatementBuilder().append(USER_PERMISSIONS_SELECT_PERMISSION); constraint.getConstraint().appendSql(builder, "permission"); @@ -506,7 +506,7 @@ public class SqlStorage implements StorageImplementation { } @Override - public List> getGroupsWithPermission(ConstraintNodeMatcher constraint) throws SQLException { + public List> searchGroupNodes(ConstraintNodeMatcher constraint) throws SQLException { PreparedStatementBuilder builder = new PreparedStatementBuilder().append(GROUP_PERMISSIONS_SELECT_PERMISSION); constraint.getConstraint().appendSql(builder, "permission"); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeGroupManager.java b/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeGroupManager.java index 68f92b852..08044f1ef 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeGroupManager.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeGroupManager.java @@ -193,7 +193,7 @@ public class SpongeGroupManager extends AbstractGroupManager implem return CompletableFuture.supplyAsync(() -> { ImmutableMap.Builder builder = ImmutableMap.builder(); - List> lookup = this.plugin.getStorage().getGroupsWithPermission(StandardNodeMatchers.key(permission)).join(); + List> lookup = this.plugin.getStorage().searchGroupNodes(StandardNodeMatchers.key(permission)).join(); for (NodeEntry holder : lookup) { if (holder.getNode().getContexts().equals(ImmutableContextSetImpl.EMPTY)) { builder.put(getService().getReferenceFactory().obtain(getIdentifier(), holder.getHolder()), holder.getNode().getValue()); @@ -209,7 +209,7 @@ public class SpongeGroupManager extends AbstractGroupManager implem return CompletableFuture.supplyAsync(() -> { ImmutableMap.Builder builder = ImmutableMap.builder(); - List> lookup = this.plugin.getStorage().getGroupsWithPermission(StandardNodeMatchers.key(permission)).join(); + List> lookup = this.plugin.getStorage().searchGroupNodes(StandardNodeMatchers.key(permission)).join(); for (NodeEntry holder : lookup) { if (holder.getNode().getContexts().equals(contexts)) { builder.put(getService().getReferenceFactory().obtain(getIdentifier(), holder.getHolder()), holder.getNode().getValue()); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeUserManager.java b/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeUserManager.java index 3eb3c23bd..d408329b0 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeUserManager.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/model/manager/SpongeUserManager.java @@ -212,7 +212,7 @@ public class SpongeUserManager extends AbstractUserManager implement return CompletableFuture.supplyAsync(() -> { ImmutableMap.Builder builder = ImmutableMap.builder(); - List> lookup = this.plugin.getStorage().getUsersWithPermission(StandardNodeMatchers.key(permission)).join(); + List> lookup = this.plugin.getStorage().searchUserNodes(StandardNodeMatchers.key(permission)).join(); for (NodeEntry holder : lookup) { if (holder.getNode().getContexts().equals(ImmutableContextSetImpl.EMPTY)) { builder.put(getService().getReferenceFactory().obtain(getIdentifier(), holder.getHolder().toString()), holder.getNode().getValue()); @@ -228,7 +228,7 @@ public class SpongeUserManager extends AbstractUserManager implement return CompletableFuture.supplyAsync(() -> { ImmutableMap.Builder builder = ImmutableMap.builder(); - List> lookup = this.plugin.getStorage().getUsersWithPermission(StandardNodeMatchers.key(permission)).join(); + List> lookup = this.plugin.getStorage().searchUserNodes(StandardNodeMatchers.key(permission)).join(); for (NodeEntry holder : lookup) { if (holder.getNode().getContexts().equals(contexts)) { builder.put(getService().getReferenceFactory().obtain(getIdentifier(), holder.getHolder().toString()), holder.getNode().getValue());