Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs @ 829

Last change on this file since 829 was 829, checked in by msteinbi, 16 years ago

Client Groups in dummy Implementation (#395)

File size: 1.6 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Hive.Contracts.Interfaces;
6using HeuristicLab.Hive.Contracts.BusinessObjects;
7
8namespace HeuristicLab.Hive.Server.Core {
9  class ClientManager: IClientManager {
10
11    List<ClientInfo> clients;
12    List<ClientGroup> clientGroups;
13
14    public ClientManager() {
15      clients = new List<ClientInfo>();
16      clientGroups = new List<ClientGroup>();
17
18      ClientInfo c1 = new ClientInfo { ClientId=Guid.NewGuid(), CpuSpeedPerCore=2500, Memory=4096, ResourceId=1, State=State.idle };
19      ClientInfo c2 = new ClientInfo { ClientId=Guid.NewGuid(), CpuSpeedPerCore=2100, Memory=2048, ResourceId=2, State=State.idle };
20      ClientInfo c3 = new ClientInfo { ClientId = Guid.NewGuid(), CpuSpeedPerCore = 3400, Memory = 4096, ResourceId = 3, State = State.calculating };
21
22      clients.Add(c1);
23      clients.Add(c2);
24      clients.Add(c3);
25
26      ClientGroup cg = new ClientGroup { ResourceId = 4, Name = "SuperGroup", ClientGroupId = 1 };
27      cg.Resources = new List<Resource>();
28      cg.Resources.Add(c1);     
29      cg.Resources.Add(c2);
30      cg.Resources.Add(c3);
31
32      clientGroups.Add(cg);
33    }
34
35    #region IClientManager Members
36
37    public List<ClientInfo> GetAllClients() {
38      return clients;
39    }
40
41    public List<ClientGroup> GetAllClientGroups() {
42      return clientGroups;
43    }
44
45    public List<UpTimeStatistics> GetAllUpTimeStatistics() {
46      return new List<UpTimeStatistics>();
47    }
48
49    #endregion
50  }
51}
Note: See TracBrowser for help on using the repository browser.