- Timestamp:
- 12/10/08 09:43:58 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Communication/ServiceLocator.cs
r882 r929 13 13 proxy = new ClientCommunicatorClient( 14 14 new NetTcpBinding(), 15 new EndpointAddress("net.tcp://1 92.168.132.1:9000/HiveServer/ClientCommunicator")15 new EndpointAddress("net.tcp://10.20.53.2:9000/HiveServer/ClientCommunicator") 16 16 ); 17 17 } -
trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
r907 r929 6 6 namespace HeuristicLab.Hive.Contracts { 7 7 public class ApplicationConstants { 8 public static string RESPONSE_LOGIN_USER_ALLREADY_ONLINE = "Login.UserAllreadyOnline";9 public static string RESPONSE_LOGIN_SUCCESS = "Login.Success";10 11 public static string RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED = "Logout.ClientNotRegistered";12 public static string RESPONSE_LOGOUT_SUCCESS = "Logout.Success";13 8 14 9 public static string RESPONSE_USERROLE_GET_ALL_USERS = "UserRole.GetAllUsers"; … … 18 13 public static string RESPONSE_USERROLE_USER_REMOVED = "UserRole.UserRemoved"; 19 14 15 public static string RESPONSE_CLIENT_GET_ALL_CLIENTS = "Client.GetAllClients"; 16 17 public static string RESPONSE_COMMUNICATOR_HARDBEAT_RECEIVED = "Communicator.HeardbeatReceived"; 18 public static string RESPONSE_COMMUNICATOR_JOB_PULLED = "Communicator.JobPulled"; 19 public static string RESPONSE_COMMUNICATOR_JOBRESULT_RECEIVED = "Communicator.JobResultReceived"; 20 public static string RESPONSE_COMMUNICATOR_LOGIN_USER_ALLREADY_ONLINE = "Communicator.LoginUserAllreadyOnline"; 21 public static string RESPONSE_COMMUNICATOR_LOGIN_SUCCESS = "Communicator.LoginSuccess"; 22 public static string RESPONSE_COMMUNICATOR_LOGOUT_CLIENT_NOT_REGISTERED = "Communicator.LogoutClientNotRegistered"; 23 public static string RESPONSE_COMMUNICATOR_LOGOUT_SUCCESS = "Logout.Success"; 24 20 25 } 21 26 } -
trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UserGroup.cs
r902 r929 30 30 [DataContract] 31 31 public class UserGroup : PermissionOwner { 32 [DataMember]33 public long UserGroupId { get; set; }34 32 } 35 33 } -
trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
r904 r929 79 79 } 80 80 foreach (UserGroup ug in userGroups.List) { 81 tvUserControl.Nodes.Add(ug. UserGroupId.ToString());81 tvUserControl.Nodes.Add(ug.PermissionOwnerId.ToString()); 82 82 } 83 83 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r907 r929 21 21 22 22 IClientAdapter clientAdapter; 23 ResourceManager rm;24 23 25 24 public ClientCommunicator() { 26 clientAdapter = ServiceLocator.GetClientAdapter(); 27 rm = new ResourceManager("HiveServerMessages.resx", Assembly.GetExecutingAssembly()); 25 clientAdapter = ServiceLocator.GetClientAdapter(); 28 26 29 27 jobs = new LinkedList<long>(); … … 40 38 41 39 ICollection<ClientInfo> allClients = clientAdapter.GetAllClients(); 42 foreach (ClientInfo client in allClients) { 43 if (client.ClientId.Equals(clientInfo.ClientId)) { 44 if (client.State != State.offline) { 45 response.Success = false; 46 response.StatusMessage = ApplicationConstants.RESPONSE_LOGIN_USER_ALLREADY_ONLINE; 47 break; 48 } else 49 break; // searching for clients can be stopped, because it was found and it's state is offline 50 } 51 } 40 ClientInfo client = clientAdapter.GetClientById(clientInfo.ClientId); 41 if (client != null) { 42 if (client.State != State.offline) { 43 response.Success = false; 44 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_LOGIN_USER_ALLREADY_ONLINE; 45 } 46 } 52 47 53 48 if (response.Success) { 54 49 clientAdapter.UpdateClient(clientInfo); 55 response.Success = true; 56 response.StatusMessage = ApplicationConstants.RESPONSE_LOGIN_SUCCESS; 50 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_LOGIN_SUCCESS; 57 51 } 58 52 … … 64 58 65 59 response.Success = true; 66 response.StatusMessage = "HeartBeat received";60 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_HARDBEAT_RECEIVED; 67 61 response.ActionRequest = new List<MessageContainer>(); 68 62 if (jobs.Count > 0) … … 83 77 84 78 response.Success = true; 85 response.StatusMessage = "Job with id " + jobs.Count + " sent";79 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_PULLED; 86 80 return response; 87 81 } … … 90 84 ResponseResultReceived response = new ResponseResultReceived(); 91 85 response.Success = true; 92 response.StatusMessage = "Thanks for calculating";86 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOBRESULT_RECEIVED; 93 87 response.JobId = Result.JobId; 94 88 … … 102 96 if (client == null) { 103 97 response.Success = false; 104 response.StatusMessage = ApplicationConstants.RESPONSE_ LOGOUT_CLIENT_NOT_REGISTERED;98 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_LOGOUT_CLIENT_NOT_REGISTERED; 105 99 return response; 106 100 } … … 109 103 110 104 response.Success = true; 111 response.StatusMessage = ApplicationConstants.RESPONSE_ LOGOUT_SUCCESS;105 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_LOGOUT_SUCCESS; 112 106 113 107 return response; -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
r907 r929 27 27 using HeuristicLab.Hive.Contracts.BusinessObjects; 28 28 using HeuristicLab.Hive.Contracts; 29 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess; 29 30 30 31 namespace HeuristicLab.Hive.Server.Core { 31 32 class ClientManager: IClientManager { 33 34 IClientAdapter clientAdapter; 32 35 33 36 List<ClientInfo> clients; … … 35 38 36 39 public ClientManager() { 40 clientAdapter = ServiceLocator.GetClientAdapter(); 41 37 42 clients = new List<ClientInfo>(); 38 43 clientGroups = new List<ClientGroup>(); … … 59 64 public ResponseList<ClientInfo> GetAllClients() { 60 65 ResponseList<ClientInfo> response = new ResponseList<ClientInfo>(); 61 response.List = clients; 66 67 response.List = new List<ClientInfo>(clientAdapter.GetAllClients()); 68 response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_ALL_CLIENTS; 62 69 response.Success = true; 70 63 71 return response; 64 72 } -
trunk/sources/HeuristicLab.Hive.Server.Core/HiveServerMessages.resx
r907 r929 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="Login.ClientNotRegistered" xml:space="preserve"> 120 <data name="Client.GetAllClients" xml:space="preserve"> 121 <value>All Clients returned</value> 122 </data> 123 <data name="Communicator.HeardbeatReceived" xml:space="preserve"> 124 <value>Heartbeat received</value> 125 </data> 126 <data name="Communicator.JobPulled" xml:space="preserve"> 127 <value>Job sent</value> 128 </data> 129 <data name="Communicator.JobResultReceived" xml:space="preserve"> 130 <value>JobResult received, thanks for calculating</value> 131 </data> 132 <data name="Communicator.LoginClientNotRegistered" xml:space="preserve"> 121 133 <value>Sorry this client was not registered yet</value> 122 134 </data> 123 <data name=" Login.Success" xml:space="preserve">135 <data name="Communicator.LoginSuccess" xml:space="preserve"> 124 136 <value>The Login was successfull</value> 125 137 </data> 126 <data name=" Logout.Success" xml:space="preserve">138 <data name="Communicator.LogoutSuccess" xml:space="preserve"> 127 139 <value>You where logged out successfully. Good bye</value> 128 140 </data> -
trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
r907 r929 17 17 18 18 IUserAdapter userAdapter; 19 ResourceManager rm;20 19 21 20 public UserRoleManager() { 22 21 userAdapter = ServiceLocator.GetUserAdapter(); 23 rm = new ResourceManager("HiveServerMessages.resx", Assembly.GetExecutingAssembly());24 22 25 23 users = new List<User>(); … … 30 28 users.Add(new User { PermissionOwnerId = 3, Name = "Greg", Password = "greg" }); 31 29 32 userGroups.Add(new UserGroup { UserGroupId = 1});33 userGroups.Add(new UserGroup { UserGroupId = 2});30 userGroups.Add(new UserGroup { PermissionOwnerId = 4 }); 31 userGroups.Add(new UserGroup { PermissionOwnerId = 5 }); 34 32 } 35 33 … … 79 77 response.Success = true; 80 78 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_REMOVED; 81 79 82 80 return response; 83 81 }
Note: See TracChangeset
for help on using the changeset viewer.