public IProperties Register(IProperties properties) { lock (mGroups) { TestProperties tp = new TestProperties(); tp.FromHeaders(properties.ToHeaders()); Group group = mGroups.Find(e => e.Name == tp.Group); if (group == null) { group = new Group(); group.Name = tp.Group; group.Nodes = new List <Node>(); group.Nodes.Add(new Node { Name = tp.Node, Host = tp.Host, Port = tp.Port, LastTrackTime = DateTime.Now }); mGroups.Add(group); } else { Node node = group.Nodes.Find(n => n.Name == tp.Node); if (node != null) { node.LastTrackTime = DateTime.Now; } else { group.Nodes.Add(new Node { Name = tp.Node, Host = tp.Host, Port = tp.Port, LastTrackTime = DateTime.Now }); } } return(new Properties()); } }
public IProperties Register(IProperties properties) { lock (mGroups) { TestProperties tp = new TestProperties(); tp.FromHeaders(properties.ToHeaders()); Group group = mGroups.Find(e => e.Name == tp.Group); if (group == null) { group = new Group(); group.Name = tp.Group; group.Nodes = new List<Node>(); group.Nodes.Add(new Node { Name = tp.Node, Host = tp.Host, Port = tp.Port, LastTrackTime=DateTime.Now }); mGroups.Add(group); } else { Node node = group.Nodes.Find(n => n.Name== tp.Node ); if(node !=null) node.LastTrackTime = DateTime.Now; else group.Nodes.Add(new Node { Name = tp.Node, Host = tp.Host, Port = tp.Port, LastTrackTime = DateTime.Now }); } return new Properties(); } }
public TrackerInfo GetInfo(IProperties properties) { TrackerInfo result = new TrackerInfo(); result.TypeName = "Beetle.Tracker.TestImpl.Group,Beetle.Tracker.TestImpl"; TestProperties tp = new TestProperties(); tp.FromHeaders(properties.ToHeaders()); Group group = mGroups.Find(e => e.Name == tp.Group); if (group == null) return null; result.Data= Formater.ToStringValue(group); return result; }
public TrackerInfo GetInfo(IProperties properties) { TrackerInfo result = new TrackerInfo(); result.TypeName = "Beetle.Tracker.TestImpl.Group,Beetle.Tracker.TestImpl"; TestProperties tp = new TestProperties(); tp.FromHeaders(properties.ToHeaders()); Group group = mGroups.Find(e => e.Name == tp.Group); if (group == null) { return(null); } result.Data = Formater.ToStringValue(group); return(result); }