create id in constructor
[jSite2.git] / src / net / pterodactylus / jsite / core / Node.java
index 5a8ec89..bb61ee9 100644 (file)
@@ -21,7 +21,9 @@ package net.pterodactylus.jsite.core;
 
 import java.beans.PropertyChangeListener;
 
+import net.pterodactylus.jsite.util.IdGenerator;
 import net.pterodactylus.util.beans.AbstractBean;
+import net.pterodactylus.util.number.Hex;
 
 /**
  * Container for a Freenet node. A Node is capable of notifying
@@ -53,6 +55,13 @@ public class Node extends AbstractBean {
        private int port;
 
        /**
+        * Creates a new node.
+        */
+       public Node() {
+               id = Hex.toHex(IdGenerator.generateId());
+       }
+
+       /**
         * Returns the internal ID of the node.
         * 
         * @return The internal ID of the node