2 * © 2008 INA Service GmbH
4 package net.pterodactylus.util.fcp;
7 * A reference for a node. The noderef contains all data that is necessary to
8 * establish a trusted and secure connection to the node.
10 * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
13 public class NodeRef {
15 /** The identity of the node. */
16 private String identity;
18 /** Whether the node is an opennet peer. */
19 private boolean opennet;
21 /** The name of the node. */
24 /** The location of the node. */
25 private double location;
27 /** The IP addresses and ports of the node. */
28 private String physicalUDP;
30 /** The ARK of the node. */
33 /** The public DSA key of the node. */
34 private String dsaPublicKey;
36 /** The DSA group of the node. */
37 private DSAGroup dsaGroup;
39 /** The node’s supported negotiation types. */
40 private int[] negotiationTypes;
42 /** The version of the node. */
43 private Version version;
45 /** The oldest version the node will connect to. */
46 private Version lastGoodVersion;
48 /** Whether the node is a testnet node. */
49 private boolean testnet;
51 /** The signature of the reference. */
52 private String signature;
55 * Returns the identity of the node.
57 * @return The identity of the node
59 public String getIdentity() {
64 * Sets the identity of the node.
67 * The identity of the node
69 public void setIdentity(String identity) {
70 this.identity = identity;
74 * Returns whether the node is an opennet peer.
76 * @return <code>true</code> if the node is an opennet peer,
77 * <code>false</code> otherwise
79 public boolean isOpennet() {
84 * Sets whether the node is an opennet peer.
87 * <code>true</code> if the node is an opennet peer,
88 * <code>false</code> otherwise
90 public void setOpennet(boolean opennet) {
91 this.opennet = opennet;
95 * Returns the name of the node. If the node is an opennet peer, it will not
98 * @return The name of the node, or <code>null</code> if the node is an
101 public String getName() {
106 * Sets the name of the peer.
109 * The name of the peer
111 public void setName(String name) {
116 * Returns the location of the node.
118 * @return The location of the node
120 public double getLocation() {
125 * Sets the location of the node
128 * The location of the node
130 public void setLocation(double location) {
131 this.location = location;
135 * Returns the IP addresses and port numbers of the node.
137 * @return The IP addresses and port numbers of the node
139 public String getPhysicalUDP() {
144 * Sets the IP addresses and port numbers of the node.
147 * The IP addresses and port numbers of the node
149 public void setPhysicalUDP(String physicalUDP) {
150 this.physicalUDP = physicalUDP;
154 * Returns the ARK of the node.
156 * @return The ARK of the node
158 public ARK getArk() {
163 * Sets the ARK of the node.
166 * The ARK of the node
168 public void setArk(ARK ark) {
173 * Returns the public DSA key of the node.
175 * @return The public DSA key of the node
177 public String getDSAPublicKey() {
182 * Sets the public DSA key of the node.
184 * @param dsaPublicKey
185 * The public DSA key of the node
187 public void setDSAPublicKey(String dsaPublicKey) {
188 this.dsaPublicKey = dsaPublicKey;
192 * Returns the DSA group of the node.
194 * @return The DSA group of the node
196 public DSAGroup getDSAGroup() {
201 * Sets the DSA group of the node.
204 * The DSA group of the node
206 public void setDSAGroup(DSAGroup dsaGroup) {
207 this.dsaGroup = dsaGroup;
211 * Returns the negotiation types supported by the node.
213 * @return The node’s supported negotiation types
215 public int[] getNegotiationTypes() {
216 return negotiationTypes;
220 * Sets the negotiation types supported by the node.
222 * @param negotiationTypes
223 * The node’s supported negotiation types
225 public void setNegotiationTypes(int[] negotiationTypes) {
226 this.negotiationTypes = negotiationTypes;
230 * Returns the version of the node.
232 * @return The version of the node
234 public Version getVersion() {
239 * Sets the version of the node.
242 * The version of the node
244 public void setVersion(Version version) {
245 this.version = version;
249 * Returns the last good version of the node.
251 * @return The oldest version the node will connect to
253 public Version getLastGoodVersion() {
254 return lastGoodVersion;
258 * Sets the last good version of the node.
260 * @param lastGoodVersion
261 * The oldest version the node will connect to
263 public void setLastGoodVersion(Version lastGoodVersion) {
264 this.lastGoodVersion = lastGoodVersion;
268 * Returns whether the node is a testnet node.
270 * @return <code>true</code> if the node is a testnet node,
271 * <code>false</code> otherwise
273 public boolean isTestnet() {
278 * Sets whether this node is a testnet node.
281 * <code>true</code> if the node is a testnet node,
282 * <code>false</code> otherwise
284 public void setTestnet(boolean testnet) {
285 this.testnet = testnet;
289 * Returns the signature of the noderef.
291 * @return The signature of the noderef
293 public String getSignature() {
298 * Sets the signature of the noderef.
301 * The signature of the noderef
303 public void setSignature(String signature) {
304 this.signature = signature;