Index: /trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
Index: /trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/HeartBeatData.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/HeartBeatData.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/HeartBeatData.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
Index: /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
Index: /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/ITransactionManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/ITransactionManager.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/ITransactionManager.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
Index: /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
Index: /trunk/sources/HeuristicLab.Hive.Contracts/ResponseHB.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/ResponseHB.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/ResponseHB.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -18,5 +39,4 @@
///
public class ClientCommunicator: IClientCommunicator {
- int nrOfJobs = 0;
Dictionary lastHeartbeats =
new Dictionary();
@@ -27,4 +47,9 @@
ILifecycleManager lifecycleManager;
+ ///
+ /// Initialization of the Adapters to the database
+ /// Initialization of Eventhandler for the lifecycle management
+ /// Initialization of lastHearbeats Dictionary
+ ///
public ClientCommunicator() {
clientAdapter = ServiceLocator.GetClientAdapter();
@@ -36,14 +61,13 @@
new EventHandler(lifecycleManager_OnServerHeartbeat);
- for (int i = 0; i < nrOfJobs; i++) {
- Job job = new Job();
- job.Id = i;
- job.State = State.offline;
- jobAdapter.Update(job);
- }
lastHeartbeats = new Dictionary();
-
- }
-
+ }
+
+ ///
+ /// Check if online clients send their hearbeats
+ /// if not -> set them offline and check if they where calculating a job
+ ///
+ ///
+ ///
[MethodImpl(MethodImplOptions.Synchronized)]
void lifecycleManager_OnServerHeartbeat(object sender, EventArgs e) {
@@ -89,4 +113,10 @@
#region IClientCommunicator Members
+ ///
+ /// Login process for the client
+ /// A hearbeat entry is created as well (login is the first hearbeat)
+ ///
+ ///
+ ///
[MethodImpl(MethodImplOptions.Synchronized)]
public Response Login(ClientInfo clientInfo) {
@@ -114,4 +144,11 @@
}
+ ///
+ /// The client has to send regulary heartbeats
+ /// this hearbeats will be stored in the heartbeats dictionary
+ /// check if there is work for the client and send the client a response if he should pull a job
+ ///
+ ///
+ ///
[MethodImpl(MethodImplOptions.Synchronized)]
public ResponseHB SendHeartBeat(HeartBeatData hbData) {
@@ -143,5 +180,11 @@
return response;
}
-
+
+ ///
+ /// if the client asked to pull a job he calls this method
+ /// the server selects a job and sends it to the client
+ ///
+ ///
+ ///
[MethodImpl(MethodImplOptions.Synchronized)]
public ResponseJob PullJob(Guid clientId) {
@@ -164,4 +207,15 @@
}
+ ///
+ /// the client can send job results during calculating
+ /// and will send a final job result when he finished calculating
+ /// these job results will be stored in the database
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[MethodImpl(MethodImplOptions.Synchronized)]
public ResponseResultReceived SendJobResult(Guid clientId,
@@ -211,4 +265,10 @@
}
+ ///
+ /// when a client logs out the state will be set
+ /// and the entry in the last hearbeats dictionary will be removed
+ ///
+ ///
+ ///
[MethodImpl(MethodImplOptions.Synchronized)]
public Response Logout(Guid clientId) {
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs (revision 1121)
@@ -51,4 +51,8 @@
#region IClientManager Members
+ ///
+ /// Returns all clients stored in the database
+ ///
+ ///
public ResponseList GetAllClients() {
ResponseList response = new ResponseList();
@@ -61,4 +65,8 @@
}
+ ///
+ /// returns all client groups stored in the database
+ ///
+ ///
public ResponseList GetAllClientGroups() {
ResponseList response = new ResponseList();
@@ -77,4 +85,9 @@
}
+ ///
+ /// Add a client group into the database
+ ///
+ ///
+ ///
public Response AddClientGroup(ClientGroup clientGroup) {
Response response = new Response();
@@ -92,4 +105,10 @@
}
+ ///
+ /// Add a resource to a group
+ ///
+ ///
+ ///
+ ///
public Response AddResourceToGroup(long clientGroupId, Resource resource) {
Response response = new Response();
@@ -115,4 +134,10 @@
}
+ ///
+ /// Remove a resource from a group
+ ///
+ ///
+ ///
+ ///
public Response DeleteResourceFromGroup(long clientGroupId, long resourceId) {
Response response = new Response();
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs (revision 1121)
@@ -40,4 +40,8 @@
}
+ ///
+ /// returns all jobs stored in the database
+ ///
+ ///
public ResponseList GetAllJobs() {
ResponseList response = new ResponseList();
@@ -50,4 +54,9 @@
}
+ ///
+ /// Adds a new job into the database
+ ///
+ ///
+ ///
public ResponseObject AddNewJob(Job job) {
ResponseObject response = new ResponseObject();
@@ -82,4 +91,9 @@
}
+ ///
+ /// Removes a job from the database
+ ///
+ ///
+ ///
public Response RemoveJob(long jobId) {
Response response = new Response();
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs (revision 1120)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs (revision 1121)
@@ -1,3 +1,24 @@
-using System;
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -24,4 +45,8 @@
#region IUserRoleManager Members
+ ///
+ /// returns all users from the database
+ ///
+ ///
public ResponseList GetAllUsers() {
ResponseList response = new ResponseList();
@@ -35,4 +60,9 @@
}
+ ///
+ /// Adds a new user to the database
+ ///
+ ///
+ ///
public ResponseObject AddNewUser(User user) {
ResponseObject response = new ResponseObject();
@@ -57,4 +87,8 @@
}
+ ///
+ /// returns all usergroups from the database
+ ///
+ ///
public ResponseList GetAllUserGroups() {
ResponseList response = new ResponseList();
@@ -67,4 +101,9 @@
}
+ ///
+ /// Removes a user from the database
+ ///
+ ///
+ ///
public Response RemoveUser(long userId) {
Response response = new Response();
@@ -82,4 +121,9 @@
}
+ ///
+ /// Adds a new usergroup to the database
+ ///
+ ///
+ ///
public ResponseObject AddNewUserGroup(UserGroup userGroup) {
ResponseObject response = new ResponseObject();
@@ -99,4 +143,9 @@
}
+ ///
+ /// Removes a user group from the database
+ ///
+ ///
+ ///
public Response RemoveUserGroup(long groupId) {
Response response = new Response();
@@ -115,4 +164,10 @@
}
+ ///
+ /// Adds a user into a user group
+ ///
+ ///
+ ///
+ ///
public Response AddUserToGroup(long groupId, long userId) {
Response response = new Response();
@@ -140,4 +195,10 @@
}
+ ///
+ /// Adds a user group to a user group
+ ///
+ ///
+ ///
+ ///
public Response AddUserGroupToGroup(long groupId, long groupToAddId) {
Response response = new Response();
@@ -158,4 +219,10 @@
}
+ ///
+ /// Removes a permission owner (user, user group) from a user group
+ ///
+ ///
+ ///
+ ///
public Response RemovePermissionOwnerFromGroup(long groupId, long permissionOwnerId) {
Response response = new Response();