1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Hive.Contracts.Interfaces;
|
---|
6 | using HeuristicLab.Hive.Contracts.BusinessObjects;
|
---|
7 |
|
---|
8 | namespace 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(), Name="Client1", CpuSpeedPerCore=2500, Memory=4096, ResourceId=1, State=State.idle };
|
---|
19 | ClientInfo c2 = new ClientInfo { ClientId=Guid.NewGuid(), Name="Client2", CpuSpeedPerCore=2100, Memory=2048, ResourceId=2, State=State.idle };
|
---|
20 | ClientInfo c3 = new ClientInfo { ClientId = Guid.NewGuid(), Name="Client3", 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 | }
|
---|