Changeset 6000 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
- Timestamp:
- 04/11/11 15:32:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r5793 r6000 250 250 dao.AddSlave(slaveInfo); 251 251 } else { 252 dao.UpdateSlave(slaveInfo); 252 var dbSlave = dao.GetSlave(slaveInfo.Id); 253 254 dbSlave.Name = slaveInfo.Name; 255 dbSlave.Description = slaveInfo.Description; 256 257 dbSlave.Cores = slaveInfo.Cores; 258 dbSlave.CpuArchitecture = slaveInfo.CpuArchitecture; 259 dbSlave.CpuSpeed = slaveInfo.CpuSpeed; 260 dbSlave.FreeCores = slaveInfo.FreeCores; 261 dbSlave.FreeMemory = slaveInfo.FreeMemory; 262 dbSlave.Memory = slaveInfo.Memory; 263 dbSlave.OperatingSystem = slaveInfo.OperatingSystem; 264 265 dbSlave.LastHeartbeat = DateTime.Now; 266 dbSlave.SlaveState = SlaveState.Idle; 267 268 // don't update those properties: 269 // dbSlave.IsAllowedToCalculate = slaveInfo.IsAllowedToCalculate; 270 // dbSlave.ParentResourceId = slaveInfo.ParentResourceId; 271 272 dao.UpdateSlave(dbSlave); 253 273 } 254 274 }); … … 282 302 plugin.UserId = auth.UserId; 283 303 plugin.DateCreated = DateTime.Now; 304 if (!plugin.IsLocal) { 305 var existing = dao.GetPlugins(x => x.Name == plugin.Name && x.Version == plugin.Version.ToString() && !x.IsLocal); 306 if (existing.Count() > 0) { 307 // a plugin with the same name and version already exists. 308 throw new FaultException<PluginAlreadyExistsFault>(new PluginAlreadyExistsFault(existing.Single().Id)); 309 } 310 } 284 311 Guid pluginId = dao.AddPlugin(plugin); 285 312 foreach (PluginData pluginData in pluginDatas) { … … 289 316 return pluginId; 290 317 }); 318 } 319 320 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 321 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 322 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 323 public Plugin GetPlugin(Guid pluginId) { 324 return dao.GetPlugin(pluginId); 291 325 } 292 326
Note: See TracChangeset
for help on using the changeset viewer.