Changeset 1121
- Timestamp:
- 01/14/09 16:16:21 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs ¶
r1118 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
TabularUnified trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/HeartBeatData.cs ¶
r1119 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
TabularUnified trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs ¶
r999 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
TabularUnified trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/ITransactionManager.cs ¶
r948 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
TabularUnified trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs ¶
r1011 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
TabularUnified trunk/sources/HeuristicLab.Hive.Contracts/ResponseHB.cs ¶
r783 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
TabularUnified trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs ¶
r1120 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 18 39 /// </summary> 19 40 public class ClientCommunicator: IClientCommunicator { 20 int nrOfJobs = 0;21 41 Dictionary<Guid, DateTime> lastHeartbeats = 22 42 new Dictionary<Guid,DateTime>(); … … 27 47 ILifecycleManager lifecycleManager; 28 48 49 /// <summary> 50 /// Initialization of the Adapters to the database 51 /// Initialization of Eventhandler for the lifecycle management 52 /// Initialization of lastHearbeats Dictionary 53 /// </summary> 29 54 public ClientCommunicator() { 30 55 clientAdapter = ServiceLocator.GetClientAdapter(); … … 36 61 new EventHandler(lifecycleManager_OnServerHeartbeat); 37 62 38 for (int i = 0; i < nrOfJobs; i++) {39 Job job = new Job();40 job.Id = i;41 job.State = State.offline;42 jobAdapter.Update(job);43 }44 63 lastHeartbeats = new Dictionary<Guid, DateTime>(); 45 46 } 47 64 } 65 66 /// <summary> 67 /// Check if online clients send their hearbeats 68 /// if not -> set them offline and check if they where calculating a job 69 /// </summary> 70 /// <param name="sender"></param> 71 /// <param name="e"></param> 48 72 [MethodImpl(MethodImplOptions.Synchronized)] 49 73 void lifecycleManager_OnServerHeartbeat(object sender, EventArgs e) { … … 89 113 #region IClientCommunicator Members 90 114 115 /// <summary> 116 /// Login process for the client 117 /// A hearbeat entry is created as well (login is the first hearbeat) 118 /// </summary> 119 /// <param name="clientInfo"></param> 120 /// <returns></returns> 91 121 [MethodImpl(MethodImplOptions.Synchronized)] 92 122 public Response Login(ClientInfo clientInfo) { … … 114 144 } 115 145 146 /// <summary> 147 /// The client has to send regulary heartbeats 148 /// this hearbeats will be stored in the heartbeats dictionary 149 /// check if there is work for the client and send the client a response if he should pull a job 150 /// </summary> 151 /// <param name="hbData"></param> 152 /// <returns></returns> 116 153 [MethodImpl(MethodImplOptions.Synchronized)] 117 154 public ResponseHB SendHeartBeat(HeartBeatData hbData) { … … 143 180 return response; 144 181 } 145 182 183 /// <summary> 184 /// if the client asked to pull a job he calls this method 185 /// the server selects a job and sends it to the client 186 /// </summary> 187 /// <param name="clientId"></param> 188 /// <returns></returns> 146 189 [MethodImpl(MethodImplOptions.Synchronized)] 147 190 public ResponseJob PullJob(Guid clientId) { … … 164 207 } 165 208 209 /// <summary> 210 /// the client can send job results during calculating 211 /// and will send a final job result when he finished calculating 212 /// these job results will be stored in the database 213 /// </summary> 214 /// <param name="clientId"></param> 215 /// <param name="jobId"></param> 216 /// <param name="result"></param> 217 /// <param name="exception"></param> 218 /// <param name="finished"></param> 219 /// <returns></returns> 166 220 [MethodImpl(MethodImplOptions.Synchronized)] 167 221 public ResponseResultReceived SendJobResult(Guid clientId, … … 211 265 } 212 266 267 /// <summary> 268 /// when a client logs out the state will be set 269 /// and the entry in the last hearbeats dictionary will be removed 270 /// </summary> 271 /// <param name="clientId"></param> 272 /// <returns></returns> 213 273 [MethodImpl(MethodImplOptions.Synchronized)] 214 274 public Response Logout(Guid clientId) { -
TabularUnified trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs ¶
r995 r1121 51 51 #region IClientManager Members 52 52 53 /// <summary> 54 /// Returns all clients stored in the database 55 /// </summary> 56 /// <returns></returns> 53 57 public ResponseList<ClientInfo> GetAllClients() { 54 58 ResponseList<ClientInfo> response = new ResponseList<ClientInfo>(); … … 61 65 } 62 66 67 /// <summary> 68 /// returns all client groups stored in the database 69 /// </summary> 70 /// <returns></returns> 63 71 public ResponseList<ClientGroup> GetAllClientGroups() { 64 72 ResponseList<ClientGroup> response = new ResponseList<ClientGroup>(); … … 77 85 } 78 86 87 /// <summary> 88 /// Add a client group into the database 89 /// </summary> 90 /// <param name="clientGroup"></param> 91 /// <returns></returns> 79 92 public Response AddClientGroup(ClientGroup clientGroup) { 80 93 Response response = new Response(); … … 92 105 } 93 106 107 /// <summary> 108 /// Add a resource to a group 109 /// </summary> 110 /// <param name="clientGroupId"></param> 111 /// <param name="resource"></param> 112 /// <returns></returns> 94 113 public Response AddResourceToGroup(long clientGroupId, Resource resource) { 95 114 Response response = new Response(); … … 115 134 } 116 135 136 /// <summary> 137 /// Remove a resource from a group 138 /// </summary> 139 /// <param name="clientGroupId"></param> 140 /// <param name="resourceId"></param> 141 /// <returns></returns> 117 142 public Response DeleteResourceFromGroup(long clientGroupId, long resourceId) { 118 143 Response response = new Response(); -
TabularUnified trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs ¶
r1120 r1121 40 40 } 41 41 42 /// <summary> 43 /// returns all jobs stored in the database 44 /// </summary> 45 /// <returns></returns> 42 46 public ResponseList<Job> GetAllJobs() { 43 47 ResponseList<Job> response = new ResponseList<Job>(); … … 50 54 } 51 55 56 /// <summary> 57 /// Adds a new job into the database 58 /// </summary> 59 /// <param name="job"></param> 60 /// <returns></returns> 52 61 public ResponseObject<Job> AddNewJob(Job job) { 53 62 ResponseObject<Job> response = new ResponseObject<Job>(); … … 82 91 } 83 92 93 /// <summary> 94 /// Removes a job from the database 95 /// </summary> 96 /// <param name="jobId"></param> 97 /// <returns></returns> 84 98 public Response RemoveJob(long jobId) { 85 99 Response response = new Response(); -
TabularUnified trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs ¶
r995 r1121 1 using System; 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; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 24 45 #region IUserRoleManager Members 25 46 47 /// <summary> 48 /// returns all users from the database 49 /// </summary> 50 /// <returns></returns> 26 51 public ResponseList<User> GetAllUsers() { 27 52 ResponseList<User> response = new ResponseList<User>(); … … 35 60 } 36 61 62 /// <summary> 63 /// Adds a new user to the database 64 /// </summary> 65 /// <param name="user"></param> 66 /// <returns></returns> 37 67 public ResponseObject<User> AddNewUser(User user) { 38 68 ResponseObject<User> response = new ResponseObject<User>(); … … 57 87 } 58 88 89 /// <summary> 90 /// returns all usergroups from the database 91 /// </summary> 92 /// <returns></returns> 59 93 public ResponseList<UserGroup> GetAllUserGroups() { 60 94 ResponseList<UserGroup> response = new ResponseList<UserGroup>(); … … 67 101 } 68 102 103 /// <summary> 104 /// Removes a user from the database 105 /// </summary> 106 /// <param name="userId"></param> 107 /// <returns></returns> 69 108 public Response RemoveUser(long userId) { 70 109 Response response = new Response(); … … 82 121 } 83 122 123 /// <summary> 124 /// Adds a new usergroup to the database 125 /// </summary> 126 /// <param name="userGroup"></param> 127 /// <returns></returns> 84 128 public ResponseObject<UserGroup> AddNewUserGroup(UserGroup userGroup) { 85 129 ResponseObject<UserGroup> response = new ResponseObject<UserGroup>(); … … 99 143 } 100 144 145 /// <summary> 146 /// Removes a user group from the database 147 /// </summary> 148 /// <param name="groupId"></param> 149 /// <returns></returns> 101 150 public Response RemoveUserGroup(long groupId) { 102 151 Response response = new Response(); … … 115 164 } 116 165 166 /// <summary> 167 /// Adds a user into a user group 168 /// </summary> 169 /// <param name="groupId"></param> 170 /// <param name="userId"></param> 171 /// <returns></returns> 117 172 public Response AddUserToGroup(long groupId, long userId) { 118 173 Response response = new Response(); … … 140 195 } 141 196 197 /// <summary> 198 /// Adds a user group to a user group 199 /// </summary> 200 /// <param name="groupId"></param> 201 /// <param name="groupToAddId"></param> 202 /// <returns></returns> 142 203 public Response AddUserGroupToGroup(long groupId, long groupToAddId) { 143 204 Response response = new Response(); … … 158 219 } 159 220 221 /// <summary> 222 /// Removes a permission owner (user, user group) from a user group 223 /// </summary> 224 /// <param name="groupId"></param> 225 /// <param name="permissionOwnerId"></param> 226 /// <returns></returns> 160 227 public Response RemovePermissionOwnerFromGroup(long groupId, long permissionOwnerId) { 161 228 Response response = new Response();
Note: See TracChangeset
for help on using the changeset viewer.