From: David ‘Bombe’ Roden Date: Wed, 21 Mar 2018 06:48:25 +0000 (+0100) Subject: Use a real RequestClient instead of casting the HLSC X-Git-Tag: v79^2~126 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2d20ecfaf31c653140e4135c42f8233e001dacb2;p=Sone.git Use a real RequestClient instead of casting the HLSC --- diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index 0fb34b5..f2cbec6 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -93,6 +93,7 @@ public class FreenetInterface { /** The high-level client to use for requests. */ private final HighLevelSimpleClient client; + private final RequestClient requestClient = new RequestClientBuilder().realTime().build(); /** The USK callbacks. */ private final Map soneUskCallbacks = new HashMap(); @@ -256,7 +257,7 @@ public class FreenetInterface { try { soneUskCallbacks.put(routingKey(requestUri), uskCallback); node.clientCore.uskManager.subscribe(create(requestUri), - uskCallback, true, (RequestClient) client); + uskCallback, true, requestClient); } catch (MalformedURLException mue1) { logger.log(WARNING, format("Could not subscribe USK “%s”!", requestUri), mue1); @@ -269,8 +270,7 @@ public class FreenetInterface { soneUskCallbacks.put(routingKey(requestUri), uskCallback); node.clientCore .uskManager - .subscribe(create(requestUri), uskCallback, false, - (RequestClient) client); + .subscribe(create(requestUri), uskCallback, false, requestClient); } catch (MalformedURLException mue1) { logger.log(WARNING, format("Could not subscribe USK “%s”!", requestUri), @@ -326,7 +326,7 @@ public class FreenetInterface { }; try { - node.clientCore.uskManager.subscribe(USK.create(uri), uskCallback, true, (RequestClient) client); + node.clientCore.uskManager.subscribe(USK.create(uri), uskCallback, true, requestClient); uriUskCallbacks.put(uri, uskCallback); } catch (MalformedURLException mue1) { logger.log(Level.WARNING, String.format("Could not subscribe to USK: %s", uri), mue1);