X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FNodeManager.java;h=db63df93c2f20a06ac1bf35a6a579a75becc140c;hb=4f10436f68115773d86be96fa3a2040d859ade1f;hp=f7b231d49b3afc25824b2f7ab111b29c1e2c5150;hpb=a8bc3ffc9cf0cb7f18bc9dde44825e948ed3add2;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/NodeManager.java b/src/net/pterodactylus/jsite/core/NodeManager.java index f7b231d..db63df9 100644 --- a/src/net/pterodactylus/jsite/core/NodeManager.java +++ b/src/net/pterodactylus/jsite/core/NodeManager.java @@ -379,6 +379,18 @@ public class NodeManager implements Iterable, PropertyChangeListener { } /** + * Returns the FCP client for the given node. + * + * @param node + * The node to get the FCP client for + * @return The FCP client for the given node, or {@code null} if the node + * does not have an associated FCP client + */ + FcpClient getFcpClient(Node node) { + return nodeClients.get(node); + } + + /** * Generates a new SSK key pair. * * @return An array with the private key at index 0 and the @@ -393,15 +405,16 @@ public class NodeManager implements Iterable, PropertyChangeListener { if (nodes.isEmpty()) { throw new NoNodeException("no node configured"); } + FcpException fcpException = null; for (FcpClient fcpClient : nodeClients.values()) { try { SSKKeypair sskKeypair = fcpClient.generateKeyPair(); return new String[] { sskKeypair.getInsertURI(), sskKeypair.getRequestURI() }; } catch (FcpException fcpe1) { - /* ignore, we’ll throw later on if needs be. */ + fcpException = fcpe1; } } - throw new JSiteException("Could not get SSK key pair from any node."); + throw new JSiteException("Could not get SSK key pair from any node.", fcpException); } //