- Timestamp:
- 09/02/15 13:16:18 (9 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r12579 r12931 68 68 set { alreadyUploadedPlugins = value; } 69 69 } 70 71 private bool isAllowedPrivileged;72 public bool IsAllowedPrivileged {73 get { return isAllowedPrivileged; }74 set { isAllowedPrivileged = value; }75 }76 70 #endregion 77 71 … … 99 93 100 94 try { 101 IsAllowedPrivileged = HiveServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());102 103 95 jobs = new HiveItemCollection<RefreshableJob>(); 104 96 var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs()); … … 275 267 refreshableJob.Progress.Status = "Uploading Job..."; 276 268 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job)); 277 bool isPrivileged = refreshableJob.Job.IsPrivileged;278 269 refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions 279 refreshableJob.Job.IsPrivileged = isPrivileged;280 270 cancellationToken.ThrowIfCancellationRequested(); 281 271 … … 298 288 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { 299 289 var task = TS.Task.Factory.StartNew((hj) => { 300 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, refreshableJob.Job.IsPrivileged,cancellationToken);290 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken); 301 291 }, hiveTask); 302 292 task.ContinueWith((x) => refreshableJob.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 343 333 /// </summary> 344 334 /// <param name="parentHiveTask">shall be null if its the root task</param> 345 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged,CancellationToken cancellationToken) {335 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, CancellationToken cancellationToken) { 346 336 taskUploadSemaphore.WaitOne(); 347 337 bool semaphoreReleased = false; … … 375 365 hiveTask.Task.PluginsNeededIds.Add(configPluginId); 376 366 hiveTask.Task.JobId = jobId; 377 hiveTask.Task.IsPrivileged = isPrivileged;378 367 379 368 log.LogMessage(string.Format("Uploading task ({0} kb, {1} objects)", taskData.Data.Count() / 1024, hiveTask.ItemTask.GetObjectGraphObjects().Count())); … … 398 387 var task = TS.Task.Factory.StartNew((tuple) => { 399 388 var arguments = (Tuple<HiveTask, HiveTask>)tuple; 400 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups, taskCount, totalJobCount, configPluginId, jobId, log, isPrivileged,cancellationToken);389 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups, taskCount, totalJobCount, configPluginId, jobId, log, cancellationToken); 401 390 }, new Tuple<HiveTask, HiveTask>(child, hiveTask)); 402 391 task.ContinueWith((x) => log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 442 431 IDictionary<Guid, HiveTask> allHiveTasks = downloader.Results; 443 432 var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue); 444 refreshableJob.Job.IsPrivileged = allHiveTasks.Any(x => x.Value.Task.IsPrivileged);445 433 446 434 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks..."; -
branches/crossvalidation-2434/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r9219 r12931 351 351 352 352 [System.Runtime.Serialization.OptionalFieldAttribute()] 353 private bool IsPrivilegedField;354 355 [System.Runtime.Serialization.OptionalFieldAttribute()]356 353 private System.Guid JobIdField; 357 354 … … 415 412 this.IsParentTaskField = value; 416 413 this.RaisePropertyChanged("IsParentTask"); 417 }418 }419 }420 421 [System.Runtime.Serialization.DataMemberAttribute()]422 public bool IsPrivileged423 {424 get425 {426 return this.IsPrivilegedField;427 }428 set429 {430 if ((this.IsPrivilegedField.Equals(value) != true))431 {432 this.IsPrivilegedField = value;433 this.RaisePropertyChanged("IsPrivileged");434 414 } 435 415 } … … 2553 2533 System.Collections.Generic.List<HeuristicLab.Clients.Hive.JobPermission> GetJobPermissions(System.Guid jobId); 2554 2534 2555 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/IsAllowedPrivileged", ReplyAction="http://tempuri.org/IHiveService/IsAllowedPrivilegedResponse")]2556 bool IsAllowedPrivileged();2557 2558 2535 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/Hello", ReplyAction="http://tempuri.org/IHiveService/HelloResponse")] 2559 2536 void Hello(HeuristicLab.Clients.Hive.Slave slave); … … 2882 2859 } 2883 2860 2884 public bool IsAllowedPrivileged()2885 {2886 return base.Channel.IsAllowedPrivileged();2887 }2888 2889 2861 public void Hello(HeuristicLab.Clients.Hive.Slave slave) 2890 2862 { -
branches/crossvalidation-2434/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs
r12012 r12931 27 27 public partial class Job : IDeepCloneable, IContent { 28 28 29 private bool isPrivileged;30 public bool IsPrivileged {31 get { return isPrivileged; }32 set { isPrivileged = value; }33 }34 35 29 #region Constructors and Cloning 36 30 public Job() { … … 48 42 this.Description = original.Description; 49 43 this.Id = original.Id; 50 this.IsPrivileged = original.IsPrivileged;51 44 this.Permission = original.Permission; 52 45 } -
branches/crossvalidation-2434/HeuristicLab.Clients.Hive/3.3/ServiceClients/Task.cs
r12012 r12931 43 43 this.FinishWhenChildJobsFinished = original.FinishWhenChildJobsFinished; 44 44 this.JobId = original.JobId; 45 this.IsPrivileged = original.IsPrivileged;46 45 } 47 46
Note: See TracChangeset
for help on using the changeset viewer.