- Timestamp:
- 09/08/11 14:37:52 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r6721 r6723 86 86 var oldExperiments = hiveExperiments ?? new ItemCollection<RefreshableHiveExperiment>(); 87 87 hiveExperiments = new HiveItemCollection<RefreshableHiveExperiment>(); 88 var experimentsLoaded = ServiceLocator.Instance.CallHiveService<IEnumerable< HiveExperiment>>(s => s.GetHiveExperiments());88 var experimentsLoaded = ServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetHiveExperiments()); 89 89 90 90 foreach (var he in experimentsLoaded) { … … 141 141 HiveClient.Instance.UploadExperiment((RefreshableHiveExperiment)item, cancellationToken); 142 142 } 143 if (item is HiveExperimentPermission) {144 var hep = ( HiveExperimentPermission)item;143 if (item is JobPermission) { 144 var hep = (JobPermission)item; 145 145 hep.GrantedUserId = ServiceLocator.Instance.CallHiveService((s) => s.GetUserIdByUsername(hep.GrantedUserName)); 146 146 if (hep.GrantedUserId == Guid.Empty) { 147 147 throw new ArgumentException(string.Format("The user {0} was not found.", hep.GrantedUserName)); 148 148 } 149 ServiceLocator.Instance.CallHiveService((s) => s.GrantPermission(hep. HiveExperimentId, hep.GrantedUserId, hep.Permission));149 ServiceLocator.Instance.CallHiveService((s) => s.GrantPermission(hep.JobId, hep.GrantedUserId, hep.Permission)); 150 150 } 151 151 } else { 152 if (item is HiveExperiment)153 ServiceLocator.Instance.CallHiveService(s => s.UpdateHiveExperiment(( HiveExperiment)item));152 if (item is Job) 153 ServiceLocator.Instance.CallHiveService(s => s.UpdateHiveExperiment((Job)item)); 154 154 } 155 155 } … … 176 176 return; 177 177 178 if (item is HiveExperiment)178 if (item is Job) 179 179 ServiceLocator.Instance.CallHiveService(s => s.DeleteHiveExperiment(item.Id)); 180 180 if (item is RefreshableHiveExperiment) 181 181 ServiceLocator.Instance.CallHiveService(s => s.DeleteHiveExperiment(item.Id)); 182 if (item is HiveExperimentPermission) {183 var hep = ( HiveExperimentPermission)item;184 ServiceLocator.Instance.CallHiveService(s => s.RevokePermission(hep. HiveExperimentId, hep.GrantedUserId));182 if (item is JobPermission) { 183 var hep = (JobPermission)item; 184 ServiceLocator.Instance.CallHiveService(s => s.RevokePermission(hep.JobId, hep.GrantedUserId)); 185 185 } 186 186 item.Id = Guid.Empty; … … 258 258 } 259 259 260 // upload HiveExperiment261 refreshableHiveExperiment.Progress.Status = "Uploading HiveExperiment...";260 // upload Job 261 refreshableHiveExperiment.Progress.Status = "Uploading Job..."; 262 262 refreshableHiveExperiment.HiveExperiment.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddHiveExperiment(refreshableHiveExperiment.HiveExperiment)); 263 263 bool isPrivileged = refreshableHiveExperiment.HiveExperiment.IsPrivileged; … … 365 365 cancellationToken.ThrowIfCancellationRequested(); 366 366 hiveJob.Job.PluginsNeededIds.Add(configPluginId); 367 hiveJob.Job. HiveExperimentId = hiveExperimentId;367 hiveJob.Job.JobId = hiveExperimentId; 368 368 hiveJob.Job.IsPrivileged = isPrivileged; 369 369 … … 506 506 } 507 507 508 public static HiveItemCollection< HiveExperimentPermission> GetHiveExperimentPermissions(Guid hiveExperimentId) {508 public static HiveItemCollection<JobPermission> GetHiveExperimentPermissions(Guid hiveExperimentId) { 509 509 return ServiceLocator.Instance.CallHiveService((service) => { 510 IEnumerable< HiveExperimentPermission> heps = service.GetHiveExperimentPermissions(hiveExperimentId);510 IEnumerable<JobPermission> heps = service.GetHiveExperimentPermissions(hiveExperimentId); 511 511 foreach (var hep in heps) { 512 512 hep.GrantedUserName = service.GetUsernameByUserId(hep.GrantedUserId); 513 513 } 514 return new HiveItemCollection< HiveExperimentPermission>(heps);514 return new HiveItemCollection<JobPermission>(heps); 515 515 }); 516 516 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/RefreshableHiveExperiment.cs
r6721 r6723 35 35 private static object locker = new object(); 36 36 37 private HiveExperimenthiveExperiment;38 public HiveExperimentHiveExperiment {37 private Job hiveExperiment; 38 public Job HiveExperiment { 39 39 get { return hiveExperiment; } 40 40 set { … … 192 192 public RefreshableHiveExperiment() { 193 193 this.refreshAutomatically = true; 194 this.HiveExperiment = new HiveExperiment();194 this.HiveExperiment = new Job(); 195 195 this.log = new ThreadSafeLog(new Log()); 196 196 this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2); … … 198 198 this.HiveJobs = new ItemCollection<HiveJob>(); 199 199 } 200 public RefreshableHiveExperiment( HiveExperimenthiveExperiment) {200 public RefreshableHiveExperiment(Job hiveExperiment) { 201 201 this.refreshAutomatically = true; 202 202 this.HiveExperiment = hiveExperiment; … … 350 350 #endregion 351 351 352 #region HiveExperimentEvents352 #region Job Events 353 353 private void RegisterHiveExperimentEvents() { 354 354 hiveExperiment.ToStringChanged += new EventHandler(OnToStringChanged); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveExperiment.cs
r6479 r6723 25 25 26 26 namespace HeuristicLab.Clients.Hive { 27 public partial class HiveExperiment: IDeepCloneable, IContent {27 public partial class Job : IDeepCloneable, IContent { 28 28 29 29 private bool isPrivileged; … … 34 34 35 35 #region Constructors and Cloning 36 public HiveExperiment() {36 public Job() { 37 37 this.ResourceNames = "HEAL"; 38 38 this.DateCreated = DateTime.Now; … … 40 40 } 41 41 42 protected HiveExperiment(HiveExperimentoriginal, Cloner cloner) {42 protected Job(Job original, Cloner cloner) { 43 43 cloner.RegisterClonedObject(original, this); 44 44 this.OwnerUserId = original.OwnerUserId; … … 53 53 } 54 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new HiveExperiment(this, cloner);55 return new Job(this, cloner); 56 56 } 57 57 #endregion -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveExperimentPermission.cs
r6479 r6723 24 24 25 25 namespace HeuristicLab.Clients.Hive { 26 public partial class HiveExperimentPermission : IDeepCloneable, IContent {26 public partial class JobPermission : IDeepCloneable, IContent { 27 27 28 28 private string grantedUserName; … … 38 38 39 39 #region Constructors and Cloning 40 public HiveExperimentPermission() {40 public JobPermission() { 41 41 this.Permission = Permission.Read; 42 42 this.PropertyChanged += new PropertyChangedEventHandler(HiveExperimentPermission_PropertyChanged); 43 43 } 44 44 45 protected HiveExperimentPermission(HiveExperimentPermission original, Cloner cloner)45 protected JobPermission(JobPermission original, Cloner cloner) 46 46 : base(original, cloner) { 47 47 this.GrantedByUserId = original.GrantedByUserId; 48 48 this.GrantedUserId = original.GrantedUserId; 49 this. HiveExperimentId = original.HiveExperimentId;49 this.JobId = original.JobId; 50 50 this.Permission = original.Permission; 51 51 } 52 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new HiveExperimentPermission(this, cloner);53 return new JobPermission(this, cloner); 54 54 } 55 55 #endregion -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r6721 r6723 20 20 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Task))] 21 21 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))] 22 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive. HiveExperimentPermission))]22 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.JobPermission))] 23 23 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))] 24 24 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.NamedHiveItem))] 25 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive. HiveExperiment))]25 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))] 26 26 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))] 27 27 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Resource))] … … 281 281 282 282 [System.Runtime.Serialization.OptionalFieldAttribute()] 283 private System.Guid HiveExperimentIdField;284 285 [System.Runtime.Serialization.OptionalFieldAttribute()]286 283 private bool IsParentJobField; 287 284 288 285 [System.Runtime.Serialization.OptionalFieldAttribute()] 289 286 private bool IsPrivilegedField; 287 288 [System.Runtime.Serialization.OptionalFieldAttribute()] 289 private System.Guid JobIdField; 290 290 291 291 [System.Runtime.Serialization.OptionalFieldAttribute()] … … 328 328 329 329 [System.Runtime.Serialization.DataMemberAttribute()] 330 public System.Guid HiveExperimentId {331 get {332 return this.HiveExperimentIdField;333 }334 set {335 if ((this.HiveExperimentIdField.Equals(value) != true)) {336 this.HiveExperimentIdField = value;337 this.RaisePropertyChanged("HiveExperimentId");338 }339 }340 }341 342 [System.Runtime.Serialization.DataMemberAttribute()]343 330 public bool IsParentJob { 344 331 get { … … 367 354 368 355 [System.Runtime.Serialization.DataMemberAttribute()] 356 public System.Guid JobId { 357 get { 358 return this.JobIdField; 359 } 360 set { 361 if ((this.JobIdField.Equals(value) != true)) { 362 this.JobIdField = value; 363 this.RaisePropertyChanged("JobId"); 364 } 365 } 366 } 367 368 [System.Runtime.Serialization.DataMemberAttribute()] 369 369 public System.Nullable<System.DateTime> LastHeartbeat { 370 370 get { … … 524 524 [System.Diagnostics.DebuggerStepThroughAttribute()] 525 525 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 526 [System.Runtime.Serialization.DataContractAttribute(Name = " HiveExperimentPermission", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]526 [System.Runtime.Serialization.DataContractAttribute(Name = "JobPermission", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 527 527 [System.SerializableAttribute()] 528 public partial class HiveExperimentPermission : HeuristicLab.Clients.Hive.HiveItem {528 public partial class JobPermission : HeuristicLab.Clients.Hive.HiveItem { 529 529 530 530 [System.Runtime.Serialization.OptionalFieldAttribute()] … … 535 535 536 536 [System.Runtime.Serialization.OptionalFieldAttribute()] 537 private System.Guid HiveExperimentIdField;537 private System.Guid JobIdField; 538 538 539 539 [System.Runtime.Serialization.OptionalFieldAttribute()] … … 567 567 568 568 [System.Runtime.Serialization.DataMemberAttribute()] 569 public System.Guid HiveExperimentId {570 get { 571 return this. HiveExperimentIdField;572 } 573 set { 574 if ((this. HiveExperimentIdField.Equals(value) != true)) {575 this. HiveExperimentIdField = value;576 this.RaisePropertyChanged(" HiveExperimentId");569 public System.Guid JobId { 570 get { 571 return this.JobIdField; 572 } 573 set { 574 if ((this.JobIdField.Equals(value) != true)) { 575 this.JobIdField = value; 576 this.RaisePropertyChanged("JobId"); 577 577 } 578 578 } … … 652 652 [System.Runtime.Serialization.DataContractAttribute(Name = "NamedHiveItem", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 653 653 [System.SerializableAttribute()] 654 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive. HiveExperiment))]654 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))] 655 655 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))] 656 656 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Resource))] … … 694 694 [System.Diagnostics.DebuggerStepThroughAttribute()] 695 695 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 696 [System.Runtime.Serialization.DataContractAttribute(Name = " HiveExperiment", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]696 [System.Runtime.Serialization.DataContractAttribute(Name = "Job", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 697 697 [System.SerializableAttribute()] 698 public partial class HiveExperiment: HeuristicLab.Clients.Hive.NamedHiveItem {698 public partial class Job : HeuristicLab.Clients.Hive.NamedHiveItem { 699 699 700 700 [System.Runtime.Serialization.OptionalFieldAttribute()] … … 1648 1648 1649 1649 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetHiveExperiment", ReplyAction = "http://tempuri.org/IHiveService/GetHiveExperimentResponse")] 1650 HeuristicLab.Clients.Hive. HiveExperimentGetHiveExperiment(System.Guid id);1650 HeuristicLab.Clients.Hive.Job GetHiveExperiment(System.Guid id); 1651 1651 1652 1652 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetHiveExperiments", ReplyAction = "http://tempuri.org/IHiveService/GetHiveExperimentsResponse")] 1653 System.Collections.Generic.List<HeuristicLab.Clients.Hive. HiveExperiment> GetHiveExperiments();1653 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetHiveExperiments(); 1654 1654 1655 1655 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetAllHiveExperiments", ReplyAction = "http://tempuri.org/IHiveService/GetAllHiveExperimentsResponse")] 1656 System.Collections.Generic.List<HeuristicLab.Clients.Hive. HiveExperiment> GetAllHiveExperiments();1656 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetAllHiveExperiments(); 1657 1657 1658 1658 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AddHiveExperiment", ReplyAction = "http://tempuri.org/IHiveService/AddHiveExperimentResponse")] 1659 System.Guid AddHiveExperiment(HeuristicLab.Clients.Hive. HiveExperimenthiveExperimentDto);1659 System.Guid AddHiveExperiment(HeuristicLab.Clients.Hive.Job hiveExperimentDto); 1660 1660 1661 1661 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/UpdateHiveExperiment", ReplyAction = "http://tempuri.org/IHiveService/UpdateHiveExperimentResponse")] 1662 void UpdateHiveExperiment(HeuristicLab.Clients.Hive. HiveExperimenthiveExperimentDto);1662 void UpdateHiveExperiment(HeuristicLab.Clients.Hive.Job hiveExperimentDto); 1663 1663 1664 1664 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/DeleteHiveExperiment", ReplyAction = "http://tempuri.org/IHiveService/DeleteHiveExperimentResponse")] … … 1672 1672 1673 1673 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetHiveExperimentPermissions", ReplyAction = "http://tempuri.org/IHiveService/GetHiveExperimentPermissionsResponse")] 1674 System.Collections.Generic.List<HeuristicLab.Clients.Hive. HiveExperimentPermission> GetHiveExperimentPermissions(System.Guid hiveExperimentId);1674 System.Collections.Generic.List<HeuristicLab.Clients.Hive.JobPermission> GetHiveExperimentPermissions(System.Guid hiveExperimentId); 1675 1675 1676 1676 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/IsAllowedPrivileged", ReplyAction = "http://tempuri.org/IHiveService/IsAllowedPrivilegedResponse")] … … 1874 1874 } 1875 1875 1876 public HeuristicLab.Clients.Hive. HiveExperimentGetHiveExperiment(System.Guid id) {1876 public HeuristicLab.Clients.Hive.Job GetHiveExperiment(System.Guid id) { 1877 1877 return base.Channel.GetHiveExperiment(id); 1878 1878 } 1879 1879 1880 public System.Collections.Generic.List<HeuristicLab.Clients.Hive. HiveExperiment> GetHiveExperiments() {1880 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetHiveExperiments() { 1881 1881 return base.Channel.GetHiveExperiments(); 1882 1882 } 1883 1883 1884 public System.Collections.Generic.List<HeuristicLab.Clients.Hive. HiveExperiment> GetAllHiveExperiments() {1884 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Job> GetAllHiveExperiments() { 1885 1885 return base.Channel.GetAllHiveExperiments(); 1886 1886 } 1887 1887 1888 public System.Guid AddHiveExperiment(HeuristicLab.Clients.Hive. HiveExperimenthiveExperimentDto) {1888 public System.Guid AddHiveExperiment(HeuristicLab.Clients.Hive.Job hiveExperimentDto) { 1889 1889 return base.Channel.AddHiveExperiment(hiveExperimentDto); 1890 1890 } 1891 1891 1892 public void UpdateHiveExperiment(HeuristicLab.Clients.Hive. HiveExperimenthiveExperimentDto) {1892 public void UpdateHiveExperiment(HeuristicLab.Clients.Hive.Job hiveExperimentDto) { 1893 1893 base.Channel.UpdateHiveExperiment(hiveExperimentDto); 1894 1894 } … … 1906 1906 } 1907 1907 1908 public System.Collections.Generic.List<HeuristicLab.Clients.Hive. HiveExperimentPermission> GetHiveExperimentPermissions(System.Guid hiveExperimentId) {1908 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.JobPermission> GetHiveExperimentPermissions(System.Guid hiveExperimentId) { 1909 1909 return base.Channel.GetHiveExperimentPermissions(hiveExperimentId); 1910 1910 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/ServiceClients/Task.cs
r6721 r6723 38 38 this.IsParentJob = original.IsParentJob; 39 39 this.FinishWhenChildJobsFinished = original.FinishWhenChildJobsFinished; 40 this. HiveExperimentId = original.HiveExperimentId;40 this.JobId = original.JobId; 41 41 this.IsPrivileged = original.IsPrivileged; 42 42 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/Util/PluginUtil.cs
r6452 r6723 36 36 /// <param name="service">An active service-proxy</param> 37 37 /// <param name="onlinePlugins">List of plugins which are available online</param> 38 /// <param name="alreadyUploadedPlugins">List of plugins which have been uploaded from this HiveExperiment</param>38 /// <param name="alreadyUploadedPlugins">List of plugins which have been uploaded from this Job</param> 39 39 /// <param name="neededPlugins">List of plugins which need to be uploaded</param> 40 40 /// <returns></returns>
Note: See TracChangeset
for help on using the changeset viewer.