/*
- * Sone - FreenetInterface.java - Copyright Ā© 2010ā2019 David Roden
+ * Sone - FreenetInterface.java - Copyright Ā© 2010ā2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/** The node to interact with. */
private final Node node;
+ private final SoneUriCreator soneUriCreator;
+
/** The high-level client to use for requests. */
private final HighLevelSimpleClient client;
private final RequestClient requestClient = new RequestClientBuilder().realTime().build();
private final RequestClient imageInserts = new RequestClientBuilder().realTime().build();
private final RequestClient imageLoader = new RequestClientBuilder().realTime().build();
- /**
- * Creates a new Freenet interface.
- *
- * @param eventBus
- * The event bus
- * @param node
- * The node to interact with
- */
@Inject
- public FreenetInterface(EventBus eventBus, Node node) {
+ public FreenetInterface(EventBus eventBus, Node node, SoneUriCreator soneUriCreator) {
this.eventBus = eventBus;
this.node = node;
+ this.soneUriCreator = soneUriCreator;
this.client = node.clientCore.makeClient(RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, true);
}
}
try {
logger.log(Level.FINEST, String.format("Unsubscribing from USK for %sā¦", sone));
- node.clientCore.uskManager.unsubscribe(USK.create(sone.getRequestUri()), uskCallback);
+ node.clientCore.uskManager.unsubscribe(USK.create(soneUriCreator.getRequestUri(sone)), uskCallback);
} catch (MalformedURLException mue1) {
- logger.log(Level.FINE, String.format("Could not unsubscribe USK ā%sā!", sone.getRequestUri()), mue1);
+ logger.log(Level.FINE, String.format("Could not unsubscribe USK ā%sā!", soneUriCreator.getRequestUri(sone)), mue1);
}
}