Changeset 16139 for branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive
- Timestamp:
- 09/13/18 13:18:45 (6 years ago)
- Location:
- branches/2931_OR-Tools_LP_MIP
- Files:
-
- 9 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP
- Property svn:mergeinfo changed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive
- Property svn:mergeinfo changed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
r16070 r16139 125 125 <Compile Include="HiveAdminClient.cs" /> 126 126 <Compile Include="HiveClient.cs" /> 127 <Compile Include="ServiceClients\AssignedJobResource.cs" /> 128 <Compile Include="ServiceClients\AssignedProjectResource.cs" /> 129 <Compile Include="ServiceClients\Project.cs" /> 127 130 <Compile Include="ServiceClients\UserPriority.cs" /> 128 131 <Compile Include="ServiceClients\ResourcePermission.cs" /> -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs
r15583 r16139 24 24 using HeuristicLab.Common; 25 25 using HeuristicLab.Core; 26 using System.Collections.Generic; 27 using System.Linq; 26 28 27 29 namespace HeuristicLab.Clients.Hive { … … 36 38 } 37 39 40 #region Properties 38 41 private IItemList<Resource> resources; 39 42 public IItemList<Resource> Resources { … … 57 60 } 58 61 62 private IItemList<Project> projects; 63 public IItemList<Project> Projects { 64 get { return projects; } 65 } 66 67 private IItemList<AssignedProjectResource> projectResourceAssignments; 68 public IItemList<AssignedProjectResource> ProjectResourceAssignments { 69 get { return projectResourceAssignments; } 70 } 71 72 private Dictionary<Guid, HiveItemCollection<Job>> jobs; 73 public Dictionary<Guid, HiveItemCollection<Job>> Jobs { 74 get { return jobs; } 75 set { 76 if (value != jobs) 77 jobs = value; 78 } 79 } 80 81 private Dictionary<Guid, HashSet<Guid>> projectAncestors; 82 public Dictionary<Guid, HashSet<Guid>> ProjectAncestors { 83 get { return projectAncestors; } 84 } 85 86 private Dictionary<Guid, HashSet<Guid>> projectDescendants; 87 public Dictionary<Guid, HashSet<Guid>> ProjectDescendants { 88 get { return projectDescendants; } 89 } 90 91 private Dictionary<Guid, HashSet<Guid>> resourceAncestors; 92 public Dictionary<Guid, HashSet<Guid>> ResourceAncestors { 93 get { return resourceAncestors; } 94 } 95 96 private Dictionary<Guid, HashSet<Guid>> resourceDescendants; 97 public Dictionary<Guid, HashSet<Guid>> ResourceDescendants { 98 get { return resourceDescendants; } 99 } 100 101 private Dictionary<Guid, string> projectNames; 102 public Dictionary<Guid, string> ProjectNames { 103 get { return projectNames; } 104 } 105 106 private HashSet<Project> disabledParentProjects; 107 public HashSet<Project> DisabledParentProjects { 108 get { return disabledParentProjects; } 109 } 110 111 private Dictionary<Guid, string> resourceNames; 112 public Dictionary<Guid, string> ResourceNames { 113 get { return resourceNames; } 114 } 115 116 private HashSet<Resource> disabledParentResources; 117 public HashSet<Resource> DisabledParentResources { 118 get { return disabledParentResources; } 119 } 120 #endregion 121 59 122 #region Events 60 123 public event EventHandler Refreshing; … … 78 141 try { 79 142 resources = new ItemList<Resource>(); 143 projects = new ItemList<Project>(); 144 projectResourceAssignments = new ItemList<AssignedProjectResource>(); 145 jobs = new Dictionary<Guid, HiveItemCollection<Job>>(); 146 projectNames = new Dictionary<Guid, string>(); 147 resourceNames = new Dictionary<Guid, string>(); 148 149 projectAncestors = new Dictionary<Guid, HashSet<Guid>>(); 150 projectDescendants = new Dictionary<Guid, HashSet<Guid>>(); 151 resourceAncestors = new Dictionary<Guid, HashSet<Guid>>(); 152 resourceDescendants = new Dictionary<Guid, HashSet<Guid>>(); 80 153 81 154 HiveServiceLocator.Instance.CallHiveService(service => { 82 service.GetSlaveGroups().ForEach(g => resources.Add(g)); 83 service.GetSlaves().ForEach(s => resources.Add(s)); 155 service.GetSlaveGroupsForAdministration().ForEach(g => resources.Add(g)); 156 service.GetSlavesForAdministration().ForEach(s => resources.Add(s)); 157 service.GetProjectsForAdministration().ForEach(p => projects.Add(p)); 158 var projectIds = projects.Select(p => p.Id).ToList(); 159 if (projectIds.Any()) { 160 service.GetAssignedResourcesForProjectsAdministration(projectIds) 161 .ForEach(a => projectResourceAssignments.Add(a)); 162 projectIds.ForEach(p => jobs.Add(p, new HiveItemCollection<Job>())); 163 var unsortedJobs = service.GetJobsByProjectIds(projectIds) 164 .OrderBy(x => x.DateCreated).ToList(); 165 166 unsortedJobs.Where(j => j.State == JobState.DeletionPending).ToList().ForEach(j => jobs[j.ProjectId].Add(j)); 167 unsortedJobs.Where(j => j.State == JobState.StatisticsPending).ToList().ForEach(j => jobs[j.ProjectId].Add(j)); 168 unsortedJobs.Where(j => j.State == JobState.Online).ToList().ForEach(j => jobs[j.ProjectId].Add(j)); 169 170 projectNames = service.GetProjectNames(); 171 resourceNames = service.GetResourceNames(); 172 } 84 173 }); 174 175 UpdateResourceGenealogy(); 176 UpdateProjectGenealogy(); 177 RefreshDisabledParentProjects(); 178 RefreshDisabledParentResources(); 85 179 } 86 180 catch { … … 91 185 } 92 186 } 187 188 //public void UpdateResourceGenealogy(IItemList<Resource> resources) { 189 // resourceAncestors.Clear(); 190 // resourceDescendants.Clear(); 191 192 // foreach (var r in resources) { 193 // resourceAncestors.Add(r.Id, new HashSet<Resource>()); 194 // resourceDescendants.Add(r.Id, new HashSet<Resource>()); 195 // } 196 197 // foreach (var r in resources) { 198 // var parentResourceId = r.ParentResourceId; 199 // while (parentResourceId != null) { 200 // var parent = resources.SingleOrDefault(x => x.Id == parentResourceId); 201 // if (parent != null) { 202 // resourceAncestors[r.Id].Add(parent); 203 // resourceDescendants[parent.Id].Add(r); 204 // parentResourceId = parent.ParentResourceId; 205 // } else { 206 // parentResourceId = null; 207 // } 208 // } 209 // } 210 //} 211 212 //public void UpdateProjectGenealogy(IItemList<Project> projects) { 213 // projectAncestors.Clear(); 214 // projectDescendants.Clear(); 215 216 // foreach (var p in projects) { 217 // projectAncestors.Add(p.Id, new HashSet<Project>()); 218 // projectDescendants.Add(p.Id, new HashSet<Project>()); 219 // } 220 221 // foreach (var p in projects) { 222 // var parentProjectId = p.ParentProjectId; 223 // while (parentProjectId != null) { 224 // var parent = projects.SingleOrDefault(x => x.Id == parentProjectId); 225 // if (parent != null) { 226 // projectAncestors[p.Id].Add(parent); 227 // projectDescendants[parent.Id].Add(p); 228 // parentProjectId = parent.ParentProjectId; 229 // } else { 230 // parentProjectId = null; 231 // } 232 // } 233 // } 234 //} 235 236 private void UpdateResourceGenealogy() { 237 resourceAncestors.Clear(); 238 resourceDescendants.Clear(); 239 240 // fetch resource ancestor set 241 HiveServiceLocator.Instance.CallHiveService(service => { 242 var ra = service.GetResourceGenealogy(); 243 ra.Keys.ToList().ForEach(k => resourceAncestors.Add(k, new HashSet<Guid>())); 244 resourceAncestors.Keys.ToList().ForEach(k => resourceAncestors[k].UnionWith(ra[k])); 245 }); 246 247 // build resource descendant set 248 resourceAncestors.Keys.ToList().ForEach(k => resourceDescendants.Add(k, new HashSet<Guid>())); 249 foreach (var ra in resourceAncestors) { 250 foreach (var ancestor in ra.Value) { 251 resourceDescendants[ancestor].Add(ra.Key); 252 } 253 } 254 } 255 256 private void UpdateProjectGenealogy() { 257 projectAncestors.Clear(); 258 projectDescendants.Clear(); 259 260 // fetch project ancestor list 261 HiveServiceLocator.Instance.CallHiveService(service => { 262 var pa = service.GetProjectGenealogy(); 263 pa.Keys.ToList().ForEach(k => projectAncestors.Add(k, new HashSet<Guid>())); 264 projectAncestors.Keys.ToList().ForEach(k => projectAncestors[k].UnionWith(pa[k])); 265 }); 266 267 // build project descendant list 268 projectAncestors.Keys.ToList().ForEach(k => projectDescendants.Add(k, new HashSet<Guid>())); 269 foreach (var pa in projectAncestors) { 270 foreach (var ancestor in pa.Value) { 271 projectDescendants[ancestor].Add(pa.Key); 272 } 273 } 274 } 275 276 private void RefreshDisabledParentProjects() { 277 disabledParentProjects = new HashSet<Project>(); 278 279 foreach (var pid in projects 280 .Where(x => x.ParentProjectId.HasValue) 281 .SelectMany(x => projectAncestors[x.Id]).Distinct() 282 .Where(x => !projects.Select(y => y.Id).Contains(x))) { 283 var p = new Project(); 284 p.Id = pid; 285 p.ParentProjectId = projectAncestors[pid].FirstOrDefault(); 286 p.Name = projectNames[pid]; 287 disabledParentProjects.Add(p); 288 } 289 } 290 291 private void RefreshDisabledParentResources() { 292 disabledParentResources = new HashSet<Resource>(); 293 294 foreach (var rid in resources 295 .Where(x => x.ParentResourceId.HasValue) 296 .SelectMany(x => resourceAncestors[x.Id]).Distinct() 297 .Where(x => !resources.Select(y => y.Id).Contains(x))) { 298 var r = new SlaveGroup(); 299 r.Id = rid; 300 r.ParentResourceId = resourceAncestors[rid].FirstOrDefault(); 301 r.Name = resourceNames[rid]; 302 disabledParentResources.Add(r); 303 } 304 } 305 306 public void RefreshJobs() { 307 var projectIds = new List<Guid>(); 308 jobs = new Dictionary<Guid, HiveItemCollection<Job>>(); 309 310 HiveServiceLocator.Instance.CallHiveService(service => { 311 service.GetProjectsForAdministration().ForEach(p => projectIds.Add(p.Id)); 312 if(projectIds.Any()) { 313 projectIds.ForEach(p => jobs.Add(p, new HiveItemCollection<Job>())); 314 var unsortedJobs = service.GetJobsByProjectIds(projectIds) 315 .OrderBy(x => x.DateCreated).ToList(); 316 unsortedJobs.Where(j => j.State == JobState.DeletionPending).ToList().ForEach(j => jobs[j.ProjectId].Add(j)); 317 unsortedJobs.Where(j => j.State == JobState.StatisticsPending).ToList().ForEach(j => jobs[j.ProjectId].Add(j)); 318 unsortedJobs.Where(j => j.State == JobState.Online).ToList().ForEach(j => jobs[j.ProjectId].Add(j)); 319 } 320 }); 321 } 322 323 public void SortJobs() { 324 for(int i = 0; i < jobs.Count; i++) { 325 var projectId = jobs.Keys.ElementAt(i); 326 var unsortedJobs = jobs.Values.ElementAt(i); 327 328 var sortedJobs = new HiveItemCollection<Job>(); 329 sortedJobs.AddRange(unsortedJobs.Where(j => j.State == JobState.DeletionPending)); 330 sortedJobs.AddRange(unsortedJobs.Where(j => j.State == JobState.StatisticsPending)); 331 sortedJobs.AddRange(unsortedJobs.Where(j => j.State == JobState.Online)); 332 333 jobs[projectId] = sortedJobs; 334 } 335 } 336 93 337 #endregion 94 338 … … 127 371 item.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddDowntime((Downtime)item)); 128 372 } 373 if (item is Project) { 374 item.Id = HiveServiceLocator.Instance.CallHiveService(s => s.AddProject((Project)item)); 375 } 129 376 } else { 130 377 if (item is SlaveGroup) { … … 136 383 if (item is Downtime) { 137 384 HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateDowntime((Downtime)item)); 385 } 386 if (item is Project) { 387 HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateProject((Project)item)); 138 388 } 139 389 } … … 149 399 } else if (item is Downtime) { 150 400 HiveServiceLocator.Instance.CallHiveService((s) => s.DeleteDowntime(item.Id)); 151 } 401 } else if (item is Project) { 402 HiveServiceLocator.Instance.CallHiveService((s) => s.DeleteProject(item.Id)); 403 } 404 } 405 406 public static void DeleteJobs(List<Guid> jobIds) { 407 408 HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateJobStates(jobIds, JobState.StatisticsPending)); 152 409 } 153 410 #endregion … … 159 416 } 160 417 } 418 419 #region Helper 420 public IEnumerable<Project> GetAvailableProjectAncestors(Guid id) { 421 if (projectAncestors.ContainsKey(id)) return projects.Where(x => projectAncestors[id].Contains(x.Id)); 422 else return Enumerable.Empty<Project>(); 423 } 424 425 public IEnumerable<Project> GetAvailableProjectDescendants(Guid id) { 426 if(projectDescendants.ContainsKey(id)) return projects.Where(x => projectDescendants[id].Contains(x.Id)); 427 else return Enumerable.Empty<Project>(); 428 } 429 430 public IEnumerable<Resource> GetAvailableResourceAncestors(Guid id) { 431 if (resourceAncestors.ContainsKey(id)) return resources.Where(x => resourceAncestors[id].Contains(x.Id)); 432 else return Enumerable.Empty<Resource>(); 433 } 434 435 public IEnumerable<Resource> GetAvailableResourceDescendants(Guid id) { 436 if (resourceDescendants.ContainsKey(id)) return resources.Where(x => resourceDescendants[id].Contains(x.Id)); 437 else return Enumerable.Empty<Resource>(); 438 } 439 440 public bool CheckAccessToAdminAreaGranted() { 441 if(projects != null) { 442 return projects.Count > 0; 443 } else { 444 bool accessGranted = false; 445 HiveServiceLocator.Instance.CallHiveService(s => { 446 accessGranted = s.CheckAccessToAdminAreaGranted(); 447 }); 448 return accessGranted; 449 } 450 } 451 452 public bool CheckOwnershipOfResource(Resource res, Guid userId) { 453 if (res == null || userId == Guid.Empty) return false; 454 455 if (res.OwnerUserId == userId) { 456 return true; 457 } else if(resourceAncestors.ContainsKey(res.Id)) { 458 return GetAvailableResourceAncestors(res.Id).Where(x => x.OwnerUserId == userId).Any(); 459 } 460 461 return false; 462 } 463 464 public bool CheckOwnershipOfProject(Project pro, Guid userId) { 465 if (pro == null || userId == Guid.Empty) return false; 466 467 if (pro.OwnerUserId == userId) { 468 return true; 469 } else if (projectAncestors.ContainsKey(pro.Id)) { 470 return GetAvailableProjectAncestors(pro.Id).Where(x => x.OwnerUserId == userId).Any(); 471 } 472 473 return false; 474 } 475 476 public bool CheckOwnershipOfParentProject(Project pro, Guid userId) { 477 if (pro == null || userId == Guid.Empty) return false; 478 479 if(projectAncestors.ContainsKey(pro.Id)) { 480 return GetAvailableProjectAncestors(pro.Id).Where(x => x.OwnerUserId == userId).Any(); 481 } 482 483 return false; 484 } 485 486 public bool CheckParentChange(Project child, Project parent) { 487 bool changePossible = true; 488 489 // change is not possible... 490 // ... if the moved project is null 491 // ... or the new parent is not stored yet 492 // ... or there is not parental change 493 if (child == null 494 || (parent != null && parent.Id == Guid.Empty) 495 || (parent != null && parent.Id == child.ParentProjectId)) { 496 changePossible = false; 497 } else if(parent != null && projectDescendants.ContainsKey(child.Id)) { 498 // ... if the new parent is among the moved project's descendants 499 changePossible = !GetAvailableProjectDescendants(child.Id).Where(x => x.Id == parent.Id).Any(); 500 } 501 502 return changePossible; 503 } 504 505 public bool CheckParentChange(Resource child, Resource parent) { 506 bool changePossible = true; 507 508 // change is not possisble... 509 // ... if the child resource is null 510 // ... or the child resource equals the parent 511 // ... or the new parent is not stored yet 512 // ... or the new parent is a slave 513 // ... or there is not parental change 514 if (child == null 515 || child == parent 516 || (parent != null && parent.Id == Guid.Empty) 517 || (parent != null && parent is Slave) 518 || (parent != null && parent.Id == child.ParentResourceId)) { 519 changePossible = false; 520 } else if (parent != null && resourceDescendants.ContainsKey(child.Id)) { 521 // ... or if the new parent is among the moved resource's descendants 522 changePossible = !GetAvailableResourceDescendants(child.Id).Where(x => x.Id == parent.Id).Any(); 523 } 524 525 return changePossible; 526 } 527 #endregion 161 528 } 162 529 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r15583 r16139 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 57 57 } 58 58 59 private IItemList<Project> projects; 60 public IItemList<Project> Projects { 61 get { return projects; } 62 } 63 64 private IItemList<Resource> resources; 65 public IItemList<Resource> Resources { 66 get { return resources; } 67 } 68 69 private Dictionary<Guid, HashSet<Guid>> projectAncestors; 70 public Dictionary<Guid, HashSet<Guid>> ProjectAncestors { 71 get { return projectAncestors; } 72 } 73 74 private Dictionary<Guid, HashSet<Guid>> projectDescendants; 75 public Dictionary<Guid, HashSet<Guid>> ProjectDescendants { 76 get { return projectDescendants; } 77 } 78 79 private Dictionary<Guid, HashSet<Guid>> resourceAncestors; 80 public Dictionary<Guid, HashSet<Guid>> ResourceAncestors { 81 get { return resourceAncestors; } 82 } 83 84 private Dictionary<Guid, HashSet<Guid>> resourceDescendants; 85 public Dictionary<Guid, HashSet<Guid>> ResourceDescendants { 86 get { return resourceDescendants; } 87 } 88 89 private Dictionary<Guid, string> projectNames; 90 public Dictionary<Guid, string> ProjectNames { 91 get { return projectNames; } 92 } 93 94 private HashSet<Project> disabledParentProjects; 95 public HashSet<Project> DisabledParentProjects { 96 get { return disabledParentProjects; } 97 } 98 99 private Dictionary<Guid, string> resourceNames; 100 public Dictionary<Guid, string> ResourceNames { 101 get { return resourceNames; } 102 } 103 104 private HashSet<Resource> disabledParentResources; 105 public HashSet<Resource> DisabledParentResources { 106 get { return disabledParentResources; } 107 } 108 59 109 private List<Plugin> onlinePlugins; 60 110 public List<Plugin> OnlinePlugins { … … 93 143 94 144 try { 145 projects = new ItemList<Project>(); 146 resources = new ItemList<Resource>(); 95 147 jobs = new HiveItemCollection<RefreshableJob>(); 96 var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs()); 97 98 try { 99 foreach (var j in jobsLoaded) { 100 jobs.Add(new RefreshableJob(j)); 101 } 102 } catch (NullReferenceException) { 103 // jobs was set to null during ClearHiveClient 104 } 148 projectNames = new Dictionary<Guid, string>(); 149 resourceNames = new Dictionary<Guid, string>(); 150 151 projectAncestors = new Dictionary<Guid, HashSet<Guid>>(); 152 projectDescendants = new Dictionary<Guid, HashSet<Guid>>(); 153 resourceAncestors = new Dictionary<Guid, HashSet<Guid>>(); 154 resourceDescendants = new Dictionary<Guid, HashSet<Guid>>(); 155 156 HiveServiceLocator.Instance.CallHiveService(service => { 157 service.GetProjects().ForEach(p => projects.Add(p)); 158 service.GetSlaveGroups().ForEach(g => resources.Add(g)); 159 service.GetSlaves().ForEach(s => resources.Add(s)); 160 service.GetJobs().ForEach(p => jobs.Add(new RefreshableJob(p))); 161 projectNames = service.GetProjectNames(); 162 resourceNames = service.GetResourceNames(); 163 }); 164 165 RefreshResourceGenealogy(); 166 RefreshProjectGenealogy(); 167 RefreshDisabledParentProjects(); 168 RefreshDisabledParentResources(); 169 } 170 catch { 171 jobs = null; 172 projects = null; 173 resources = null; 174 throw; 175 } 176 finally { 177 OnRefreshed(); 178 } 179 } 180 181 public void RefreshProjectsAndResources() { 182 OnRefreshing(); 183 184 try { 185 projects = new ItemList<Project>(); 186 projectNames = new Dictionary<Guid, string>(); 187 resources = new ItemList<Resource>(); 188 resourceNames = new Dictionary<Guid, string>(); 189 190 projectAncestors = new Dictionary<Guid, HashSet<Guid>>(); 191 projectDescendants = new Dictionary<Guid, HashSet<Guid>>(); 192 resourceAncestors = new Dictionary<Guid, HashSet<Guid>>(); 193 resourceDescendants = new Dictionary<Guid, HashSet<Guid>>(); 194 195 HiveServiceLocator.Instance.CallHiveService(service => { 196 service.GetProjects().ForEach(p => projects.Add(p)); 197 service.GetSlaveGroups().ForEach(g => resources.Add(g)); 198 service.GetSlaves().ForEach(s => resources.Add(s)); 199 projectNames = service.GetProjectNames(); 200 resourceNames = service.GetResourceNames(); 201 }); 202 203 RefreshResourceGenealogy(); 204 RefreshProjectGenealogy(); 205 RefreshDisabledParentProjects(); 206 RefreshDisabledParentResources(); 105 207 } catch { 106 jobs = null; 208 projects = null; 209 resources = null; 107 210 throw; 108 211 } finally { 109 212 OnRefreshed(); 110 213 } 214 } 215 216 public void RefreshAsync(Action<Exception> exceptionCallback) { 217 var call = new Func<Exception>(delegate() { 218 try { 219 Refresh(); 220 } 221 catch (Exception ex) { 222 return ex; 223 } 224 return null; 225 }); 226 call.BeginInvoke(delegate(IAsyncResult result) { 227 Exception ex = call.EndInvoke(result); 228 if (ex != null) exceptionCallback(ex); 229 }, null); 230 } 231 232 private void RefreshResourceGenealogy() { 233 resourceAncestors.Clear(); 234 resourceDescendants.Clear(); 235 236 // fetch resource ancestor set 237 HiveServiceLocator.Instance.CallHiveService(service => { 238 var ra = service.GetResourceGenealogy(); 239 ra.Keys.ToList().ForEach(k => resourceAncestors.Add(k, new HashSet<Guid>())); 240 resourceAncestors.Keys.ToList().ForEach(k => resourceAncestors[k].UnionWith(ra[k])); 241 }); 242 243 // build resource descendant set 244 resourceAncestors.Keys.ToList().ForEach(k => resourceDescendants.Add(k, new HashSet<Guid>())); 245 foreach (var ra in resourceAncestors) { 246 foreach(var ancestor in ra.Value) { 247 resourceDescendants[ancestor].Add(ra.Key); 248 } 249 } 250 } 251 252 private void RefreshProjectGenealogy() { 253 projectAncestors.Clear(); 254 projectDescendants.Clear(); 255 256 // fetch project ancestor list 257 HiveServiceLocator.Instance.CallHiveService(service => { 258 var pa = service.GetProjectGenealogy(); 259 pa.Keys.ToList().ForEach(k => projectAncestors.Add(k, new HashSet<Guid>())); 260 projectAncestors.Keys.ToList().ForEach(k => projectAncestors[k].UnionWith(pa[k])); 261 }); 262 263 // build project descendant list 264 projectAncestors.Keys.ToList().ForEach(k => projectDescendants.Add(k, new HashSet<Guid>())); 265 foreach(var pa in projectAncestors) { 266 foreach(var ancestor in pa.Value) { 267 projectDescendants[ancestor].Add(pa.Key); 268 } 269 } 270 } 271 272 private void RefreshDisabledParentProjects() { 273 disabledParentProjects = new HashSet<Project>(); 274 275 foreach (var pid in projects 276 .Where(x => x.ParentProjectId.HasValue) 277 .SelectMany(x => projectAncestors[x.Id]).Distinct() 278 .Where(x => !projects.Select(y => y.Id).Contains(x))) { 279 var p = new Project(); 280 p.Id = pid; 281 p.ParentProjectId = projectAncestors[pid].FirstOrDefault(); 282 p.Name = projectNames[pid]; 283 disabledParentProjects.Add(p); 284 } 285 } 286 287 private void RefreshDisabledParentResources() { 288 disabledParentResources = new HashSet<Resource>(); 289 290 foreach (var rid in resources 291 .Where(x => x.ParentResourceId.HasValue) 292 .SelectMany(x => resourceAncestors[x.Id]).Distinct() 293 .Where(x => !resources.Select(y => y.Id).Contains(x))) { 294 var r = new SlaveGroup(); 295 r.Id = rid; 296 r.ParentResourceId = resourceAncestors[rid].FirstOrDefault(); 297 r.Name = resourceNames[rid]; 298 disabledParentResources.Add(r); 299 } 300 } 301 302 public IEnumerable<Project> GetAvailableProjectAncestors(Guid id) { 303 if (projectAncestors.ContainsKey(id)) return projects.Where(x => projectAncestors[id].Contains(x.Id)); 304 else return Enumerable.Empty<Project>(); 305 } 306 307 public IEnumerable<Project> GetAvailableProjectDescendants(Guid id) { 308 if (projectDescendants.ContainsKey(id)) return projects.Where(x => projectDescendants[id].Contains(x.Id)); 309 else return Enumerable.Empty<Project>(); 310 } 311 312 public IEnumerable<Resource> GetAvailableResourceAncestors(Guid id) { 313 if (resourceAncestors.ContainsKey(id)) return resources.Where(x => resourceAncestors[id].Contains(x.Id)); 314 else return Enumerable.Empty<Resource>(); 315 } 316 317 public IEnumerable<Resource> GetAvailableResourceDescendants(Guid id) { 318 if (resourceDescendants.ContainsKey(id)) return resources.Where(x => resourceDescendants[id].Contains(x.Id)); 319 else return Enumerable.Empty<Resource>(); 320 } 321 322 public IEnumerable<Resource> GetAvailableResourcesForProject(Guid id) { 323 var assignedProjectResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForProject(id)); 324 return resources.Where(x => assignedProjectResources.Select(y => y.ResourceId).Contains(x.Id)); 111 325 } 112 326 #endregion … … 116 330 if (item.Id == Guid.Empty) { 117 331 if (item is RefreshableJob) { 118 HiveClient.Instance.UploadJob((RefreshableJob)item, cancellationToken);332 item.Id = HiveClient.Instance.UploadJob((RefreshableJob)item, cancellationToken); 119 333 } 120 334 if (item is JobPermission) { … … 126 340 HiveServiceLocator.Instance.CallHiveService((s) => s.GrantPermission(hep.JobId, hep.GrantedUserId, hep.Permission)); 127 341 } 342 if (item is Project) { 343 item.Id = HiveServiceLocator.Instance.CallHiveService(s => s.AddProject((Project)item)); 344 } 128 345 } else { 129 if (item is Job) 130 HiveServiceLocator.Instance.CallHiveService(s => s.UpdateJob((Job)item)); 346 if (item is Job) { 347 var job = (Job)item; 348 HiveServiceLocator.Instance.CallHiveService(s => s.UpdateJob(job, job.ResourceIds)); 349 } 350 if (item is Project) 351 HiveServiceLocator.Instance.CallHiveService(s => s.UpdateProject((Project)item)); 131 352 } 132 353 } 133 354 public static void StoreAsync(Action<Exception> exceptionCallback, IHiveItem item, CancellationToken cancellationToken) { 134 var call = new Func<Exception>(delegate 355 var call = new Func<Exception>(delegate() { 135 356 try { 136 357 Store(item, cancellationToken); 137 } catch (Exception ex) { 358 } 359 catch (Exception ex) { 138 360 return ex; 139 361 } 140 362 return null; 141 363 }); 142 call.BeginInvoke(delegate 364 call.BeginInvoke(delegate(IAsyncResult result) { 143 365 Exception ex = call.EndInvoke(result); 144 366 if (ex != null) exceptionCallback(ex); … … 153 375 154 376 if (item is Job) 155 HiveServiceLocator.Instance.CallHiveService(s => s. DeleteJob(item.Id));377 HiveServiceLocator.Instance.CallHiveService(s => s.UpdateJobState(item.Id, JobState.StatisticsPending)); 156 378 if (item is RefreshableJob) { 157 379 RefreshableJob job = (RefreshableJob)item; … … 159 381 job.StopResultPolling(); 160 382 } 161 HiveServiceLocator.Instance.CallHiveService(s => s. DeleteJob(item.Id));383 HiveServiceLocator.Instance.CallHiveService(s => s.UpdateJobState(item.Id, JobState.StatisticsPending)); 162 384 } 163 385 if (item is JobPermission) { … … 227 449 } 228 450 451 public static void UpdateJob(Action<Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken) { 452 refreshableJob.IsProgressing = true; 453 refreshableJob.Progress.Status = "Saving Job..."; 454 HiveClient.StoreAsync( 455 new Action<Exception>((Exception ex) => { 456 exceptionCallback(ex); 457 }), refreshableJob.Job, cancellationToken); 458 refreshableJob.IsProgressing = false; 459 refreshableJob.Progress.Finish(); 460 } 461 462 public static void UpdateJob(RefreshableJob refreshableJob) { 463 refreshableJob.IsProgressing = true; 464 465 try { 466 refreshableJob.Progress.Start("Saving Job..."); 467 HiveClient.StoreAsync(new Action<Exception>((Exception ex) => { 468 throw new Exception("Update failed.", ex); 469 }), refreshableJob.Job, new CancellationToken()); 470 } finally { 471 refreshableJob.IsProgressing = false; 472 refreshableJob.Progress.Finish(); 473 } 474 } 475 476 477 229 478 #region Upload Job 230 479 private Semaphore taskUploadSemaphore = new Semaphore(Settings.Default.MaxParallelUploads, Settings.Default.MaxParallelUploads); 231 480 private static object jobCountLocker = new object(); 232 481 private static object pluginLocker = new object(); 233 private void UploadJob(RefreshableJob refreshableJob, CancellationToken cancellationToken) {482 private Guid UploadJob(RefreshableJob refreshableJob, CancellationToken cancellationToken) { 234 483 try { 235 484 refreshableJob.IsProgressing = true; 236 485 refreshableJob.Progress.Start("Connecting to server..."); 237 IEnumerable<string> resourceNames = ToResourceNameList(refreshableJob.Job.ResourceNames);238 var resourceIds = new List<Guid>();239 foreach (var resourceName in resourceNames) {240 Guid resourceId = HiveServiceLocator.Instance.CallHiveService((s) => s.GetResourceId(resourceName));241 if (resourceId == Guid.Empty) {242 throw new ResourceNotFoundException(string.Format("Could not find the resource '{0}'", resourceName));243 }244 resourceIds.Add(resourceId);245 }246 486 247 487 foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) { … … 251 491 // upload Job 252 492 refreshableJob.Progress.Status = "Uploading Job..."; 253 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job ));493 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job, refreshableJob.Job.ResourceIds)); 254 494 refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions 255 495 cancellationToken.ThrowIfCancellationRequested(); … … 273 513 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { 274 514 var task = TS.Task.Factory.StartNew((hj) => { 275 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds,jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken);515 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken); 276 516 }, hiveTask); 277 517 task.ContinueWith((x) => refreshableJob.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 279 519 } 280 520 TS.Task.WaitAll(tasks.ToArray()); 281 } finally { 521 } 522 finally { 282 523 refreshableJob.Job.Modified = false; 283 524 refreshableJob.IsProgressing = false; 284 525 refreshableJob.Progress.Finish(); 285 526 } 527 return (refreshableJob.Job != null) ? refreshableJob.Job.Id : Guid.Empty; 286 528 } 287 529 … … 317 559 /// </summary> 318 560 /// <param name="parentHiveTask">shall be null if its the root task</param> 319 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups,int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, CancellationToken cancellationToken) {561 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, CancellationToken cancellationToken) { 320 562 taskUploadSemaphore.WaitOne(); 321 563 bool semaphoreReleased = false; … … 356 598 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddChildTask(parentHiveTask.Task.Id, hiveTask.Task, taskData)); 357 599 } else { 358 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData , groups.ToList()));600 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData)); 359 601 } 360 602 } … … 371 613 var task = TS.Task.Factory.StartNew((tuple) => { 372 614 var arguments = (Tuple<HiveTask, HiveTask>)tuple; 373 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups,taskCount, totalJobCount, configPluginId, jobId, log, cancellationToken);615 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, taskCount, totalJobCount, configPluginId, jobId, log, cancellationToken); 374 616 }, new Tuple<HiveTask, HiveTask>(child, hiveTask)); 375 617 task.ContinueWith((x) => log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 426 668 } else if (refreshableJob.IsPaused()) { 427 669 refreshableJob.ExecutionState = Core.ExecutionState.Paused; 428 } else { 670 } else { 429 671 refreshableJob.ExecutionState = Core.ExecutionState.Started; 430 672 } 431 673 refreshableJob.OnLoaded(); 432 } finally { 674 } 675 finally { 433 676 refreshableJob.IsProgressing = false; 434 677 refreshableJob.Progress.Finish(); … … 467 710 try { 468 711 return PersistenceUtil.Deserialize<ItemTask>(taskData.Data); 469 } catch { 712 } 713 catch { 470 714 return null; 471 715 } … … 478 722 public static void TryAndRepeat(Action action, int repetitions, string errorMessage, ILog log = null) { 479 723 while (true) { 480 try { action(); return; } catch (Exception e) { 724 try { action(); return; } 725 catch (Exception e) { 481 726 if (repetitions == 0) throw new HiveException(errorMessage, e); 482 727 if (log != null) log.LogMessage(string.Format("{0}: {1} - will try again!", errorMessage, e.ToString())); … … 495 740 }); 496 741 } 742 743 public string GetProjectAncestry(Guid projectId) { 744 if (projectId == null || projectId == Guid.Empty) return ""; 745 var projects = projectAncestors[projectId].Reverse().ToList(); 746 projects.Add(projectId); 747 return string.Join(" » ", projects.Select(x => ProjectNames[x]).ToArray()); 748 } 497 749 } 498 750 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r14738 r16139 26 26 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.SlaveGroup))] 27 27 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))] 28 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Project))] 29 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.AssignedJobResource))] 28 30 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.JobPermission))] 29 31 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))] 30 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.ResourcePermission))] 32 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.ProjectPermission))] 33 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.AssignedProjectResource))] 31 34 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))] 32 35 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.UserPriority))] … … 211 214 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.SlaveGroup))] 212 215 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))] 216 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Project))] 213 217 public partial class NamedHiveItem : HeuristicLab.Clients.Hive.HiveItem 214 218 { … … 284 288 285 289 [System.Runtime.Serialization.OptionalFieldAttribute()] 286 private string ResourceNamesField; 290 private System.Guid ProjectIdField; 291 292 [System.Runtime.Serialization.OptionalFieldAttribute()] 293 private HeuristicLab.Clients.Hive.JobState StateField; 287 294 288 295 [System.Runtime.Serialization.DataMemberAttribute()] … … 406 413 407 414 [System.Runtime.Serialization.DataMemberAttribute()] 408 public string ResourceNames 409 { 410 get 411 { 412 return this.ResourceNamesField; 413 } 414 set 415 { 416 if ((object.ReferenceEquals(this.ResourceNamesField, value) != true)) 417 { 418 this.ResourceNamesField = value; 419 this.RaisePropertyChanged("ResourceNames"); 415 public System.Guid ProjectId 416 { 417 get 418 { 419 return this.ProjectIdField; 420 } 421 set 422 { 423 if ((this.ProjectIdField.Equals(value) != true)) 424 { 425 this.ProjectIdField = value; 426 this.RaisePropertyChanged("ProjectId"); 427 } 428 } 429 } 430 431 [System.Runtime.Serialization.DataMemberAttribute()] 432 public HeuristicLab.Clients.Hive.JobState State 433 { 434 get 435 { 436 return this.StateField; 437 } 438 set 439 { 440 if ((this.StateField.Equals(value) != true)) 441 { 442 this.StateField = value; 443 this.RaisePropertyChanged("State"); 420 444 } 421 445 } … … 839 863 [System.Diagnostics.DebuggerStepThroughAttribute()] 840 864 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 865 [System.Runtime.Serialization.DataContractAttribute(Name="Project", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 866 [System.SerializableAttribute()] 867 public partial class Project : HeuristicLab.Clients.Hive.NamedHiveItem 868 { 869 870 [System.Runtime.Serialization.OptionalFieldAttribute()] 871 private System.DateTime DateCreatedField; 872 873 [System.Runtime.Serialization.OptionalFieldAttribute()] 874 private System.Nullable<System.DateTime> EndDateField; 875 876 [System.Runtime.Serialization.OptionalFieldAttribute()] 877 private System.Guid OwnerUserIdField; 878 879 [System.Runtime.Serialization.OptionalFieldAttribute()] 880 private System.Nullable<System.Guid> ParentProjectIdField; 881 882 [System.Runtime.Serialization.OptionalFieldAttribute()] 883 private System.DateTime StartDateField; 884 885 [System.Runtime.Serialization.DataMemberAttribute()] 886 public System.DateTime DateCreated 887 { 888 get 889 { 890 return this.DateCreatedField; 891 } 892 set 893 { 894 if ((this.DateCreatedField.Equals(value) != true)) 895 { 896 this.DateCreatedField = value; 897 this.RaisePropertyChanged("DateCreated"); 898 } 899 } 900 } 901 902 [System.Runtime.Serialization.DataMemberAttribute()] 903 public System.Nullable<System.DateTime> EndDate 904 { 905 get 906 { 907 return this.EndDateField; 908 } 909 set 910 { 911 if ((this.EndDateField.Equals(value) != true)) 912 { 913 this.EndDateField = value; 914 this.RaisePropertyChanged("EndDate"); 915 } 916 } 917 } 918 919 [System.Runtime.Serialization.DataMemberAttribute()] 920 public System.Guid OwnerUserId 921 { 922 get 923 { 924 return this.OwnerUserIdField; 925 } 926 set 927 { 928 if ((this.OwnerUserIdField.Equals(value) != true)) 929 { 930 this.OwnerUserIdField = value; 931 this.RaisePropertyChanged("OwnerUserId"); 932 } 933 } 934 } 935 936 [System.Runtime.Serialization.DataMemberAttribute()] 937 public System.Nullable<System.Guid> ParentProjectId 938 { 939 get 940 { 941 return this.ParentProjectIdField; 942 } 943 set 944 { 945 if ((this.ParentProjectIdField.Equals(value) != true)) 946 { 947 this.ParentProjectIdField = value; 948 this.RaisePropertyChanged("ParentProjectId"); 949 } 950 } 951 } 952 953 [System.Runtime.Serialization.DataMemberAttribute()] 954 public System.DateTime StartDate 955 { 956 get 957 { 958 return this.StartDateField; 959 } 960 set 961 { 962 if ((this.StartDateField.Equals(value) != true)) 963 { 964 this.StartDateField = value; 965 this.RaisePropertyChanged("StartDate"); 966 } 967 } 968 } 969 } 970 971 [System.Diagnostics.DebuggerStepThroughAttribute()] 972 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 973 [System.Runtime.Serialization.DataContractAttribute(Name="AssignedJobResource", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 974 [System.SerializableAttribute()] 975 public partial class AssignedJobResource : HeuristicLab.Clients.Hive.HiveItem 976 { 977 978 [System.Runtime.Serialization.OptionalFieldAttribute()] 979 private System.Guid JobIdField; 980 981 [System.Runtime.Serialization.OptionalFieldAttribute()] 982 private System.Guid ResourceIdField; 983 984 [System.Runtime.Serialization.DataMemberAttribute()] 985 public System.Guid JobId 986 { 987 get 988 { 989 return this.JobIdField; 990 } 991 set 992 { 993 if ((this.JobIdField.Equals(value) != true)) 994 { 995 this.JobIdField = value; 996 this.RaisePropertyChanged("JobId"); 997 } 998 } 999 } 1000 1001 [System.Runtime.Serialization.DataMemberAttribute()] 1002 public System.Guid ResourceId 1003 { 1004 get 1005 { 1006 return this.ResourceIdField; 1007 } 1008 set 1009 { 1010 if ((this.ResourceIdField.Equals(value) != true)) 1011 { 1012 this.ResourceIdField = value; 1013 this.RaisePropertyChanged("ResourceId"); 1014 } 1015 } 1016 } 1017 } 1018 1019 [System.Diagnostics.DebuggerStepThroughAttribute()] 1020 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 841 1021 [System.Runtime.Serialization.DataContractAttribute(Name="JobPermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 842 1022 [System.SerializableAttribute()] … … 995 1175 [System.Diagnostics.DebuggerStepThroughAttribute()] 996 1176 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 997 [System.Runtime.Serialization.DataContractAttribute(Name=" ResourcePermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]1177 [System.Runtime.Serialization.DataContractAttribute(Name="ProjectPermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 998 1178 [System.SerializableAttribute()] 999 public partial class ResourcePermission : HeuristicLab.Clients.Hive.HiveItem1179 public partial class ProjectPermission : HeuristicLab.Clients.Hive.HiveItem 1000 1180 { 1001 1181 … … 1007 1187 1008 1188 [System.Runtime.Serialization.OptionalFieldAttribute()] 1009 private System.Guid ResourceIdField;1189 private System.Guid ProjectIdField; 1010 1190 1011 1191 [System.Runtime.Serialization.DataMemberAttribute()] … … 1039 1219 this.GrantedUserIdField = value; 1040 1220 this.RaisePropertyChanged("GrantedUserId"); 1221 } 1222 } 1223 } 1224 1225 [System.Runtime.Serialization.DataMemberAttribute()] 1226 public System.Guid ProjectId 1227 { 1228 get 1229 { 1230 return this.ProjectIdField; 1231 } 1232 set 1233 { 1234 if ((this.ProjectIdField.Equals(value) != true)) 1235 { 1236 this.ProjectIdField = value; 1237 this.RaisePropertyChanged("ProjectId"); 1238 } 1239 } 1240 } 1241 } 1242 1243 [System.Diagnostics.DebuggerStepThroughAttribute()] 1244 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1245 [System.Runtime.Serialization.DataContractAttribute(Name="AssignedProjectResource", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 1246 [System.SerializableAttribute()] 1247 public partial class AssignedProjectResource : HeuristicLab.Clients.Hive.HiveItem 1248 { 1249 1250 [System.Runtime.Serialization.OptionalFieldAttribute()] 1251 private System.Guid ProjectIdField; 1252 1253 [System.Runtime.Serialization.OptionalFieldAttribute()] 1254 private System.Guid ResourceIdField; 1255 1256 [System.Runtime.Serialization.DataMemberAttribute()] 1257 public System.Guid ProjectId 1258 { 1259 get 1260 { 1261 return this.ProjectIdField; 1262 } 1263 set 1264 { 1265 if ((this.ProjectIdField.Equals(value) != true)) 1266 { 1267 this.ProjectIdField = value; 1268 this.RaisePropertyChanged("ProjectId"); 1041 1269 } 1042 1270 } … … 1612 1840 [System.Runtime.Serialization.EnumMemberAttribute()] 1613 1841 Full = 2, 1842 } 1843 1844 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1845 [System.Runtime.Serialization.DataContractAttribute(Name="JobState", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 1846 public enum JobState : int 1847 { 1848 1849 [System.Runtime.Serialization.EnumMemberAttribute()] 1850 Online = 0, 1851 1852 [System.Runtime.Serialization.EnumMemberAttribute()] 1853 StatisticsPending = 1, 1854 1855 [System.Runtime.Serialization.EnumMemberAttribute()] 1856 DeletionPending = 2, 1614 1857 } 1615 1858 … … 2100 2343 2101 2344 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddTask", ReplyAction="http://tempuri.org/IHiveService/AddTaskResponse")] 2102 System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData , System.Collections.Generic.List<System.Guid> resourceIds);2345 System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData); 2103 2346 2104 2347 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddChildTask", ReplyAction="http://tempuri.org/IHiveService/AddChildTaskResponse")] … … 2141 2384 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobs(); 2142 2385 2386 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetJobsByProjectId", ReplyAction="http://tempuri.org/IHiveService/GetJobsByProjectIdResponse")] 2387 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectId(System.Guid projectId); 2388 2389 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetJobsByProjectIds", ReplyAction="http://tempuri.org/IHiveService/GetJobsByProjectIdsResponse")] 2390 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectIds(System.Collections.Generic.List<System.Guid> projectIds); 2391 2143 2392 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddJob", ReplyAction="http://tempuri.org/IHiveService/AddJobResponse")] 2144 System.Guid AddJob(HeuristicLab.Clients.Hive.Job jobDto );2393 System.Guid AddJob(HeuristicLab.Clients.Hive.Job jobDto, System.Collections.Generic.List<System.Guid> resourceIds); 2145 2394 2146 2395 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateJob", ReplyAction="http://tempuri.org/IHiveService/UpdateJobResponse")] 2147 void UpdateJob(HeuristicLab.Clients.Hive.Job jobDto); 2148 2149 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/DeleteJob", ReplyAction="http://tempuri.org/IHiveService/DeleteJobResponse")] 2150 void DeleteJob(System.Guid JobId); 2396 void UpdateJob(HeuristicLab.Clients.Hive.Job jobDto, System.Collections.Generic.List<System.Guid> resourceIds); 2397 2398 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateJobState", ReplyAction="http://tempuri.org/IHiveService/UpdateJobStateResponse")] 2399 void UpdateJobState(System.Guid JobId, HeuristicLab.Clients.Hive.JobState jobState); 2400 2401 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateJobStates", ReplyAction="http://tempuri.org/IHiveService/UpdateJobStatesResponse")] 2402 void UpdateJobStates(System.Collections.Generic.List<System.Guid> jobIds, HeuristicLab.Clients.Hive.JobState jobState); 2403 2404 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForJob", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForJobResponse")] 2405 System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedJobResource> GetAssignedResourcesForJob(System.Guid jobId); 2151 2406 2152 2407 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GrantPermission", ReplyAction="http://tempuri.org/IHiveService/GrantPermissionResponse")] … … 2184 2439 System.Collections.Generic.List<HeuristicLab.Clients.Hive.PluginData> GetPluginDatas(System.Collections.Generic.List<System.Guid> pluginIds); 2185 2440 2186 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GrantResourcePermissions", ReplyAction="http://tempuri.org/IHiveService/GrantResourcePermissionsResponse")] 2187 void GrantResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds); 2188 2189 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/RevokeResourcePermissions", ReplyAction="http://tempuri.org/IHiveService/RevokeResourcePermissionsResponse")] 2190 void RevokeResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds); 2191 2192 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetResourcePermissions", ReplyAction="http://tempuri.org/IHiveService/GetResourcePermissionsResponse")] 2193 System.Collections.Generic.List<HeuristicLab.Clients.Hive.ResourcePermission> GetResourcePermissions(System.Guid resourceId); 2441 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddProject", ReplyAction="http://tempuri.org/IHiveService/AddProjectResponse")] 2442 System.Guid AddProject(HeuristicLab.Clients.Hive.Project projectDto); 2443 2444 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateProject", ReplyAction="http://tempuri.org/IHiveService/UpdateProjectResponse")] 2445 void UpdateProject(HeuristicLab.Clients.Hive.Project projectDto); 2446 2447 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/DeleteProject", ReplyAction="http://tempuri.org/IHiveService/DeleteProjectResponse")] 2448 void DeleteProject(System.Guid projectId); 2449 2450 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProject", ReplyAction="http://tempuri.org/IHiveService/GetProjectResponse")] 2451 HeuristicLab.Clients.Hive.Project GetProject(System.Guid projectId); 2452 2453 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjects", ReplyAction="http://tempuri.org/IHiveService/GetProjectsResponse")] 2454 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjects(); 2455 2456 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectsForAdministration", ReplyAction="http://tempuri.org/IHiveService/GetProjectsForAdministrationResponse")] 2457 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjectsForAdministration(); 2458 2459 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectGenealogy", ReplyAction="http://tempuri.org/IHiveService/GetProjectGenealogyResponse")] 2460 System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetProjectGenealogy(); 2461 2462 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectNames", ReplyAction="http://tempuri.org/IHiveService/GetProjectNamesResponse")] 2463 System.Collections.Generic.Dictionary<System.Guid, string> GetProjectNames(); 2464 2465 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/SaveProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/SaveProjectPermissionsResponse")] 2466 void SaveProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading); 2467 2468 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/GetProjectPermissionsResponse")] 2469 System.Collections.Generic.List<HeuristicLab.Clients.Hive.ProjectPermission> GetProjectPermissions(System.Guid projectId); 2470 2471 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/SaveProjectResourceAssignments", ReplyAction="http://tempuri.org/IHiveService/SaveProjectResourceAssignmentsResponse")] 2472 void SaveProjectResourceAssignments(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading); 2473 2474 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForProject", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectResponse")] 2475 System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProject(System.Guid projectId); 2476 2477 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectAdministration", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectAdministrationRespo" + 2478 "nse")] 2479 System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProjectAdministration(System.Guid projectId); 2480 2481 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectsAdministration", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectsAdministrationResp" + 2482 "onse")] 2483 System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProjectsAdministration(System.Collections.Generic.List<System.Guid> projectIds); 2194 2484 2195 2485 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddSlave", ReplyAction="http://tempuri.org/IHiveService/AddSlaveResponse")] … … 2208 2498 System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroups(); 2209 2499 2500 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetSlavesForAdministration", ReplyAction="http://tempuri.org/IHiveService/GetSlavesForAdministrationResponse")] 2501 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Slave> GetSlavesForAdministration(); 2502 2503 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetSlaveGroupsForAdministration", ReplyAction="http://tempuri.org/IHiveService/GetSlaveGroupsForAdministrationResponse")] 2504 System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroupsForAdministration(); 2505 2506 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetResourceGenealogy", ReplyAction="http://tempuri.org/IHiveService/GetResourceGenealogyResponse")] 2507 System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetResourceGenealogy(); 2508 2509 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetResourceNames", ReplyAction="http://tempuri.org/IHiveService/GetResourceNamesResponse")] 2510 System.Collections.Generic.Dictionary<System.Guid, string> GetResourceNames(); 2511 2210 2512 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlave", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveResponse")] 2211 2513 void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave); … … 2252 2554 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetUserIdByUsername", ReplyAction="http://tempuri.org/IHiveService/GetUserIdByUsernameResponse")] 2253 2555 System.Guid GetUserIdByUsername(string username); 2556 2557 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetUserGroupTree", ReplyAction="http://tempuri.org/IHiveService/GetUserGroupTreeResponse")] 2558 System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetUserGroupTree(); 2559 2560 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/CheckAccessToAdminAreaGranted", ReplyAction="http://tempuri.org/IHiveService/CheckAccessToAdminAreaGrantedResponse")] 2561 bool CheckAccessToAdminAreaGranted(); 2254 2562 2255 2563 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetUserPriorities", ReplyAction="http://tempuri.org/IHiveService/GetUserPrioritiesResponse")] … … 2291 2599 } 2292 2600 2293 public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData , System.Collections.Generic.List<System.Guid> resourceIds)2294 { 2295 return base.Channel.AddTask(task, taskData , resourceIds);2601 public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData) 2602 { 2603 return base.Channel.AddTask(task, taskData); 2296 2604 } 2297 2605 … … 2361 2669 } 2362 2670 2363 public System.Guid AddJob(HeuristicLab.Clients.Hive.Job jobDto) 2364 { 2365 return base.Channel.AddJob(jobDto); 2366 } 2367 2368 public void UpdateJob(HeuristicLab.Clients.Hive.Job jobDto) 2369 { 2370 base.Channel.UpdateJob(jobDto); 2371 } 2372 2373 public void DeleteJob(System.Guid JobId) 2374 { 2375 base.Channel.DeleteJob(JobId); 2671 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectId(System.Guid projectId) 2672 { 2673 return base.Channel.GetJobsByProjectId(projectId); 2674 } 2675 2676 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetJobsByProjectIds(System.Collections.Generic.List<System.Guid> projectIds) 2677 { 2678 return base.Channel.GetJobsByProjectIds(projectIds); 2679 } 2680 2681 public System.Guid AddJob(HeuristicLab.Clients.Hive.Job jobDto, System.Collections.Generic.List<System.Guid> resourceIds) 2682 { 2683 return base.Channel.AddJob(jobDto, resourceIds); 2684 } 2685 2686 public void UpdateJob(HeuristicLab.Clients.Hive.Job jobDto, System.Collections.Generic.List<System.Guid> resourceIds) 2687 { 2688 base.Channel.UpdateJob(jobDto, resourceIds); 2689 } 2690 2691 public void UpdateJobState(System.Guid JobId, HeuristicLab.Clients.Hive.JobState jobState) 2692 { 2693 base.Channel.UpdateJobState(JobId, jobState); 2694 } 2695 2696 public void UpdateJobStates(System.Collections.Generic.List<System.Guid> jobIds, HeuristicLab.Clients.Hive.JobState jobState) 2697 { 2698 base.Channel.UpdateJobStates(jobIds, jobState); 2699 } 2700 2701 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedJobResource> GetAssignedResourcesForJob(System.Guid jobId) 2702 { 2703 return base.Channel.GetAssignedResourcesForJob(jobId); 2376 2704 } 2377 2705 … … 2431 2759 } 2432 2760 2433 public void GrantResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds) 2434 { 2435 base.Channel.GrantResourcePermissions(resourceId, grantedUserIds); 2436 } 2437 2438 public void RevokeResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds) 2439 { 2440 base.Channel.RevokeResourcePermissions(resourceId, grantedUserIds); 2441 } 2442 2443 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.ResourcePermission> GetResourcePermissions(System.Guid resourceId) 2444 { 2445 return base.Channel.GetResourcePermissions(resourceId); 2761 public System.Guid AddProject(HeuristicLab.Clients.Hive.Project projectDto) 2762 { 2763 return base.Channel.AddProject(projectDto); 2764 } 2765 2766 public void UpdateProject(HeuristicLab.Clients.Hive.Project projectDto) 2767 { 2768 base.Channel.UpdateProject(projectDto); 2769 } 2770 2771 public void DeleteProject(System.Guid projectId) 2772 { 2773 base.Channel.DeleteProject(projectId); 2774 } 2775 2776 public HeuristicLab.Clients.Hive.Project GetProject(System.Guid projectId) 2777 { 2778 return base.Channel.GetProject(projectId); 2779 } 2780 2781 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjects() 2782 { 2783 return base.Channel.GetProjects(); 2784 } 2785 2786 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjectsForAdministration() 2787 { 2788 return base.Channel.GetProjectsForAdministration(); 2789 } 2790 2791 public System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetProjectGenealogy() 2792 { 2793 return base.Channel.GetProjectGenealogy(); 2794 } 2795 2796 public System.Collections.Generic.Dictionary<System.Guid, string> GetProjectNames() 2797 { 2798 return base.Channel.GetProjectNames(); 2799 } 2800 2801 public void SaveProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading) 2802 { 2803 base.Channel.SaveProjectPermissions(projectId, grantedUserIds, reassign, cascading, reassignCascading); 2804 } 2805 2806 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.ProjectPermission> GetProjectPermissions(System.Guid projectId) 2807 { 2808 return base.Channel.GetProjectPermissions(projectId); 2809 } 2810 2811 public void SaveProjectResourceAssignments(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading) 2812 { 2813 base.Channel.SaveProjectResourceAssignments(projectId, resourceIds, reassign, cascading, reassignCascading); 2814 } 2815 2816 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProject(System.Guid projectId) 2817 { 2818 return base.Channel.GetAssignedResourcesForProject(projectId); 2819 } 2820 2821 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProjectAdministration(System.Guid projectId) 2822 { 2823 return base.Channel.GetAssignedResourcesForProjectAdministration(projectId); 2824 } 2825 2826 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProjectsAdministration(System.Collections.Generic.List<System.Guid> projectIds) 2827 { 2828 return base.Channel.GetAssignedResourcesForProjectsAdministration(projectIds); 2446 2829 } 2447 2830 … … 2471 2854 } 2472 2855 2856 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Slave> GetSlavesForAdministration() 2857 { 2858 return base.Channel.GetSlavesForAdministration(); 2859 } 2860 2861 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroupsForAdministration() 2862 { 2863 return base.Channel.GetSlaveGroupsForAdministration(); 2864 } 2865 2866 public System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetResourceGenealogy() 2867 { 2868 return base.Channel.GetResourceGenealogy(); 2869 } 2870 2871 public System.Collections.Generic.Dictionary<System.Guid, string> GetResourceNames() 2872 { 2873 return base.Channel.GetResourceNames(); 2874 } 2875 2473 2876 public void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave) 2474 2877 { … … 2546 2949 } 2547 2950 2951 public System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetUserGroupTree() 2952 { 2953 return base.Channel.GetUserGroupTree(); 2954 } 2955 2956 public bool CheckAccessToAdminAreaGranted() 2957 { 2958 return base.Channel.CheckAccessToAdminAreaGranted(); 2959 } 2960 2548 2961 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.UserPriority> GetUserPriorities() 2549 2962 { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs
r15583 r16139 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.ComponentModel; 24 25 using HeuristicLab.Common; … … 26 27 namespace HeuristicLab.Clients.Hive { 27 28 public partial class Job : IDeepCloneable, IContent { 29 public List<Guid> ResourceIds { get; set; } 28 30 29 31 #region Constructors and Cloning 30 32 public Job() { 31 ResourceNames = "HEAL";33 ProjectId = Guid.Empty; 32 34 DateCreated = DateTime.Now; 33 35 Permission = Permission.Full; … … 38 40 this.OwnerUserId = original.OwnerUserId; 39 41 this.DateCreated = original.DateCreated; 40 this. ResourceNames = original.ResourceNames;42 this.ProjectId = original.ProjectId; 41 43 this.Name = original.Name; 42 44 this.Description = original.Description; 43 45 this.Id = original.Id; 44 46 this.Permission = original.Permission; 47 this.ResourceIds = original.ResourceIds; 45 48 } 46 49 public override IDeepCloneable Clone(Cloner cloner) { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/ServiceClients/ResourcePermission.cs
r15583 r16139 24 24 25 25 namespace HeuristicLab.Clients.Hive { 26 public partial class ResourcePermission : IDeepCloneable, IContent {26 public partial class ProjectPermission : IDeepCloneable, IContent { 27 27 28 28 private string grantedUserName; … … 41 41 } 42 42 43 public ResourcePermission() { }43 public ProjectPermission() { } 44 44 45 45 protected override void OnPropertyChanged(PropertyChangedEventArgs e) { … … 50 50 } 51 51 52 protected ResourcePermission(ResourcePermission original, Cloner cloner)52 protected ProjectPermission(ProjectPermission original, Cloner cloner) 53 53 : base(original, cloner) { 54 54 this.GrantedByUserId = original.GrantedByUserId; 55 55 this.GrantedUserId = original.GrantedUserId; 56 this. ResourceId = original.ResourceId;56 this.ProjectId = original.ProjectId; 57 57 } 58 58 59 59 public override IDeepCloneable Clone(Cloner cloner) { 60 return new ResourcePermission(this, cloner);60 return new ProjectPermission(this, cloner); 61 61 } 62 62 -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Clients.Hive/3.3/app.config
r15361 r16139 71 71 </bindings> 72 72 <client> 73 <endpoint address="http://services.heuristiclab.com/Hive-3. 3/HiveService.svc"73 <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" 74 74 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService" 75 75 contract="HeuristicLab.Clients.Hive.IHiveService" name="WSHttpBinding_IHiveService"> … … 78 78 </identity> 79 79 </endpoint> 80 <endpoint address="net.tcp://services.heuristiclab.com/Hive-3. 3/HiveService.svc"80 <endpoint address="net.tcp://services.heuristiclab.com/Hive-3.4/HiveService.svc" 81 81 binding="netTcpBinding" bindingConfiguration="NetBinding_IHiveService" 82 82 contract="HeuristicLab.Clients.Hive.IHiveService" name="NetBinding_IHiveService">
Note: See TracChangeset
for help on using the changeset viewer.