Changeset 907
- Timestamp:
- 12/04/08 17:22:06 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
r902 r907 8 8 public static string RESPONSE_LOGIN_USER_ALLREADY_ONLINE = "Login.UserAllreadyOnline"; 9 9 public static string RESPONSE_LOGIN_SUCCESS = "Login.Success"; 10 10 11 public static string RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED = "Logout.ClientNotRegistered"; 11 12 public static string RESPONSE_LOGOUT_SUCCESS = "Logout.Success"; 12 13 14 public static string RESPONSE_USERROLE_GET_ALL_USERS = "UserRole.GetAllUsers"; 15 public static string RESPONSE_USERROLE_USER_EXISTS_ALLREADY = "UserRole.UserExistsAllready"; 16 public static string RESPONSE_USERROLE_USER_SUCCESSFULLY_ADDED = "UserRole.UserSuccessfullyAdded"; 17 public static string RESPONSE_USERROLE_USER_DOESNT_EXIST = "UserRole.UserDoesntExist"; 18 public static string RESPONSE_USERROLE_USER_REMOVED = "UserRole.UserRemoved"; 19 13 20 } 14 21 } -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IServerConsoleFacade.cs
r800 r907 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; 4 25 using System.Text; 5 26 using System.ServiceModel; 27 using System.Runtime.Serialization; 6 28 7 29 namespace HeuristicLab.Hive.Contracts.Interfaces { … … 11 33 [ServiceContract] 12 34 public interface IServerConsoleFacade : IClientManager, IJobManager, IUserRoleManager { 35 [DataContract] 36 Response Login(String userName, String password); 13 37 } 14 38 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r902 r907 44 44 if (client.State != State.offline) { 45 45 response.Success = false; 46 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGIN_USER_ALLREADY_ONLINE);46 response.StatusMessage = ApplicationConstants.RESPONSE_LOGIN_USER_ALLREADY_ONLINE; 47 47 break; 48 48 } else … … 54 54 clientAdapter.UpdateClient(clientInfo); 55 55 response.Success = true; 56 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGIN_SUCCESS);56 response.StatusMessage = ApplicationConstants.RESPONSE_LOGIN_SUCCESS; 57 57 } 58 58 … … 102 102 if (client == null) { 103 103 response.Success = false; 104 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED);104 response.StatusMessage = ApplicationConstants.RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED; 105 105 return response; 106 106 } … … 109 109 110 110 response.Success = true; 111 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGOUT_SUCCESS);111 response.StatusMessage = ApplicationConstants.RESPONSE_LOGOUT_SUCCESS; 112 112 113 113 return response; -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
r902 r907 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; … … 37 58 38 59 public ResponseList<ClientInfo> GetAllClients() { 39 return null; 60 ResponseList<ClientInfo> response = new ResponseList<ClientInfo>(); 61 response.List = clients; 62 response.Success = true; 63 return response; 40 64 } 41 65 42 66 public ResponseList<ClientGroup> GetAllClientGroups() { 43 return null; 67 ResponseList<ClientGroup> response = new ResponseList<ClientGroup>(); 68 response.List = clientGroups; 69 response.Success = true; 70 return response; 44 71 } 45 72 46 73 public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() { 47 return null; 74 ResponseList<UpTimeStatistics> response = new ResponseList<UpTimeStatistics>(); 75 response.Success = true; 76 return response; 48 77 } 49 78 -
trunk/sources/HeuristicLab.Hive.Server.Core/HiveServerMessages.resx
r902 r907 130 130 <value>A User with this GUID is allready logged in</value> 131 131 </data> 132 <data name="UserRole.GetAllUsers" xml:space="preserve"> 133 <value>All Users returned</value> 134 </data> 135 <data name="UserRole.UserDoesntExist" xml:space="preserve"> 136 <value>Sorry, but this user doesn't exist</value> 137 </data> 138 <data name="UserRole.UserExistsAllready" xml:space="preserve"> 139 <value>Sorry, but a user with this name exists allready in database</value> 140 </data> 141 <data name="UserRole.UserRemoved" xml:space="preserve"> 142 <value>User sucessfully removed from database</value> 143 </data> 144 <data name="UserRole.UserSuccessfullyAdded" xml:space="preserve"> 145 <value>User successfully added to database</value> 146 </data> 132 147 </root> -
trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
r902 r907 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; … … 23 44 24 45 public ResponseList<Job> GetAllJobs() { 25 return null; 46 ResponseList<Job> response = new ResponseList<Job>(); 47 response.List = jobs; 48 return response; 26 49 } 27 50 -
trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
r902 r907 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; … … 73 94 #endregion 74 95 96 97 #region IServerConsoleFacade Members 98 99 public Response Login(string userName, string password) { 100 Response response = new Response(); 101 response.Success = true; 102 retrurn response; 103 } 104 105 #endregion 75 106 } 76 107 } -
trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
r902 r907 37 37 38 38 public ResponseList<User> GetAllUsers() { 39 return null; 39 ResponseList<User> response = new ResponseList<User>(); 40 41 List<User> allUsers = new List<User>(userAdapter.GetAllUsers()); 42 response.List = allUsers; 43 response.Success = true; 44 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_GET_ALL_USERS; 45 46 return response; 40 47 } 41 48 42 49 public Response AddNewUser(User user) { 50 Response response = new Response(); 51 43 52 User dbUser = userAdapter.GetUserByName(user.Name); 44 45 return null; 53 if (dbUser != null) { 54 response.Success = false; 55 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_EXISTS_ALLREADY; 56 return response; 57 } 58 userAdapter.UpdateUser(user); 59 response.Success = true; 60 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_SUCCESSFULLY_ADDED; 61 62 return response; 46 63 } 47 64 48 65 public ResponseList<UserGroup> GetAllUserGroups() { 49 return null; 66 ResponseList<UserGroup> response = new ResponseList<UserGroup>(); 67 68 return response; 50 69 } 51 70 52 71 public Response RemoveUser(long userId) { 53 return null; 72 Response response = new Response(); 73 User user = userAdapter.GetUserById(userId); 74 if (user == null) { 75 response.Success = false; 76 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_DOESNT_EXIST; 77 return response; 78 } 79 response.Success = true; 80 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_REMOVED; 81 82 return response; 54 83 } 55 84
Note: See TracChangeset
for help on using the changeset viewer.