public void join() {
        if (!isOnline) {
            isOnline = true;
            System.out.println("Input IP-address of active node");
            System.out.println("If it is the first online node input 127.0.0.1");
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String ipAddress = null;
            try {
                ipAddress = br.readLine();
            } catch (IOException e) {
                System.out.println("IO error!");
                System.exit(1);
            }
            if (!ipAddress.equals("127.0.0.1")) {
                firstActiveNode = ipAddress;
                getListOfEvents(true);
                XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
                try {
                    config.setServerURL(new URL(stringToURL(firstActiveNode)));
                } catch (MalformedURLException e) {
                    e.printStackTrace();
                }
                XmlRpcClient client = new XmlRpcClient();
                client.setConfig(config);

                Object[] params = new Object[] {};
                try {
                    Object[] listOfNodes =
                            (Object[]) client.execute("Node.getListOfActiveNode", params);

                    for (int i = 0; i < listOfNodes.length; i++) {
                        activeNodes.add(listOfNodes[i].toString());
                    }
                } catch (XmlRpcException e) {
                    e.printStackTrace();
                }
                for (String s:activeNodes) {
                    joinOverRPC(s);
                }
            } else {
                isOnline = true;
            }
        } else  {
            System.out.println("Node is already online.");
        }
    }