- Timestamp:
- 10/07/17 10:32:07 (7 years ago)
- Location:
- branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r15401 r15412 255 255 refreshableJob.IsProgressing = true; 256 256 refreshableJob.Progress.Start("Connecting to server..."); 257 IEnumerable<string> resourceNames = ToResourceNameList("");258 var resourceIds = new List<Guid>();259 foreach (var resourceName in resourceNames) {260 Guid resourceId = HiveServiceLocator.Instance.CallHiveService((s) => s.GetResourceId(resourceName));261 if (resourceId == Guid.Empty) {262 throw new ResourceNotFoundException(string.Format("Could not find the resource '{0}'", resourceName));263 }264 resourceIds.Add(resourceId);265 }266 257 267 258 foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) { … … 293 284 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { 294 285 var task = TS.Task.Factory.StartNew((hj) => { 295 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, re sourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken);286 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, refreshableJob.Job.ResourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken); 296 287 }, hiveTask); 297 288 task.ContinueWith((x) => refreshableJob.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 377 368 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddChildTask(parentHiveTask.Task.Id, hiveTask.Task, taskData)); 378 369 } else { 379 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData ));370 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData, groups.ToList())); 380 371 } 381 372 } -
branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r15401 r15412 30 30 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))] 31 31 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.ProjectPermission))] 32 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.AssignedProjectResource))] 32 33 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))] 33 34 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.UserPriority))] … … 1166 1167 this.ProjectIdField = value; 1167 1168 this.RaisePropertyChanged("ProjectId"); 1169 } 1170 } 1171 } 1172 } 1173 1174 [System.Diagnostics.DebuggerStepThroughAttribute()] 1175 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1176 [System.Runtime.Serialization.DataContractAttribute(Name="AssignedProjectResource", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 1177 [System.SerializableAttribute()] 1178 public partial class AssignedProjectResource : HeuristicLab.Clients.Hive.HiveItem 1179 { 1180 1181 [System.Runtime.Serialization.OptionalFieldAttribute()] 1182 private System.Guid ProjectIdField; 1183 1184 [System.Runtime.Serialization.OptionalFieldAttribute()] 1185 private System.Guid ResourceIdField; 1186 1187 [System.Runtime.Serialization.DataMemberAttribute()] 1188 public System.Guid ProjectId 1189 { 1190 get 1191 { 1192 return this.ProjectIdField; 1193 } 1194 set 1195 { 1196 if ((this.ProjectIdField.Equals(value) != true)) 1197 { 1198 this.ProjectIdField = value; 1199 this.RaisePropertyChanged("ProjectId"); 1200 } 1201 } 1202 } 1203 1204 [System.Runtime.Serialization.DataMemberAttribute()] 1205 public System.Guid ResourceId 1206 { 1207 get 1208 { 1209 return this.ResourceIdField; 1210 } 1211 set 1212 { 1213 if ((this.ResourceIdField.Equals(value) != true)) 1214 { 1215 this.ResourceIdField = value; 1216 this.RaisePropertyChanged("ResourceId"); 1168 1217 } 1169 1218 } … … 2210 2259 2211 2260 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddTask", ReplyAction="http://tempuri.org/IHiveService/AddTaskResponse")] 2212 System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData );2261 System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData, System.Collections.Generic.List<System.Guid> resourceIds); 2213 2262 2214 2263 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddChildTask", ReplyAction="http://tempuri.org/IHiveService/AddChildTaskResponse")] … … 2318 2367 System.Collections.Generic.List<HeuristicLab.Clients.Hive.ProjectPermission> GetProjectPermissions(System.Guid projectId); 2319 2368 2369 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AssignProjectResources", ReplyAction="http://tempuri.org/IHiveService/AssignProjectResourcesResponse")] 2370 void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds); 2371 2372 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UnassignProjectResources", ReplyAction="http://tempuri.org/IHiveService/UnassignProjectResourcesResponse")] 2373 void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds); 2374 2375 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForProject", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectResponse")] 2376 System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProject(System.Guid projectId); 2377 2320 2378 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddSlave", ReplyAction="http://tempuri.org/IHiveService/AddSlaveResponse")] 2321 2379 System.Guid AddSlave(HeuristicLab.Clients.Hive.Slave slave); … … 2416 2474 } 2417 2475 2418 public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData )2419 { 2420 return base.Channel.AddTask(task, taskData );2476 public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData, System.Collections.Generic.List<System.Guid> resourceIds) 2477 { 2478 return base.Channel.AddTask(task, taskData, resourceIds); 2421 2479 } 2422 2480 … … 2596 2654 } 2597 2655 2656 public void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds) 2657 { 2658 base.Channel.AssignProjectResources(projectId, resourceIds); 2659 } 2660 2661 public void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds) 2662 { 2663 base.Channel.UnassignProjectResources(projectId, resourceIds); 2664 } 2665 2666 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProject(System.Guid projectId) 2667 { 2668 return base.Channel.GetAssignedResourcesForProject(projectId); 2669 } 2670 2598 2671 public System.Guid AddSlave(HeuristicLab.Clients.Hive.Slave slave) 2599 2672 { -
branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs
r15401 r15412 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 … … 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) {
Note: See TracChangeset
for help on using the changeset viewer.