[907] | 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 |
|
---|
| 22 | using System;
|
---|
[800] | 23 | using System.Collections.Generic;
|
---|
| 24 | using System.Linq;
|
---|
| 25 | using System.Text;
|
---|
| 26 | using HeuristicLab.Hive.Contracts.Interfaces;
|
---|
| 27 | using HeuristicLab.Hive.Contracts.BusinessObjects;
|
---|
[902] | 28 | using HeuristicLab.Hive.Contracts;
|
---|
[800] | 29 |
|
---|
| 30 | namespace HeuristicLab.Hive.Server.Core {
|
---|
| 31 | public class ServerConsoleFacade: IServerConsoleFacade {
|
---|
| 32 | private IClientManager clientManager = new ClientManager();
|
---|
[821] | 33 | private IJobManager jobManager = new JobManager();
|
---|
| 34 | private IUserRoleManager userRoleManager = new UserRoleManager();
|
---|
[800] | 35 |
|
---|
| 36 | #region IClientManager Members
|
---|
| 37 |
|
---|
[902] | 38 | public ResponseList<ClientInfo> GetAllClients() {
|
---|
[800] | 39 | return clientManager.GetAllClients();
|
---|
| 40 | }
|
---|
| 41 |
|
---|
[902] | 42 | public ResponseList<ClientGroup> GetAllClientGroups() {
|
---|
[800] | 43 | return clientManager.GetAllClientGroups();
|
---|
| 44 | }
|
---|
| 45 |
|
---|
[902] | 46 | public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() {
|
---|
[800] | 47 | return clientManager.GetAllUpTimeStatistics();
|
---|
| 48 | }
|
---|
| 49 |
|
---|
[934] | 50 | public Response AddClientGroup(ClientGroup clientGroup) {
|
---|
| 51 | return clientManager.AddClientGroup(clientGroup);
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | public Response AddResourceToGroup(long clientGroupId, Resource resource) {
|
---|
| 55 | return clientManager.AddResourceToGroup(clientGroupId, resource);
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | public Response DeleteResourceFromGroup(long clientGroupId, long resourceId) {
|
---|
| 59 | return clientManager.DeleteResourceFromGroup(clientGroupId, resourceId);
|
---|
| 60 | }
|
---|
| 61 |
|
---|
[800] | 62 | #endregion
|
---|
| 63 |
|
---|
| 64 | #region IJobManager Members
|
---|
| 65 |
|
---|
[902] | 66 | public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetAllJobs() {
|
---|
[821] | 67 | return jobManager.GetAllJobs();
|
---|
[800] | 68 | }
|
---|
[967] | 69 | public ResponseObject<Job> AddNewJob(Job job) {
|
---|
[1012] | 70 | return jobManager.AddNewJob(job);
|
---|
[967] | 71 | }
|
---|
[800] | 72 |
|
---|
[967] | 73 | public Response RemoveJob(long jobId) {
|
---|
[1012] | 74 | return jobManager.RemoveJob(jobId);
|
---|
[967] | 75 | }
|
---|
| 76 |
|
---|
[800] | 77 | #endregion
|
---|
| 78 |
|
---|
| 79 | #region IUserRoleManager Members
|
---|
| 80 |
|
---|
[902] | 81 | public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.User> GetAllUsers() {
|
---|
[821] | 82 | return userRoleManager.GetAllUsers();
|
---|
[800] | 83 | }
|
---|
| 84 |
|
---|
[952] | 85 | public ResponseObject<User> AddNewUser(User user) {
|
---|
[902] | 86 | return userRoleManager.AddNewUser(user);
|
---|
[842] | 87 | }
|
---|
| 88 |
|
---|
[952] | 89 | public ResponseList<UserGroup> GetAllUserGroups() {
|
---|
[821] | 90 | return userRoleManager.GetAllUserGroups();
|
---|
[800] | 91 | }
|
---|
| 92 |
|
---|
[902] | 93 | public Response RemoveUser(long userId) {
|
---|
[934] | 94 | return userRoleManager.RemoveUser(userId);
|
---|
[902] | 95 | }
|
---|
| 96 |
|
---|
[952] | 97 | public ResponseObject<UserGroup> AddNewUserGroup(UserGroup userGroup) {
|
---|
[934] | 98 | return userRoleManager.AddNewUserGroup(userGroup);
|
---|
[902] | 99 | }
|
---|
| 100 |
|
---|
| 101 | public Response RemoveUserGroup(long groupId) {
|
---|
[934] | 102 | return userRoleManager.RemoveUserGroup(groupId);
|
---|
[902] | 103 | }
|
---|
| 104 |
|
---|
[945] | 105 | public Response AddUserToGroup(long groupId, long userId) {
|
---|
| 106 | return userRoleManager.AddUserToGroup(groupId, userId);
|
---|
[902] | 107 | }
|
---|
| 108 |
|
---|
[945] | 109 | public Response AddUserGroupToGroup(long groupId, long groupToAddId) {
|
---|
| 110 | return userRoleManager.AddUserGroupToGroup(groupId, groupToAddId);
|
---|
| 111 | }
|
---|
| 112 |
|
---|
[934] | 113 | public Response RemovePermissionOwnerFromGroup(long groupId, long userId) {
|
---|
| 114 | return userRoleManager.RemovePermissionOwnerFromGroup(groupId, userId);
|
---|
[902] | 115 | }
|
---|
| 116 |
|
---|
[800] | 117 | #endregion
|
---|
[967] | 118 |
|
---|
[800] | 119 | }
|
---|
| 120 | }
|
---|