Esempio n. 1
0
 internal NodeCertificate Save(NodeCertificate cert)
 {
     cert.Id = IdManager.GetId();
     using (dbc = DAL.Instance.GetDb())
         dbc.Insert(cert);
     return(cert);
 }
Esempio n. 2
0
File: Hub.cs Progetto: radtek/BackO
        private PeerNode CreateNewNode(string ip, NodeCertificate cert)
        {
            var node = new PeerNode();

            node.Name   = Dns.GetHostEntry(ip).HostName;
            node.IP     = ip;
            node.Locked = true;
            node.Status = NodeStatus.New;
            node        = new DAL.NodeDAO().Save(node);
            cert.NodeId = node.Id;
            cert        = new DAL.CertificateDAO().Save(cert);
            Logger.Append("HUBRN", Severity.INFO, "Created new node #" + node.Id + " with cert #" + cert.Id + " for client " + ip);
            return(node);
        }