From: David ‘Bombe’ Roden Date: Wed, 9 Apr 2008 16:27:18 +0000 (+0000) Subject: add GetNode command X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e1678d48fd843e1bd0cf7cd0e63680f5b1f8ef4d;p=jSite2.git add GetNode command git-svn-id: http://trooper/svn/projects/jSite/trunk@671 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/util/fcp/GetNode.java b/src/net/pterodactylus/util/fcp/GetNode.java new file mode 100644 index 0000000..40d8be1 --- /dev/null +++ b/src/net/pterodactylus/util/fcp/GetNode.java @@ -0,0 +1,49 @@ +/** + * © 2008 INA Service GmbH + */ +package net.pterodactylus.util.fcp; + +/** + * The “GetNode” command returns the darknet or opennet noderef of the node, + * optionally including private and volatile data. + * + * @author David Roden + * @version $Id$ + */ +public class GetNode extends FcpMessage { + + /** + * Creates a “GetNode” command that returns the darknet noderef of the node. + */ + public GetNode() { + this(null, null, null); + } + + /** + * Creates a “GetNode” command that returns the request noderef of the node, + * including private and volatile data, if requested. If any of the Boolean + * parameters are null the parameter is ignored and the + * node’s default value is used. + * + * @param giveOpennetRef + * true to request the opennet noderef, + * false for darknet + * @param withPrivate + * true to include private data in the noderef + * @param withVolatile + * true to include volatile data in the noderef + */ + public GetNode(Boolean giveOpennetRef, Boolean withPrivate, Boolean withVolatile) { + super("GetNode"); + if (giveOpennetRef != null) { + setField("GiveOpennetRef", String.valueOf(giveOpennetRef)); + } + if (withPrivate != null) { + setField("WithPrivate", String.valueOf(withPrivate)); + } + if (withVolatile != null) { + setField("WithVolatile", String.valueOf(withVolatile)); + } + } + +}