implement node addition and removal events
[jSite2.git] / src / net / pterodactylus / util / fcp / GetNode.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp;
5
6 /**
7  * The “GetNode” command returns the darknet or opennet noderef of the node,
8  * optionally including private and volatile data.
9  * 
10  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
11  * @version $Id$
12  */
13 public class GetNode extends FcpMessage {
14
15         /**
16          * Creates a “GetNode” command that returns the darknet noderef of the node.
17          */
18         public GetNode() {
19                 this(null, null, null);
20         }
21
22         /**
23          * Creates a “GetNode” command that returns the request noderef of the node,
24          * including private and volatile data, if requested. If any of the Boolean
25          * parameters are <code>null</code> the parameter is ignored and the
26          * node’s default value is used.
27          * 
28          * @param giveOpennetRef
29          *            <code>true</code> to request the opennet noderef,
30          *            <code>false</code> for darknet
31          * @param withPrivate
32          *            <code>true</code> to include private data in the noderef
33          * @param withVolatile
34          *            <code>true</code> to include volatile data in the noderef
35          */
36         public GetNode(Boolean giveOpennetRef, Boolean withPrivate, Boolean withVolatile) {
37                 super("GetNode");
38                 if (giveOpennetRef != null) {
39                         setField("GiveOpennetRef", String.valueOf(giveOpennetRef));
40                 }
41                 if (withPrivate != null) {
42                         setField("WithPrivate", String.valueOf(withPrivate));
43                 }
44                 if (withVolatile != null) {
45                         setField("WithVolatile", String.valueOf(withVolatile));
46                 }
47         }
48
49 }