From: David ‘Bombe’ Roden Date: Fri, 22 Nov 2024 22:54:19 +0000 (+0100) Subject: ♻️ Rename flag for including global requests X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d24cf7427558437ac612284fc600f717466cdc15;p=jFCPlib.git ♻️ Rename flag for including global requests --- diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 7450a35..c25f5b7 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -906,8 +906,8 @@ public class FcpClient implements Closeable { /** * Returns all currently visible persistent get requests. * - * @param global - * true to return get requests from the global + * @param includeGlobalRequests + * true to also return get requests from the global * queue, false to only show requests from the * client-local queue * @return All get requests @@ -916,15 +916,15 @@ public class FcpClient implements Closeable { * @throws FcpException * if an FCP error occurs */ - public Collection getGetRequests(final boolean global) throws IOException, FcpException { - return getRequests(global).stream().filter(request -> request instanceof GetRequest).collect(toList()); + public Collection getGetRequests(boolean includeGlobalRequests) throws IOException, FcpException { + return getRequests(includeGlobalRequests).stream().filter(request -> request instanceof GetRequest).collect(toList()); } /** * Returns all currently visible persistent put requests. * - * @param global - * true to return put requests from the global + * @param includeGlobalRequests + * true to also return put requests from the global * queue, false to only show requests from the * client-local queue * @return All put requests @@ -933,15 +933,15 @@ public class FcpClient implements Closeable { * @throws FcpException * if an FCP error occurs */ - public Collection getPutRequests(final boolean global) throws IOException, FcpException { - return getRequests(global).stream().filter(request -> request instanceof PutRequest).collect(toList()); + public Collection getPutRequests(boolean includeGlobalRequests) throws IOException, FcpException { + return getRequests(includeGlobalRequests).stream().filter(request -> request instanceof PutRequest).collect(toList()); } /** * Returns all currently visible persistent requests. * - * @param global - * true to return requests from the global queue, + * @param includeGlobalRequests + * true to also return requests from the global queue, * false to only show requests from the * client-local queue * @return All requests @@ -950,7 +950,7 @@ public class FcpClient implements Closeable { * @throws FcpException * if an FCP error occurs */ - public Collection getRequests(final boolean global) throws IOException, FcpException { + public Collection getRequests(boolean includeGlobalRequests) throws IOException, FcpException { final Map requests = Collections.synchronizedMap(new HashMap()); new ExtendedFcpAdapter() { @@ -968,7 +968,7 @@ public class FcpClient implements Closeable { */ @Override public void receivedPersistentGet(FcpConnection fcpConnection, PersistentGet persistentGet) { - if (!persistentGet.isGlobal() || global) { + if (!persistentGet.isGlobal() || includeGlobalRequests) { GetRequest getRequest = new GetRequest(persistentGet); requests.put(persistentGet.getIdentifier(), getRequest); } @@ -1017,7 +1017,7 @@ public class FcpClient implements Closeable { */ @Override public void receivedPersistentPut(FcpConnection fcpConnection, PersistentPut persistentPut) { - if (!persistentPut.isGlobal() || global) { + if (!persistentPut.isGlobal() || includeGlobalRequests) { PutRequest putRequest = new PutRequest(persistentPut); requests.put(persistentPut.getIdentifier(), putRequest); }