implement node addition and removal events
[jSite2.git] / src / net / pterodactylus / util / fcp / ModifyPeer.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp;
5
6 /**
7  * The “ModifyPeer” request lets you modify certain properties of a peer.
8  * 
9  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
10  * @version $Id$
11  */
12 public class ModifyPeer extends FcpMessage {
13
14         /**
15          * Creates a new “ModifyPeer” request. All Boolean parameters may be null to
16          * not influence the current setting.
17          * 
18          * @param nodeIdentifier
19          *            The identifier of the node, i.e. name, identity, or IP address
20          *            and port
21          * @param allowLocalAddresses
22          *            Whether to allow local addresses from this node
23          * @param disabled
24          *            Whether the node is disabled
25          * @param listenOnly
26          *            Whether your node should not try to connect the node
27          */
28         public ModifyPeer(String nodeIdentifier, Boolean allowLocalAddresses, Boolean disabled, Boolean listenOnly) {
29                 super("ModifyPeer");
30                 setField("NodeIdentifier", nodeIdentifier);
31                 if (allowLocalAddresses != null) {
32                         setField("AllowLocalAddresses", String.valueOf(allowLocalAddresses));
33                 }
34                 if (disabled != null) {
35                         setField("IsDisabled", String.valueOf(disabled));
36                 }
37                 if (listenOnly != null) {
38                         setField("IsListenOnly", String.valueOf(listenOnly));
39                 }
40         }
41
42 }