private String signature;
/**
+ * Creates a new, empty noderef.
+ */
+ public NodeRef() {
+ }
+
+ /**
+ * Creates a new noderef that is initialized with fields from the given
+ * message.
+ *
+ * @param fromMessage
+ * The message to get initial values for the noderef from
+ */
+ public NodeRef(FcpMessage fromMessage) {
+ identity = fromMessage.getField("identity");
+ opennet = Boolean.valueOf(fromMessage.getField("opennet"));
+ name = fromMessage.getField("myName");
+ if (fromMessage.hasField("location")) {
+ location = Double.valueOf(fromMessage.getField("location"));
+ }
+ physicalUDP = fromMessage.getField("physical.udp");
+ ark = new ARK(fromMessage.getField("ark.pubURI"), fromMessage.getField("ark.privURI"), fromMessage.getField("ark.number"));
+ dsaPublicKey = fromMessage.getField("dsaPubKey.y");
+ dsaGroup = new DSAGroup(fromMessage.getField("dsaGroup.b"), fromMessage.getField("dsaGroup.p"), fromMessage.getField("dsaGroup.q"));
+ negotiationTypes = FcpUtils.decodeMultiIntegerField(fromMessage.getField("auth.negTypes"));
+ version = new Version(fromMessage.getField("version"));
+ lastGoodVersion = new Version(fromMessage.getField("lastGoodVersion"));
+ testnet = Boolean.valueOf(fromMessage.getField("testnet"));
+ signature = fromMessage.getField("sig");
+ }
+
+ /**
* Returns the identity of the node.
*
* @return The identity of the node
*
* @return The ARK of the node
*/
- public ARK getArk() {
+ public ARK getARK() {
return ark;
}
* @param ark
* The ARK of the node
*/
- public void setArk(ARK ark) {
+ public void setARK(ARK ark) {
this.ark = ark;
}