Free cookie consent management tool by TermsFeed Policy Generator

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

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

Implementation of UserRoleManager (#417)

File size: 3.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Linq;
25using System.Text;
26using HeuristicLab.Hive.Contracts.Interfaces;
27using HeuristicLab.Hive.Contracts.BusinessObjects;
28using HeuristicLab.Hive.Contracts;
29using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
30
31namespace HeuristicLab.Hive.Server.Core {
32  class ClientManager: IClientManager {
33
34    IClientAdapter clientAdapter;
35    IClientGroupAdapter clientGroupAdapter;
36
37    List<ClientGroup> clientGroups;
38
39    public ClientManager() {
40      clientAdapter = ServiceLocator.GetClientAdapter();
41      clientGroupAdapter = ServiceLocator.GetClientGroupAdapter();
42
43      clientGroups = new List<ClientGroup>();
44
45      ClientGroup cg = new ClientGroup { ResourceId = 4, Name = "SuperGroup" };
46      cg.Resources = new List<Resource>();
47
48      clientGroups.Add(cg);
49    }
50
51    #region IClientManager Members
52
53    public ResponseList<ClientInfo> GetAllClients() {
54      ResponseList<ClientInfo> response = new ResponseList<ClientInfo>();
55
56      response.List = new List<ClientInfo>(clientAdapter.GetAllClients());
57      response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_ALL_CLIENTS;
58      response.Success = true;
59
60      return response;
61    }
62
63    public ResponseList<ClientGroup> GetAllClientGroups() {
64      ResponseList<ClientGroup> response = new ResponseList<ClientGroup>();
65
66      response.List = new List<ClientGroup>(clientGroupAdapter.GetAllClientGroups());
67      response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_ALL_CLIENTGROUPS;
68      response.Success = true;
69
70      return response;
71    }
72
73    public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() {
74      ResponseList<UpTimeStatistics> response = new ResponseList<UpTimeStatistics>();
75      response.Success = true;
76      return response;
77    }
78
79    public Response AddClientGroup(ClientGroup clientGroup) {
80      Response response = new Response();
81
82      ClientGroup clientGroupFromDb = clientGroupAdapter.GetClientGroupById(clientGroup.ResourceId);
83     
84
85      return response;
86    }
87
88    public Response AddResourceToGroup(long clientGroupId, Resource resource) {
89      throw new NotImplementedException();
90    }
91
92    public Response DeleteResourceFromGroup(long clientGroupId, long resourceId) {
93      throw new NotImplementedException();
94    }
95    #endregion
96  }
97}
Note: See TracBrowser for help on using the repository browser.