Ejemplo n.º 1
0
 public Form1(ClientNode client)
 {
     _client = client;
     InitializeComponent();
     button1.Enabled = false;
     button2.Enabled = false;
 }
Ejemplo n.º 2
0
        public ClientNode CreateNode(ClientNode clientNode)
        {
            DbNode dbNode = new DbNode();

            // mapping

            dbNode = Post("api/graph/node", dbNode).Result;

            // mapping

            return(clientNode);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var parser = new ArgumentParser(OptionSetPool.ClientOptionsSet);

            parser.ProcessArguments(args);
            parser.UpdateConfiguration(parser.map);

            IClusterClient clusterClient = ClusterClientFactory.Factory.Create(
                Properties.Settings.Default.Address, Properties.Settings.Default.Port);
            var core = ClientNodeProcessingModuleFactory.Factory.Create();
            IMessageArrayCreator creator = new MessageArrayCreator();

            ClientNode clientNode = new ClientNode(clusterClient, core, creator);

            clientNode.Run();
        }
Ejemplo n.º 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ClientNode client = new ClientNode();

            ReadConfig rd = new ReadConfig();

            client = rd.ReadHostConfig();

            Form1 form1 = new Form1(client);

            form1.Text = client.name;
            form1.hostsIp(client.hostsIP);
            Task.Run(() => client.start(form1));

            Application.Run(form1);
        }
Ejemplo n.º 5
0
        public ClientNode ReadHostConfig()
        {
            XmlTextReader reader = null;

            try{
                var content = Environment.GetCommandLineArgs()[1];
                reader = new XmlTextReader(content);
            }catch {
                reader = new XmlTextReader("..\\..\\..\\..\\Config\\host1.xml");
            }

            //    var content = Environment.GetCommandLineArgs()[1];
            //   XmlTextReader reader = new XmlTextReader(content);
            //XmlTextReader reader = new XmlTextReader("..\\..\\..\\..\\Config\\host2.xml");

            while (reader.Read())
            {
                if (reader.Name.Equals("Host1"))
                {
                    reader.Read();
                    table3[0] = reader.Value;
                    reader.Read();
                }
                else if (reader.Name.Equals("Host2"))
                {
                    reader.Read();
                    table3[1] = reader.Value;
                    reader.Read();
                }
                else if (reader.Name.Equals("Host3"))
                {
                    reader.Read();
                    table3[2] = reader.Value;
                    reader.Read();
                }
                else if (reader.Name.Equals("Host4"))
                {
                    reader.Read();
                    table3[3] = reader.Value;
                    reader.Read();
                }
                else if (reader.Name.Equals("cloudPort"))
                {
                    reader.Read();
                    Int32.TryParse(reader.Value, out table[2]);
                    reader.Read();
                }
                else if (reader.Name.Equals("hostName"))
                {
                    reader.Read();
                    table4[0] = reader.Value;
                    reader.Read();
                }
                else if (reader.Name.Equals("addressIP"))
                {
                    reader.Read();
                    Console.WriteLine(reader.Value);
                    table4[1] = reader.Value;
                    reader.Read();
                }
                else if (reader.Name.Equals("outPort"))
                {
                    reader.Read();
                    Int32.TryParse(reader.Value, out table[3]);
                    reader.Read();
                }
                else if (reader.Name.Equals("cloudIP"))
                {
                    reader.Read();
                    table4[2] = reader.Value;
                    reader.Read();
                }
            }
            ClientNode cn = new ClientNode(table4[2], table[2], table4[1], table4[0], table[3]);

            cn.fillTable(table3);
            reader.Close();
            return(cn);
        }
Ejemplo n.º 6
0
        public void UpdateNode(ClientNode clientNode)
        {
            var url = $"api/graph/node/{clientNode.Id}";

            Put(url, clientNode);
        }