X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fquelaton%2FUnsubscribeUskCommandImpl.java;h=3755a05cc9757f8e17c772bf2a81d185c378fa99;hb=7a3be5ca037785f4f1acb225381578db12d15eb1;hp=44450b5583c709ef092ab994da4c541ac1df80da;hpb=91de0a638af50527fc314ed97a095d1beaf36866;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/UnsubscribeUskCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/UnsubscribeUskCommandImpl.java index 44450b5..3755a05 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/UnsubscribeUskCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/UnsubscribeUskCommandImpl.java @@ -3,6 +3,7 @@ package net.pterodactylus.fcp.quelaton; import java.io.IOException; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; +import java.util.function.Supplier; import net.pterodactylus.fcp.UnsubscribeUSK; @@ -17,14 +18,14 @@ import com.google.common.util.concurrent.MoreExecutors; */ public class UnsubscribeUskCommandImpl implements UnsubscribeUskCommand { - private static final RandomIdentifierGenerator IDENTIFIER = new RandomIdentifierGenerator(); private final ListeningExecutorService threadPool; private final ConnectionSupplier connectionSupplier; - private final UnsubscribeUSK unsubscribeUSK = new UnsubscribeUSK(IDENTIFIER.generate()); + private final UnsubscribeUSK unsubscribeUSK; - public UnsubscribeUskCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) { + public UnsubscribeUskCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier, Supplier identifierGenerator) { this.threadPool = MoreExecutors.listeningDecorator(threadPool); this.connectionSupplier = connectionSupplier; + unsubscribeUSK = new UnsubscribeUSK(identifierGenerator.get()); } @Override