Free cookie consent management tool by TermsFeed Policy Generator

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

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

Client Groups in dummy Implementation (#395)

File size: 1.5 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.Add(c1);     
28      cg.Resources.Add(c2);
29      cg.Resources.Add(c3);
30
31      clientGroups.Add(cg);
32    }
33
34    #region IClientManager Members
35
36    public List<ClientInfo> GetAllClients() {
37      return clients;
38    }
39
40    public List<ClientGroup> GetAllClientGroups() {
41      return clientGroups;
42    }
43
44    public List<UpTimeStatistics> GetAllUpTimeStatistics() {
45      return new List<UpTimeStatistics>();
46    }
47
48    #endregion
49  }
50}
Note: See TracBrowser for help on using the repository browser.