Changeset 902
- Timestamp:
- 12/04/08 16:35:24 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UserGroup.cs
r795 r902 29 29 30 30 [DataContract] 31 public class UserGroup {31 public class UserGroup : PermissionOwner { 32 32 [DataMember] 33 33 public long UserGroupId { get; set; } -
trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj
r858 r902 70 70 </ItemGroup> 71 71 <ItemGroup> 72 <Compile Include="ApplicationConstants.cs" /> 72 73 <Compile Include="BusinessObjects\GrantedPermissions.cs" /> 73 74 <Compile Include="BusinessObjects\ClientGroup.cs" /> … … 96 97 <Compile Include="Response.cs" /> 97 98 <Compile Include="ResponseHB.cs" /> 99 <Compile Include="ResponseList.cs" /> 98 100 <Compile Include="ResponseResultReceived.cs" /> 99 101 <Compile Include="TestJob.cs" /> -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs
r839 r902 13 13 public interface IClientManager { 14 14 [OperationContract] 15 List<ClientInfo> GetAllClients();15 ResponseList<ClientInfo> GetAllClients(); 16 16 [OperationContract] 17 17 [ServiceKnownType(typeof (Resource))] 18 18 [ServiceKnownType(typeof(ClientInfo))] 19 List<ClientGroup> GetAllClientGroups();19 ResponseList<ClientGroup> GetAllClientGroups(); 20 20 [OperationContract] 21 List<UpTimeStatistics> GetAllUpTimeStatistics();21 ResponseList<UpTimeStatistics> GetAllUpTimeStatistics(); 22 22 } 23 23 } -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IJobManager.cs
r796 r902 13 13 public interface IJobManager { 14 14 [OperationContract] 15 List<Job> GetAllJobs();15 ResponseList<Job> GetAllJobs(); 16 16 } 17 17 } -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs
r842 r902 13 13 public interface IUserRoleManager { 14 14 [OperationContract] 15 List<User> GetAllUsers();15 ResponseList<User> GetAllUsers(); 16 16 [OperationContract] 17 voidAddNewUser(User user);17 Response AddNewUser(User user); 18 18 [OperationContract] 19 List<UserGroup> GetAllUserGroups(); 19 Response RemoveUser(long userId); 20 [OperationContract] 21 Response AddNewUserGroup(UserGroup userGroup); 22 [OperationContract] 23 Response RemoveUserGroup(long groupId); 24 [OperationContract] 25 ResponseList<UserGroup> GetAllUserGroups(); 26 [OperationContract] 27 Response AddUserToGroup(long groupId, long userId); 28 [OperationContract] 29 Response RemoveUserFromGroup(long groupId, long userId); 20 30 } 21 31 } -
trunk/sources/HeuristicLab.Hive.Contracts/ResponseJob.cs
r823 r902 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; -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r842 r902 44 44 if (client.State != State.offline) { 45 45 response.Success = false; 46 response.StatusMessage = rm.GetString( "UserAllreadyOnline");46 response.StatusMessage = rm.GetString(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( "LoginSuccess");56 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGIN_SUCCESS); 57 57 } 58 58 … … 97 97 98 98 public Response Logout(Guid clientId) { 99 bool clientRemoved = false;100 foreach (ClientInfo client in clients) {101 if (client.ClientId.Equals(clientId)) {102 clients.Remove(client);103 clientRemoved = true;104 }105 }106 99 Response response = new Response(); 107 100 108 if (clientRemoved) { 109 response.Success = true; 110 response.StatusMessage = "Successfully logged out. Good bye"; 111 } else { 101 ClientInfo client = clientAdapter.GetClientById(clientId); 102 if (client == null) { 112 103 response.Success = false; 113 response.StatusMessage = "Sorry, but you weren't logged in"; 104 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED); 105 return response; 114 106 } 107 client.State = State.offline; 108 clientAdapter.UpdateClient(client); 109 110 response.Success = true; 111 response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGOUT_SUCCESS); 112 115 113 return response; 116 114 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
r837 r902 5 5 using HeuristicLab.Hive.Contracts.Interfaces; 6 6 using HeuristicLab.Hive.Contracts.BusinessObjects; 7 using HeuristicLab.Hive.Contracts; 7 8 8 9 namespace HeuristicLab.Hive.Server.Core { … … 35 36 #region IClientManager Members 36 37 37 public List<ClientInfo> GetAllClients() {38 return clients;38 public ResponseList<ClientInfo> GetAllClients() { 39 return null; 39 40 } 40 41 41 public List<ClientGroup> GetAllClientGroups() {42 return clientGroups;42 public ResponseList<ClientGroup> GetAllClientGroups() { 43 return null; 43 44 } 44 45 45 public List<UpTimeStatistics> GetAllUpTimeStatistics() {46 return n ew List<UpTimeStatistics>();46 public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() { 47 return null; 47 48 } 48 49 -
trunk/sources/HeuristicLab.Hive.Server.Core/HiveServerMessages.resx
r897 r902 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <data name="LoginSuccess" xml:space="preserve"> 120 <data name="Login.ClientNotRegistered" xml:space="preserve"> 121 <value>Sorry this client was not registered yet</value> 122 </data> 123 <data name="Login.Success" xml:space="preserve"> 121 124 <value>The Login was successfull</value> 122 125 </data> 123 <data name="UserAllreadyOnline" xml:space="preserve"> 126 <data name="Logout.Success" xml:space="preserve"> 127 <value>You where logged out successfully. Good bye</value> 128 </data> 129 <data name="Logout.UserAllreadyOnline" xml:space="preserve"> 124 130 <value>A User with this GUID is allready logged in</value> 125 131 </data> -
trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
r820 r902 5 5 using HeuristicLab.Hive.Contracts.Interfaces; 6 6 using HeuristicLab.Hive.Contracts.BusinessObjects; 7 using HeuristicLab.Hive.Contracts; 7 8 8 9 namespace HeuristicLab.Hive.Server.Core { … … 21 22 } 22 23 23 public List<Job> GetAllJobs() {24 return jobs;24 public ResponseList<Job> GetAllJobs() { 25 return null; 25 26 } 26 27 -
trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
r842 r902 5 5 using HeuristicLab.Hive.Contracts.Interfaces; 6 6 using HeuristicLab.Hive.Contracts.BusinessObjects; 7 using HeuristicLab.Hive.Contracts; 7 8 8 9 namespace HeuristicLab.Hive.Server.Core { … … 14 15 #region IClientManager Members 15 16 16 public List<ClientInfo> GetAllClients() {17 public ResponseList<ClientInfo> GetAllClients() { 17 18 return clientManager.GetAllClients(); 18 19 } 19 20 20 public List<ClientGroup> GetAllClientGroups() {21 public ResponseList<ClientGroup> GetAllClientGroups() { 21 22 return clientManager.GetAllClientGroups(); 22 23 } 23 24 24 public List<UpTimeStatistics> GetAllUpTimeStatistics() {25 public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() { 25 26 return clientManager.GetAllUpTimeStatistics(); 26 27 } … … 30 31 #region IJobManager Members 31 32 32 public List<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetAllJobs() {33 public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetAllJobs() { 33 34 return jobManager.GetAllJobs(); 34 35 } … … 38 39 #region IUserRoleManager Members 39 40 40 public List<HeuristicLab.Hive.Contracts.BusinessObjects.User> GetAllUsers() {41 public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.User> GetAllUsers() { 41 42 return userRoleManager.GetAllUsers(); 42 43 } 43 44 44 public voidAddNewUser(User user) {45 userRoleManager.AddNewUser(user);45 public Response AddNewUser(User user) { 46 return userRoleManager.AddNewUser(user); 46 47 } 47 48 48 public List<HeuristicLab.Hive.Contracts.BusinessObjects.UserGroup> GetAllUserGroups() {49 public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.UserGroup> GetAllUserGroups() { 49 50 return userRoleManager.GetAllUserGroups(); 50 51 } 51 52 53 public Response RemoveUser(long userId) { 54 throw new NotImplementedException(); 55 } 56 57 public Response AddNewUserGroup(UserGroup userGroup) { 58 throw new NotImplementedException(); 59 } 60 61 public Response RemoveUserGroup(long groupId) { 62 throw new NotImplementedException(); 63 } 64 65 public Response AddUserToGroup(long groupId, long userId) { 66 throw new NotImplementedException(); 67 } 68 69 public Response RemoveUserFromGroup(long groupId, long userId) { 70 throw new NotImplementedException(); 71 } 72 52 73 #endregion 74 53 75 } 54 76 } -
trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
r845 r902 5 5 using HeuristicLab.Hive.Contracts.Interfaces; 6 6 using HeuristicLab.Hive.Contracts.BusinessObjects; 7 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess; 8 using System.Resources; 9 using System.Reflection; 10 using HeuristicLab.Hive.Contracts; 7 11 8 12 namespace HeuristicLab.Hive.Server.Core { … … 12 16 List<UserGroup> userGroups; 13 17 18 IUserAdapter userAdapter; 19 ResourceManager rm; 20 14 21 public UserRoleManager() { 22 userAdapter = ServiceLocator.GetUserAdapter(); 23 rm = new ResourceManager("HiveServerMessages.resx", Assembly.GetExecutingAssembly()); 24 15 25 users = new List<User>(); 16 26 userGroups = new List<UserGroup>(); … … 26 36 #region IUserRoleManager Members 27 37 28 public List<User> GetAllUsers() {29 return users;38 public ResponseList<User> GetAllUsers() { 39 return null; 30 40 } 31 41 32 public void AddNewUser(User user) { 42 public Response AddNewUser(User user) { 43 User dbUser = userAdapter.GetUserByName(user.Name); 33 44 45 return null; 34 46 } 35 47 36 public List<UserGroup> GetAllUserGroups() { 37 return userGroups; 48 public ResponseList<UserGroup> GetAllUserGroups() { 49 return null; 50 } 51 52 public Response RemoveUser(long userId) { 53 return null; 54 } 55 56 public Response AddNewUserGroup(UserGroup userGroup) { 57 return null; 58 } 59 60 public Response RemoveUserGroup(long groupId) { 61 return null; 62 } 63 64 public Response AddUserToGroup(long groupId, long userId) { 65 throw new NotImplementedException(); 66 } 67 68 public Response RemoveUserFromGroup(long groupId, long userId) { 69 throw new NotImplementedException(); 38 70 } 39 71
Note: See TracChangeset
for help on using the changeset viewer.