Changeset 5106


Ignore:
Timestamp:
12/14/10 16:52:55 (10 years ago)
Author:
cneumuel
Message:

#1233

  • made MockJob to execute asynchronously with the option to spinWait
  • added methods to IHiveService
  • implemented methods for Slave handling in HiveService
  • added more tests for server
  • changed db-schema of slaves and slavegroups
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
5 added
29 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs

    r5104 r5106  
    2828      ServerConfigFilePath = Path.Combine(ServerPluginCachePath, "HeuristicLab 3.3.exe.config");
    2929
    30       byte[] data = PersistenceUtil.Serialize(new MockJob(4000));
     30      byte[] data = PersistenceUtil.Serialize(new MockJob(4000, false));
    3131      if (plugins == null)
    3232        plugins = ReadPluginsFromServerCache();
     
    111111    public void UpdateJob(Job jobDto, JobData jobDataDto) {
    112112      Console.WriteLine("Update Job called!");
     113    }
     114
     115    public void DeleteJob(Guid jobId) {
     116      // do nothing
    113117    }
    114118
     
    219223    }
    220224
     225    public Services.Hive.Common.DataTransfer.Slave GetSlave(Guid slaveId) {
     226      throw new NotImplementedException();
     227    }
     228
     229    public SlaveGroup GetSlaveGroup(Guid slaveGroupId) {
     230      throw new NotImplementedException();
     231    }
     232
    221233    public IEnumerable<Services.Hive.Common.DataTransfer.Slave> GetSlaves() {
    222234      throw new NotImplementedException();
     
    227239    }
    228240
    229     public void DeleteSlaveGroup(Guid clientGroupId) {
    230       throw new NotImplementedException();
    231     }
    232 
    233     public void AddResourceToGroup(Guid slaveGroupId, Resource resource) {
     241    public void UpdateSlave(Services.Hive.Common.DataTransfer.Slave slave) {
     242      throw new NotImplementedException();
     243    }
     244
     245    public void UpdateSlaveGroup(SlaveGroup slaveGroup) {
     246      throw new NotImplementedException();
     247    }
     248
     249    public void DeleteSlave(Guid slaveId) {
     250      throw new NotImplementedException();
     251    }
     252
     253    public void DeleteSlaveGroup(Guid slaveGroupId) {
     254      throw new NotImplementedException();
     255    }
     256
     257    public void AddResourceToGroup(Guid slaveGroupId, Guid resourceId) {
    234258      throw new NotImplementedException();
    235259    }
    236260
    237261    public void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId) {
    238       throw new NotImplementedException();
    239     }
    240 
    241     public void UpdateSlave(Services.Hive.Common.DataTransfer.Slave slave) {
    242262      throw new NotImplementedException();
    243263    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockJob.cs

    r5104 r5106  
    99using System.Drawing;
    1010using System.Threading;
     11using System.Diagnostics;
    1112
    1213namespace HeuristicLab.Clients.Hive.Slave.Tests {
     
    4546
    4647    private int ms = 1000; //ms
    47     public MockJob(int ms) {
     48    private bool spinWait;
     49    public MockJob(int ms, bool spinWait) {
    4850      this.ms = ms;
     51      this.spinWait = spinWait;
    4952    }
    5053    public MockJob() { }
    5154    [StorableConstructor]
    5255    protected MockJob(bool deserializing) { }
    53     protected MockJob(MockJob original, Cloner cloner) : base(original, cloner) {
     56    protected MockJob(MockJob original, Cloner cloner)
     57      : base(original, cloner) {
    5458      this.ComputeInParallel = original.ComputeInParallel;
    5559      this.IndexInParentOptimizerList = original.IndexInParentOptimizerList;
     
    9296
    9397    public virtual void Start() {
    94       DateTime start = DateTime.Now;
    95       do {
    96         Thread.SpinWait(1000);
    97         this.ExecutionTime = DateTime.Now - start;
    98       } while (ExecutionTime.TotalMilliseconds < ms);
    99       Stop();
    100       OnJobStopped();
     98      new Thread(Run).Start();
     99    }
     100
     101    private void Run() {
     102      try {
     103        if (spinWait) {
     104          Stopwatch watch = new Stopwatch();
     105          watch.Start();
     106          do {
     107            Thread.SpinWait(1000);
     108          } while (watch.ElapsedMilliseconds < ms);
     109          watch.Stop();
     110        } else {
     111          Thread.Sleep(ms);
     112        }
     113        Stop();
     114        OnJobStopped();
     115      }
     116      catch (Exception e) {
     117        this.ExecutionState = Core.ExecutionState.Stopped;
     118        OnJobFailed();
     119      }
    101120    }
    102121
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs

    r5105 r5106  
    195195   
    196196    public Executor() {
    197       CurrentMessage = MessageContainer.MessageType.NoMessage;
     197      // CurrentMessage = MessageContainer.MessageType.NoMessage; [chn] check usage of 'CurrentMessage'
    198198    }
    199199
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs

    r5055 r5106  
    4646    private System.Timers.Timer timer;
    4747    private DateTime lastUpdateTime;
    48     private Guid? rootJobId;
     48    private Guid rootJobId;
    4949    private JobResultPoller jobResultPoller;
    5050
     
    535535          // fetch all Job objects to create the full tree of tree of HiveJob objects
    536536          progress.Status = "Downloading list of jobs...";
    537           IEnumerable<LightweightJob> allResults = service.Obj.GetLightweightChildJobs(rootJobId.Value, true, true);
     537          IEnumerable<LightweightJob> allResults = service.Obj.GetLightweightChildJobs(rootJobId, true, true);
    538538          totalJobCount = allResults.Count();
    539539
     
    550550
    551551          jobCount = 1;
    552           progress.Status = string.Format("Deserializing {0} of {1} jobs... ({2} kb)", jobCount, totalJobCount, allJobDatas[this.rootJobId.Value].Data.Count() / 1024);
    553           this.HiveJob = new HiveJob(allJobs[this.rootJobId.Value], allJobDatas[this.rootJobId.Value], false);
    554           allJobDatas.Remove(this.rootJobId.Value); // reduce memory footprint
    555           allJobs.Remove(this.rootJobId.Value);
     552          progress.Status = string.Format("Deserializing {0} of {1} jobs... ({2} kb)", jobCount, totalJobCount, allJobDatas[this.rootJobId].Data.Count() / 1024);
     553          this.HiveJob = new HiveJob(allJobs[this.rootJobId], allJobDatas[this.rootJobId], false);
     554          allJobDatas.Remove(this.rootJobId); // reduce memory footprint
     555          allJobs.Remove(this.rootJobId);
    556556          progress.ProgressValue = (double)jobCount / totalJobCount;
    557557
    558558          if (this.HiveJob.Job.DateFinished.HasValue) {
    559             this.ExecutionTime = this.HiveJob.Job.DateFinished.Value - this.HiveJob.Job.DateCreated.Value;
     559            this.ExecutionTime = this.HiveJob.Job.DateFinished.Value - this.HiveJob.Job.DateCreated;
    560560            this.lastUpdateTime = this.HiveJob.Job.DateFinished.Value;
    561561            this.ExecutionState = Core.ExecutionState.Stopped;
    562562            OnStopped();
    563563          } else {
    564             this.ExecutionTime = DateTime.Now - this.HiveJob.Job.DateCreated.Value;
     564            this.ExecutionTime = DateTime.Now - this.HiveJob.Job.DateCreated;
    565565            this.lastUpdateTime = DateTime.Now;
    566566            this.ExecutionState = Core.ExecutionState.Started;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/HiveExperiment.cs

    r4796 r5106  
    3131    public Guid UserId { get; set; }
    3232    [DataMember]
    33     public Guid? RootJobId { get; set; }
     33    public Guid RootJobId { get; set; }
     34    [DataMember]
     35    public DateTime DateCreated { get; set; }
    3436
    3537    public HiveExperiment() { }
     
    3739      this.RootJobId = original.RootJobId;
    3840      this.UserId = original.UserId;
     41      this.DateCreated = original.DateCreated;
    3942    }
    4043    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Job.cs

    r4905 r5106  
    3939    public int MemoryNeeded { get; set; }
    4040    [DataMember]
    41     public Guid? ProjectId { get; set; }
    42     [DataMember]
    4341    public List<Guid> PluginsNeededIds { get; set; }
    4442
     
    4947      this.CoresNeeded = original.CoresNeeded;
    5048      this.MemoryNeeded = original.MemoryNeeded;
    51       this.ProjectId = original.ProjectId;
    5249      this.PluginsNeededIds = new List<Guid>(original.PluginsNeededIds);
    5350    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/JobData.cs

    r4796 r5106  
    3333    [DataMember]
    3434    public byte[] Data { get; set; }
     35    [DataMember]
     36    public DateTime LastUpdate { get; set; }
    3537
    3638    public JobData() { }
    3739    protected JobData(JobData original, Cloner cloner) : base(original, cloner) {
    3840      if (original.Data != null) this.Data = new byte[original.Data.Length]; Array.Copy(original.Data, this.Data, original.Data.Length);
     41      this.LastUpdate = original.LastUpdate;
    3942    }
    4043    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/LightweightJob.cs

    r4796 r5106  
    3737    public String Exception { get; set; }
    3838    [DataMember]
    39     public DateTime? DateCreated { get; set; }
     39    public DateTime DateCreated { get; set; }
    4040    [DataMember]
    4141    public DateTime? DateCalculated { get; set; }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Resource.cs

    r4796 r5106  
    2828  [Serializable]
    2929  public class Resource : NamedHiveItem {
     30    [DataMember]
     31    public Guid? ParentResourceId { get; set; }
    3032
    3133    public Resource() { }
    32     protected Resource(Resource original, Cloner cloner) : base(original, cloner) { }
     34    protected Resource(Resource original, Cloner cloner) : base(original, cloner) {
     35      this.ParentResourceId = original.ParentResourceId;
     36    }
    3337    public override IDeepCloneable Clone(Cloner cloner) {
    3438      return new Resource(this, cloner);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Slave.cs

    r4796 r5106  
    3333    public int? FreeCores { get; set; }
    3434    [DataMember]
    35     public int? CpuSpeed { get; set; }
     35    public int? CpuSpeed { get; set; } // MHz
    3636    [DataMember]
    37     public int? Memory { get; set; }
     37    public int? Memory { get; set; } // MB
    3838    [DataMember]
    39     public int? FreeMemory { get; set; }
     39    public int? FreeMemory { get; set; } // MB
    4040    [DataMember]
    4141    public SlaveState SlaveState { get; set; }
    42     [DataMember]
    43     public CalendarState CalendarSyncState { get; set; }
    44     [DataMember]
    45     public Guid? SlaveConfigId { get; set; }
    4642    [DataMember]
    4743    public bool IsAllowedToCalculate { get; set; }
     
    5753      this.FreeMemory = original.FreeMemory;
    5854      this.SlaveState = original.SlaveState;
    59       this.CalendarSyncState = original.CalendarSyncState;
    60       this.SlaveConfigId = original.SlaveConfigId;
    6155      this.IsAllowedToCalculate = original.IsAllowedToCalculate;
    6256    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/SlaveGroup.cs

    r4796 r5106  
    2929  [DataContract]
    3030  public class SlaveGroup : Resource {
    31     [DataMember]
    32     public List<Guid> ChildResourcesIds { get; set; }
    33     [DataMember]
    34     public List<Guid> ParentResourcesIds { get; set; }
    35 
    36     public SlaveGroup() {
    37       ChildResourcesIds = new List<Guid>();
    38     }
    39     protected SlaveGroup(SlaveGroup original, Cloner cloner) : base(original, cloner) {
    40       this.ChildResourcesIds = new List<Guid>(original.ChildResourcesIds);
    41       this.ParentResourcesIds = new List<Guid>(original.ParentResourcesIds);
    42     }
     31    public SlaveGroup() { }
     32    protected SlaveGroup(SlaveGroup original, Cloner cloner) : base(original, cloner) { }
    4333    public override IDeepCloneable Clone(Cloner cloner) {
    4434      return new SlaveGroup(this, cloner);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/HeuristicLab.Services.Hive.Common-3.4.csproj

    r5055 r5106  
    6464    <None Include="HeuristicLabServicesHiveCommonPlugin.cs.frame" />
    6565    <Compile Include="DataTransfer\Appointment.cs" />
    66     <Compile Include="DataTransfer\CalendarState.cs" />
    6766    <Compile Include="DataTransfer\HeartBeat.cs" />
    6867    <Compile Include="DataTransfer\HiveExperiment.cs" />
     
    7675    <Compile Include="MessageContainer.cs" />
    7776    <Compile Include="DataTransfer\NamedHiveItem.cs" />
    78     <Compile Include="DataTransfer\Project.cs" />
    7977    <Compile Include="DataTransfer\Resource.cs" />
    8078    <Compile Include="DataTransfer\JobData.cs" />
    81     <Compile Include="DataTransfer\SlaveConfig.cs" />
    8279    <Compile Include="DataTransfer\Slave.cs" />
    8380    <Compile Include="DataTransfer\SlaveGroup.cs" />
    8481    <Compile Include="DataTransfer\SlaveState.cs" />
    85     <Compile Include="DataTransfer\UpTimeStatistics.cs" />
    8682    <Compile Include="HeuristicLabServicesHiveCommonPlugin.cs" />
    8783    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/MessageContainer.cs

    r5078 r5106  
    3535    public enum MessageType {
    3636      // *** commands from hive server ***
    37       NoMessage, // do nothing
    3837      AquireJob, // slave should aquire a new job (formerly FetchJob)
    3938      StopJob,   // slave should stop the job and submit results
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs

    r5101 r5106  
    3737    [OperationContract]
    3838    void UpdateJob(Job jobDto, JobData jobDataDto);
     39
     40    [OperationContract]
     41    void DeleteJob(Guid jobId);
    3942
    4043    [OperationContract]
     
    107110
    108111    [OperationContract]
     112    Slave GetSlave(Guid slaveId);
     113
     114    [OperationContract]
     115    SlaveGroup GetSlaveGroup(Guid slaveGroupId);
     116
     117    [OperationContract]
    109118    IEnumerable<Slave> GetSlaves();
    110    
     119
    111120    [OperationContract]
    112     [ServiceKnownType(typeof(Resource))]
    113     [ServiceKnownType(typeof(Slave))]
    114     [ServiceKnownType(typeof(SlaveGroup))]
    115121    IEnumerable<SlaveGroup> GetSlaveGroups();
    116122
    117123    [OperationContract]
    118     void DeleteSlaveGroup(Guid clientGroupId);
     124    void UpdateSlave(Slave slave);
    119125
    120126    [OperationContract]
    121     [ServiceKnownType(typeof(Resource))]
    122     [ServiceKnownType(typeof(Slave))]
    123     [ServiceKnownType(typeof(SlaveGroup))]
    124     void AddResourceToGroup(Guid slaveGroupId, Resource resource);
     127    void UpdateSlaveGroup(SlaveGroup slaveGroup);
     128
     129    [OperationContract]
     130    void DeleteSlave(Guid slaveId);
     131
     132    [OperationContract]
     133    void DeleteSlaveGroup(Guid slaveGroupId);
     134
     135    [OperationContract]
     136    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
    125137
    126138    [OperationContract]
    127139    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
    128140
    129     [OperationContract]
    130     void UpdateSlave(Slave slave);
    131141    #endregion
    132142
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs

    r4905 r5106  
    4242        ParentJobId = source.ParentJobId,
    4343        Priority = source.Priority,
    44         ProjectId = source.ProjectId,
    4544        SlaveId = source.SlaveId,
    4645        JobState = source.JobState,
     
    6665        target.ParentJobId = source.ParentJobId;
    6766        target.Priority = source.Priority;
    68         target.ProjectId = source.ProjectId;
    6967        target.SlaveId = source.SlaveId;
    7068        target.JobState = source.JobState;
    7169        target.UserId = source.UserId;
    72 //        target.RequiredPlugins = db.Plugins.Select(x => source.PluginsNeededIds.Contains(x.PluginId)); - this is difficult
     70        //        target.RequiredPlugins = db.Plugins.Select(x => source.PluginsNeededIds.Contains(x.PluginId)); - this is difficult
    7371      }
    7472    }
     
    7876    public static DT.JobData ToDto(JobData source) {
    7977      if (source == null) return null;
    80       return new DT.JobData { JobId = source.JobId, Data = source.Data.ToArray() };
     78      return new DT.JobData { JobId = source.JobId, Data = source.Data.ToArray(), LastUpdate = source.LastUpdate };
    8179    }
    8280    public static JobData ToEntity(DT.JobData source) {
     
    8785    public static void ToEntity(DT.JobData source, JobData target) {
    8886      if ((source != null) && (target != null)) {
    89         target.JobId = source.JobId; target.Data = new Binary(source.Data);
     87        target.JobId = source.JobId; target.Data = new Binary(source.Data); target.LastUpdate = source.LastUpdate;
    9088      }
    9189    }
     
    9593    public static DT.HiveExperiment ToDto(HiveExperiment source) {
    9694      if (source == null) return null;
    97       return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, RootJobId = source.RootJobId, UserId = source.UserId };
     95      return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, RootJobId = source.RootJobId, UserId = source.UserId, DateCreated = source.DateCreated };
    9896    }
    9997    public static HiveExperiment ToEntity(DT.HiveExperiment source) {
     
    104102    public static void ToEntity(DT.HiveExperiment source, HiveExperiment target) {
    105103      if ((source != null) && (target != null)) {
    106         target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.RootJobId = source.RootJobId; target.UserId = source.UserId;
     104        target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.RootJobId = source.RootJobId; target.UserId = source.UserId; target.DateCreated = source.DateCreated;
    107105      }
    108106    }
     
    146144    public static DT.Slave ToDto(Slave source) {
    147145      if (source == null) return null;
    148       return new DT.Slave { Id = source.ResourceId, CalendarSyncState = source.CalendarSyncState, Cores = source.Cores, CpuSpeed = source.CpuSpeed, FreeCores = source.FreeCores, FreeMemory = source.FreeMemory, IsAllowedToCalculate = source.IsAllowedToCalculate, Memory = source.Memory, Name = source.Name, SlaveConfigId = source.SlaveConfigId, SlaveState = source.SlaveState };
     146      return new DT.Slave { Id = source.ResourceId, ParentResourceId = source.ParentResourceId, Cores = source.Cores, CpuSpeed = source.CpuSpeed, FreeCores = source.FreeCores, FreeMemory = source.FreeMemory, IsAllowedToCalculate = source.IsAllowedToCalculate, Memory = source.Memory, Name = source.Name, SlaveState = source.SlaveState };
    149147    }
    150148    public static Slave ToEntity(DT.Slave source) {
     
    155153    public static void ToEntity(DT.Slave source, Slave target) {
    156154      if ((source != null) && (target != null)) {
    157         target.ResourceId = source.Id; target.CalendarSyncState = source.CalendarSyncState; target.Cores = source.Cores; target.CpuSpeed = source.CpuSpeed; target.FreeCores = source.FreeCores; target.FreeMemory = source.FreeMemory; target.IsAllowedToCalculate = source.IsAllowedToCalculate; target.Memory = source.Memory; target.Name = source.Name; target.SlaveConfigId = source.SlaveConfigId; target.SlaveState = source.SlaveState;
     155        target.ResourceId = source.Id; target.ParentResourceId = source.ParentResourceId; target.Cores = source.Cores; target.CpuSpeed = source.CpuSpeed; target.FreeCores = source.FreeCores; target.FreeMemory = source.FreeMemory; target.IsAllowedToCalculate = source.IsAllowedToCalculate; target.Memory = source.Memory; target.Name = source.Name; target.SlaveState = source.SlaveState;
    158156      }
    159157    }
     
    163161    public static DT.SlaveGroup ToDto(SlaveGroup source) {
    164162      if (source == null) return null;
    165       return new DT.SlaveGroup { Id = source.ResourceId, Name = source.Name, ChildResourcesIds = source.SlaveGroup_Resources_Children.Select(x => x.ResourceId).ToList(), ParentResourcesIds = source.SlaveGroup_Resources_Parents.Select(x => x.ResourceId).ToList() };
     163      return new DT.SlaveGroup { Id = source.ResourceId, Name = source.Name, ParentResourceId = source.ParentResourceId };
    166164    }
    167165    public static SlaveGroup ToEntity(DT.SlaveGroup source) {
     
    172170    public static void ToEntity(DT.SlaveGroup source, SlaveGroup target) {
    173171      if ((source != null) && (target != null)) {
    174         target.ResourceId = source.Id;
    175         target.Name = source.Name;
    176         //target.SlaveGroup_Resources_Children = // TODO: see how working with groups will work, then decide how to handle enumerations in here
    177         //target.SlaveGroup_Resources_Parents =
     172        target.ResourceId = source.Id; target.Name = source.Name; target.ParentResourceId = source.ParentResourceId;
    178173      }
    179174    }
     
    183178    public static DT.Resource ToDto(Resource source) {
    184179      if (source == null) return null;
    185       return new DT.Resource { Id = source.ResourceId, Name = source.Name };
     180      return new DT.Resource { Id = source.ResourceId, Name = source.Name, ParentResourceId = source.ParentResourceId };
    186181    }
    187182    public static Resource ToEntity(DT.Resource source) {
     
    192187    public static void ToEntity(DT.Resource source, Resource target) {
    193188      if ((source != null) && (target != null)) {
    194         target.ResourceId = source.Id; target.Name = source.Name;
     189        target.ResourceId = source.Id; target.Name = source.Name; target.ParentResourceId = source.ParentResourceId;
    195190      }
    196191    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj

    r5078 r5106  
    6161    <Reference Include="System.Data.Linq" />
    6262    <Reference Include="System.Transactions" />
     63    <Reference Include="System.Windows.Forms" />
    6364    <Reference Include="System.Xml.Linq" />
    6465    <Reference Include="System.Data.DataSetExtensions" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs

    r4905 r5106  
    5353        var entity = db.Jobs.FirstOrDefault(x => x.JobId == id);
    5454        if (entity != null) db.Jobs.DeleteOnSubmit(entity);
    55         db.SubmitChanges();
     55        db.SubmitChanges(); // JobData and child jobs are deleted by db-trigger
    5656      }
    5757    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml

    r4905 r5106  
    99    </Type>
    1010  </Table>
    11   <Table Name="dbo.UptimeStatistics" Member="UptimeStatistics">
    12     <Type Name="UptimeStatistic">
    13       <Column Name="UptimeStatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    14       <Column Name="Login" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
    15       <Column Name="Logout" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
    16       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    17       <Association Name="Slave_UptimeStatistic" Member="Slave" ThisKey="ResourceId" OtherKey="ResourceId" Type="Slave" IsForeignKey="true" DeleteRule="SET NULL" />
    18     </Type>
    19   </Table>
    20   <Table Name="dbo.SlaveConfig" Member="SlaveConfigs">
    21     <Type Name="SlaveConfig">
    22       <Column Name="SlaveConfigId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    23       <Column Name="UpDownTimeCalendar" Type="System.Xml.Linq.XElement" DbType="Xml" CanBeNull="false" UpdateCheck="Never" />
    24       <Column Name="HeartBeatIntervall" Type="System.Int32" DbType="Int" CanBeNull="true" />
    25       <Association Name="SlaveConfig_Slave" Member="Slaves" ThisKey="SlaveConfigId" OtherKey="SlaveConfigId" Type="Slave" />
    26     </Type>
    27   </Table>
    28   <Table Name="dbo.SlaveGroup_Resource" Member="SlaveGroup_Resources">
    29     <Type Name="SlaveGroup_Resource">
    30       <Column Name="SlaveGroup_RessourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    31       <Column Name="SlaveGroupId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    32       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    33       <Association Name="SlaveGroup_SlaveGroup_Resource" Member="SlaveGroup" ThisKey="SlaveGroupId" OtherKey="ResourceId" Type="SlaveGroup" IsForeignKey="true" />
    34       <Association Name="Resource_SlaveGroup_Resource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
    35     </Type>
    36   </Table>
    3711  <Table Name="dbo.Plugin" Member="Plugins">
    3812    <Type Name="Plugin">
     
    4216      <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
    4317      <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One" />
    44     </Type>
    45   </Table>
    46   <Table Name="dbo.Project" Member="Projects">
    47     <Type Name="Project">
    48       <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    49       <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    50       <Association Name="Project_Job" Member="Jobs" ThisKey="ProjectId" OtherKey="ProjectId" Type="Job" />
    5118    </Type>
    5219  </Table>
     
    6229  <Table Name="dbo.Resource" Member="Resources">
    6330    <Type Name="Resource" InheritanceCode="RESOURCE">
    64       <Column Name="ResourceId" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     31      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    6532      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    6633      <Column Name="ResourceType" Type="System.String" CanBeNull="false" IsDiscriminator="true" />
     34      <Column Name="ParentResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    6735      <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource" />
    68       <Association Name="Resource_SlaveGroup_Resource" Member="SlaveGroup_Resources_Parents" ThisKey="ResourceId" OtherKey="ResourceId" Type="SlaveGroup_Resource" />
    6936      <Association Name="Resource_UptimeCalendar" Member="UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeCalendar" />
     37      <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
     38      <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
    7039      <Type Name="Slave" InheritanceCode="Slave" IsInheritanceDefault="true">
    7140        <Column Name="CpuSpeed" Storage="_CPUSpeed" Type="System.Int32" DbType="Int" CanBeNull="true" />
     
    7342        <Column Name="Login" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    7443        <Column Name="SlaveState" Storage="_Status" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState" DbType="VarChar(15)" CanBeNull="true" />
    75         <Column Name="CalendarSyncState" Storage="_CalendarSyncStatus" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.CalendarState" DbType="VarChar(MAX)" CanBeNull="true" />
    76         <Column Name="UseCalendarFromResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    77         <Column Name="SlaveConfigId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    7844        <Column Name="Cores" Storage="_NumberOfCores" Type="System.Int32" DbType="Int" CanBeNull="true" />
    7945        <Column Name="FreeCores" Storage="_NumberOfFreeCores" Type="System.Int32" DbType="Int" CanBeNull="true" />
    8046        <Column Name="FreeMemory" Type="System.Int32" DbType="Int" CanBeNull="true" />
    8147        <Column Name="IsAllowedToCalculate" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
    82         <Association Name="Slave_UptimeStatistic" Member="UptimeStatistics" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeStatistic" />
    8348        <Association Name="Slave_Job" Member="Jobs" ThisKey="ResourceId" OtherKey="SlaveId" Type="Job" />
    84         <Association Name="SlaveConfig_Slave" Member="SlaveConfig" ThisKey="SlaveConfigId" OtherKey="SlaveConfigId" Type="SlaveConfig" IsForeignKey="true" DeleteRule="SET NULL" />
    8549      </Type>
    86       <Type Name="SlaveGroup" InheritanceCode="GROUP">
    87         <Association Name="SlaveGroup_SlaveGroup_Resource" Member="SlaveGroup_Resources_Children" ThisKey="ResourceId" OtherKey="SlaveGroupId" Type="SlaveGroup_Resource" />
    88       </Type>
     50      <Type Name="SlaveGroup" InheritanceCode="GROUP" />
    8951    </Type>
    9052  </Table>
     
    9759      <Column Name="ExecutionTime" Type="System.TimeSpan" DbType="Time" CanBeNull="true" />
    9860      <Column Name="Exception" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    99       <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     61      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
    10062      <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    10163      <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     
    10769      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
    10870      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
    109       <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
     71      <Association Name="Job_Job" Member="ChildJobs" Storage="_Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
    11072      <Association Name="Job_JobData" Member="JobData" ThisKey="JobId" OtherKey="JobId" Type="JobData" Cardinality="One" />
    111       <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
    112       <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />
     73      <Association Name="Job_Job" Member="ParentJob" Storage="_Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
    11374      <Association Name="Slave_Job" Member="Slave" ThisKey="SlaveId" OtherKey="ResourceId" Type="Slave" IsForeignKey="true" DeleteRule="SET NULL" />
    11475    </Type>
     
    13394      <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    13495      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    135       <Column Name="RootJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     96      <Column Name="RootJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
     97      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
    13698      <Association Name="Job_HiveExperiment" Member="RootJob" Storage="_Job" ThisKey="RootJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" />
    13799    </Type>
     
    141103      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    142104      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="false" UpdateCheck="Never" />
     105      <Column Name="LastUpdate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
    143106      <Association Name="Job_JobData" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
    144107    </Type>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout

    r4905 r5106  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.25, 12.25" name="HiveDataContext">
     2<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 16.25, 12.25" name="HiveDataContext">
    33  <DataContextMoniker Name="/HiveDataContext" />
    44  <nestedChildShapes>
     
    99      </nestedChildShapes>
    1010    </classShape>
    11     <classShape Id="3176614f-3038-41e5-8e75-cdf99373cb3d" absoluteBounds="4.5, 2.125, 2, 1.5785953776041666">
    12       <DataClassMoniker Name="/HiveDataContext/UptimeStatistic" />
    13       <nestedChildShapes>
    14         <elementListCompartment Id="35235ffe-b21e-49da-b58a-27423444612a" absoluteBounds="4.5150000000000006, 2.5850000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    15       </nestedChildShapes>
    16     </classShape>
    17     <classShape Id="5d9c7dad-8113-49c9-bdfa-c64543554a7b" absoluteBounds="7, 0.75, 2, 1.3862939453125023">
    18       <DataClassMoniker Name="/HiveDataContext/SlaveConfig" />
    19       <nestedChildShapes>
    20         <elementListCompartment Id="c2e15bc8-44cb-42af-b195-b9a30f61af28" absoluteBounds="7.0150000000000006, 1.2100000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    21       </nestedChildShapes>
    22     </classShape>
    23     <classShape Id="7edeab13-5aa7-4b63-8c5e-cae056298001" absoluteBounds="15, 2.875, 2, 1.3862939453125023">
    24       <DataClassMoniker Name="/HiveDataContext/SlaveGroup_Resource" />
    25       <nestedChildShapes>
    26         <elementListCompartment Id="b84f48de-4352-4df2-a7da-ff7cbc1fe702" absoluteBounds="15.015, 3.3350000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    27       </nestedChildShapes>
    28     </classShape>
    2911    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.3862939453125005">
    3012      <DataClassMoniker Name="/HiveDataContext/Plugin" />
    3113      <nestedChildShapes>
    3214        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    33       </nestedChildShapes>
    34     </classShape>
    35     <classShape Id="85f04409-b6e0-4e2f-a140-7191436a806f" absoluteBounds="5, 8.25, 2, 1.1939925130208309">
    36       <DataClassMoniker Name="/HiveDataContext/Project" />
    37       <nestedChildShapes>
    38         <elementListCompartment Id="59e11457-6078-47f4-8ee6-eb2052868699" absoluteBounds="5.0150000000000006, 8.71, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    3915      </nestedChildShapes>
    4016    </classShape>
     
    4521      </nestedChildShapes>
    4622    </classShape>
    47     <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.75, 0.75, 2, 1.3862939453125005">
     23    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.75, 0.75, 2, 1.5785953776041666">
    4824      <DataClassMoniker Name="/HiveDataContext/Resource" />
    4925      <nestedChildShapes>
    50         <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.765, 1.21, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     26        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.765, 1.21, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    5127      </nestedChildShapes>
    5228    </classShape>
     
    6339      </nestedChildShapes>
    6440    </classShape>
    65     <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.875, 6, 2, 1.9631982421875005">
     41    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.875, 6, 2, 2.1554996744791666">
    6642      <DataClassMoniker Name="/HiveDataContext/HiveExperiment" />
    6743      <nestedChildShapes>
    68         <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.8900000000000006, 6.4600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     44        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.8900000000000006, 6.4600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    6945      </nestedChildShapes>
    7046    </classShape>
    71     <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="9.375, 0.75, 2, 2.9247054036458326">
     47    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="9.375, 0.75, 2, 2.3478011067708335">
    7248      <DataClassMoniker Name="/HiveDataContext/Slave" />
    7349      <nestedChildShapes>
    74         <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="9.39, 1.21, 1.9700000000000002, 2.364705403645833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     50        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="9.39, 1.21, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    7551      </nestedChildShapes>
    7652    </classShape>
     
    8157      </nestedChildShapes>
    8258    </classShape>
    83     <inheritanceConnector edgePoints="[(11.75 : 1.44314697265625); (11.375 : 1.44314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
     59    <inheritanceConnector edgePoints="[(11.75 : 1.53929768880208); (11.375 : 1.53929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
    8460      <nodes>
    8561        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     
    8763      </nodes>
    8864    </inheritanceConnector>
    89     <inheritanceConnector edgePoints="[(13.75 : 1.15469482421875); (14 : 1.15469482421875)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
     65    <inheritanceConnector edgePoints="[(13.75 : 1.15469482421875); (14 : 1.15469482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
    9066      <nodes>
    9167        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     
    9369      </nodes>
    9470    </inheritanceConnector>
    95     <associationConnector edgePoints="[(13.25 : 2.1362939453125); (13.25 : 2.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     71    <associationConnector edgePoints="[(13.25 : 2.32859537760417); (13.25 : 2.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    9672      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
    9773      <nodes>
     
    10783      </nodes>
    10884    </associationConnector>
    109     <associationConnector edgePoints="[(9.375 : 2.93674967447917); (6.5 : 2.93674967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    110       <AssociationMoniker Name="/HiveDataContext/Slave/Slave_UptimeStatistic" />
    111       <nodes>
    112         <classShapeMoniker Id="26f4edfa-91dd-4941-a058-359f89e567a8" />
    113         <classShapeMoniker Id="3176614f-3038-41e5-8e75-cdf99373cb3d" />
    114       </nodes>
    115     </associationConnector>
    116     <associationConnector edgePoints="[(15.6910576194798 : 1.5593896484375); (15.6910576194798 : 2.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    117       <AssociationMoniker Name="/HiveDataContext/SlaveGroup/SlaveGroup_SlaveGroup_Resource" />
    118       <nodes>
    119         <classShapeMoniker Id="bbd91675-92f2-4a69-8429-0950008fc8a4" />
    120         <classShapeMoniker Id="7edeab13-5aa7-4b63-8c5e-cae056298001" />
    121       </nodes>
    122     </associationConnector>
    123     <associationConnector edgePoints="[(13.75 : 2.1362939453125); (14.125 : 2.5112939453125); (15.3497974555544 : 2.5112939453125); (15.3497974555544 : 2.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    124       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_SlaveGroup_Resource" />
    125       <nodes>
    126         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
    127         <classShapeMoniker Id="7edeab13-5aa7-4b63-8c5e-cae056298001" />
    128       </nodes>
    129     </associationConnector>
    13085    <associationConnector edgePoints="[(10.25 : 7.87660970052083); (10.25 : 8.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    13186      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
     
    13388        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
    13489        <classShapeMoniker Id="97b00810-fa30-457e-b484-b4e80b22f91b" />
    135       </nodes>
    136     </associationConnector>
    137     <associationConnector edgePoints="[(9 : 1.44314697265625); (9.375 : 1.44314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    138       <AssociationMoniker Name="/HiveDataContext/SlaveConfig/SlaveConfig_Slave" />
    139       <nodes>
    140         <classShapeMoniker Id="5d9c7dad-8113-49c9-bdfa-c64543554a7b" />
    141         <classShapeMoniker Id="26f4edfa-91dd-4941-a058-359f89e567a8" />
    14290      </nodes>
    14391    </associationConnector>
     
    14997      </nodes>
    15098    </associationConnector>
    151     <associationConnector edgePoints="[(7 : 8.25); (7.875 : 8.125); (7.875 : 8.05644744428109); (8.875 : 8.05644744428109); (8.875 : 8.25160970052083); (9.25 : 7.87660970052083)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
    152       <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
    153       <nodes>
    154         <classShapeMoniker Id="85f04409-b6e0-4e2f-a140-7191436a806f" />
    155         <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
    156       </nodes>
    157     </associationConnector>
    158     <associationConnector edgePoints="[(10.3125 : 3.67470540364583); (10.3125 : 4.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     99    <associationConnector edgePoints="[(10.3125 : 3.09780110677083); (10.3125 : 4.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    159100      <AssociationMoniker Name="/HiveDataContext/Slave/Slave_Job" />
    160101      <nodes>
     
    163104      </nodes>
    164105    </associationConnector>
    165     <associationConnector edgePoints="[(12.21875 : 2.1362939453125); (12.21875 : 4.625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     106    <associationConnector edgePoints="[(12.21875 : 2.32859537760417); (12.21875 : 4.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    166107      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" />
    167108      <nodes>
     
    170111      </nodes>
    171112    </associationConnector>
    172     <associationConnector edgePoints="[(9.25 : 6.71875); (6.875 : 6.71875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     113    <associationConnector edgePoints="[(9.25 : 6.93830485026042); (6.875 : 6.93830485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    173114      <AssociationMoniker Name="/HiveDataContext/Job/Job_HiveExperiment" />
    174115      <nodes>
     
    177118      </nodes>
    178119    </associationConnector>
    179     <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="6.875, 4.375, 2, 1.1939925130208327">
     120    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="6.875, 4.375, 2, 1.3862939453124996">
    180121      <DataClassMoniker Name="/HiveDataContext/JobData" />
    181122      <nestedChildShapes>
    182         <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="6.89, 4.835, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     123        <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="6.89, 4.835, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    183124      </nestedChildShapes>
    184125    </classShape>
     
    189130      </nestedChildShapes>
    190131    </classShape>
    191     <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     132    <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    192133      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
    193134      <nodes>
     
    196137      </nodes>
    197138    </associationConnector>
    198     <associationConnector edgePoints="[(9.25 : 4.97199625651042); (8.875 : 4.97199625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     139    <associationConnector edgePoints="[(9.25 : 5.06814697265625); (8.875 : 5.06814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    199140      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
    200141      <nodes>
     
    203144      </nodes>
    204145    </associationConnector>
    205     <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     146    <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    206147      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
    207148      <nodes>
     
    210151      </nodes>
    211152    </associationConnector>
     153    <associationConnector edgePoints="[(12.4524234637921 : 0.75); (12.4524234637921 : 0.5); (13.0617468474559 : 0.5); (13.0617468474559 : 0.75)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     154      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Resource" />
     155      <nodes>
     156        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     157        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     158      </nodes>
     159    </associationConnector>
    212160  </nestedChildShapes>
    213161</ordesignerObjectsDiagram>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs

    r4905 r5106  
    3434    partial void UpdateAssignedResource(AssignedResource instance);
    3535    partial void DeleteAssignedResource(AssignedResource instance);
    36     partial void InsertUptimeStatistic(UptimeStatistic instance);
    37     partial void UpdateUptimeStatistic(UptimeStatistic instance);
    38     partial void DeleteUptimeStatistic(UptimeStatistic instance);
    39     partial void InsertSlaveConfig(SlaveConfig instance);
    40     partial void UpdateSlaveConfig(SlaveConfig instance);
    41     partial void DeleteSlaveConfig(SlaveConfig instance);
    42     partial void InsertSlaveGroup_Resource(SlaveGroup_Resource instance);
    43     partial void UpdateSlaveGroup_Resource(SlaveGroup_Resource instance);
    44     partial void DeleteSlaveGroup_Resource(SlaveGroup_Resource instance);
    4536    partial void InsertPlugin(Plugin instance);
    4637    partial void UpdatePlugin(Plugin instance);
    4738    partial void DeletePlugin(Plugin instance);
    48     partial void InsertProject(Project instance);
    49     partial void UpdateProject(Project instance);
    50     partial void DeleteProject(Project instance);
    5139    partial void InsertRequiredPlugin(RequiredPlugin instance);
    5240    partial void UpdateRequiredPlugin(RequiredPlugin instance);
     
    10189    }
    10290   
    103     public System.Data.Linq.Table<UptimeStatistic> UptimeStatistics
    104     {
    105       get
    106       {
    107         return this.GetTable<UptimeStatistic>();
    108       }
    109     }
    110    
    111     public System.Data.Linq.Table<SlaveConfig> SlaveConfigs
    112     {
    113       get
    114       {
    115         return this.GetTable<SlaveConfig>();
    116       }
    117     }
    118    
    119     public System.Data.Linq.Table<SlaveGroup_Resource> SlaveGroup_Resources
    120     {
    121       get
    122       {
    123         return this.GetTable<SlaveGroup_Resource>();
    124       }
    125     }
    126    
    12791    public System.Data.Linq.Table<Plugin> Plugins
    12892    {
     
    13094      {
    13195        return this.GetTable<Plugin>();
    132       }
    133     }
    134    
    135     public System.Data.Linq.Table<Project> Projects
    136     {
    137       get
    138       {
    139         return this.GetTable<Project>();
    14096      }
    14197    }
     
    390346  }
    391347 
    392   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UptimeStatistics")]
    393   public partial class UptimeStatistic : INotifyPropertyChanging, INotifyPropertyChanged
    394   {
    395    
    396     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    397    
    398     private System.Guid _UptimeStatisticsId;
    399    
    400     private System.DateTime _Login;
    401    
    402     private System.DateTime _Logout;
    403    
    404     private System.Guid _ResourceId;
    405    
    406     private EntityRef<Slave> _Slave;
    407    
    408     #region Extensibility Method Definitions
    409     partial void OnLoaded();
    410     partial void OnValidate(System.Data.Linq.ChangeAction action);
    411     partial void OnCreated();
    412     partial void OnUptimeStatisticsIdChanging(System.Guid value);
    413     partial void OnUptimeStatisticsIdChanged();
    414     partial void OnLoginChanging(System.DateTime value);
    415     partial void OnLoginChanged();
    416     partial void OnLogoutChanging(System.DateTime value);
    417     partial void OnLogoutChanged();
    418     partial void OnResourceIdChanging(System.Guid value);
    419     partial void OnResourceIdChanged();
    420     #endregion
    421    
    422     public UptimeStatistic()
    423     {
    424       this._Slave = default(EntityRef<Slave>);
    425       OnCreated();
    426     }
    427    
    428     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    429     public System.Guid UptimeStatisticsId
    430     {
    431       get
    432       {
    433         return this._UptimeStatisticsId;
    434       }
    435       set
    436       {
    437         if ((this._UptimeStatisticsId != value))
    438         {
    439           this.OnUptimeStatisticsIdChanging(value);
    440           this.SendPropertyChanging();
    441           this._UptimeStatisticsId = value;
    442           this.SendPropertyChanged("UptimeStatisticsId");
    443           this.OnUptimeStatisticsIdChanged();
    444         }
    445       }
    446     }
    447    
    448     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="DateTime")]
    449     public System.DateTime Login
    450     {
    451       get
    452       {
    453         return this._Login;
    454       }
    455       set
    456       {
    457         if ((this._Login != value))
    458         {
    459           this.OnLoginChanging(value);
    460           this.SendPropertyChanging();
    461           this._Login = value;
    462           this.SendPropertyChanged("Login");
    463           this.OnLoginChanged();
    464         }
    465       }
    466     }
    467    
    468     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Logout", DbType="DateTime")]
    469     public System.DateTime Logout
    470     {
    471       get
    472       {
    473         return this._Logout;
    474       }
    475       set
    476       {
    477         if ((this._Logout != value))
    478         {
    479           this.OnLogoutChanging(value);
    480           this.SendPropertyChanging();
    481           this._Logout = value;
    482           this.SendPropertyChanged("Logout");
    483           this.OnLogoutChanged();
    484         }
    485       }
    486     }
    487    
    488     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier")]
    489     public System.Guid ResourceId
    490     {
    491       get
    492       {
    493         return this._ResourceId;
    494       }
    495       set
    496       {
    497         if ((this._ResourceId != value))
    498         {
    499           if (this._Slave.HasLoadedOrAssignedValue)
    500           {
    501             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    502           }
    503           this.OnResourceIdChanging(value);
    504           this.SendPropertyChanging();
    505           this._ResourceId = value;
    506           this.SendPropertyChanged("ResourceId");
    507           this.OnResourceIdChanged();
    508         }
    509       }
    510     }
    511    
    512     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Slave_UptimeStatistic", Storage="_Slave", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
    513     public Slave Slave
    514     {
    515       get
    516       {
    517         return this._Slave.Entity;
    518       }
    519       set
    520       {
    521         Slave previousValue = this._Slave.Entity;
    522         if (((previousValue != value)
    523               || (this._Slave.HasLoadedOrAssignedValue == false)))
    524         {
    525           this.SendPropertyChanging();
    526           if ((previousValue != null))
    527           {
    528             this._Slave.Entity = null;
    529             previousValue.UptimeStatistics.Remove(this);
    530           }
    531           this._Slave.Entity = value;
    532           if ((value != null))
    533           {
    534             value.UptimeStatistics.Add(this);
    535             this._ResourceId = value.ResourceId;
    536           }
    537           else
    538           {
    539             this._ResourceId = default(System.Guid);
    540           }
    541           this.SendPropertyChanged("Slave");
    542         }
    543       }
    544     }
    545    
    546     public event PropertyChangingEventHandler PropertyChanging;
    547    
    548     public event PropertyChangedEventHandler PropertyChanged;
    549    
    550     protected virtual void SendPropertyChanging()
    551     {
    552       if ((this.PropertyChanging != null))
    553       {
    554         this.PropertyChanging(this, emptyChangingEventArgs);
    555       }
    556     }
    557    
    558     protected virtual void SendPropertyChanged(String propertyName)
    559     {
    560       if ((this.PropertyChanged != null))
    561       {
    562         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    563       }
    564     }
    565   }
    566  
    567   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SlaveConfig")]
    568   public partial class SlaveConfig : INotifyPropertyChanging, INotifyPropertyChanged
    569   {
    570    
    571     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    572    
    573     private System.Guid _SlaveConfigId;
    574    
    575     private System.Xml.Linq.XElement _UpDownTimeCalendar;
    576    
    577     private System.Nullable<int> _HeartBeatIntervall;
    578    
    579     private EntitySet<Slave> _Slaves;
    580    
    581     #region Extensibility Method Definitions
    582     partial void OnLoaded();
    583     partial void OnValidate(System.Data.Linq.ChangeAction action);
    584     partial void OnCreated();
    585     partial void OnSlaveConfigIdChanging(System.Guid value);
    586     partial void OnSlaveConfigIdChanged();
    587     partial void OnUpDownTimeCalendarChanging(System.Xml.Linq.XElement value);
    588     partial void OnUpDownTimeCalendarChanged();
    589     partial void OnHeartBeatIntervallChanging(System.Nullable<int> value);
    590     partial void OnHeartBeatIntervallChanged();
    591     #endregion
    592    
    593     public SlaveConfig()
    594     {
    595       this._Slaves = new EntitySet<Slave>(new Action<Slave>(this.attach_Slaves), new Action<Slave>(this.detach_Slaves));
    596       OnCreated();
    597     }
    598    
    599     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveConfigId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    600     public System.Guid SlaveConfigId
    601     {
    602       get
    603       {
    604         return this._SlaveConfigId;
    605       }
    606       set
    607       {
    608         if ((this._SlaveConfigId != value))
    609         {
    610           this.OnSlaveConfigIdChanging(value);
    611           this.SendPropertyChanging();
    612           this._SlaveConfigId = value;
    613           this.SendPropertyChanged("SlaveConfigId");
    614           this.OnSlaveConfigIdChanged();
    615         }
    616       }
    617     }
    618    
    619     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpDownTimeCalendar", DbType="Xml", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
    620     public System.Xml.Linq.XElement UpDownTimeCalendar
    621     {
    622       get
    623       {
    624         return this._UpDownTimeCalendar;
    625       }
    626       set
    627       {
    628         if ((this._UpDownTimeCalendar != value))
    629         {
    630           this.OnUpDownTimeCalendarChanging(value);
    631           this.SendPropertyChanging();
    632           this._UpDownTimeCalendar = value;
    633           this.SendPropertyChanged("UpDownTimeCalendar");
    634           this.OnUpDownTimeCalendarChanged();
    635         }
    636       }
    637     }
    638    
    639     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HeartBeatIntervall", DbType="Int")]
    640     public System.Nullable<int> HeartBeatIntervall
    641     {
    642       get
    643       {
    644         return this._HeartBeatIntervall;
    645       }
    646       set
    647       {
    648         if ((this._HeartBeatIntervall != value))
    649         {
    650           this.OnHeartBeatIntervallChanging(value);
    651           this.SendPropertyChanging();
    652           this._HeartBeatIntervall = value;
    653           this.SendPropertyChanged("HeartBeatIntervall");
    654           this.OnHeartBeatIntervallChanged();
    655         }
    656       }
    657     }
    658    
    659     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="SlaveConfig_Slave", Storage="_Slaves", ThisKey="SlaveConfigId", OtherKey="SlaveConfigId")]
    660     public EntitySet<Slave> Slaves
    661     {
    662       get
    663       {
    664         return this._Slaves;
    665       }
    666       set
    667       {
    668         this._Slaves.Assign(value);
    669       }
    670     }
    671    
    672     public event PropertyChangingEventHandler PropertyChanging;
    673    
    674     public event PropertyChangedEventHandler PropertyChanged;
    675    
    676     protected virtual void SendPropertyChanging()
    677     {
    678       if ((this.PropertyChanging != null))
    679       {
    680         this.PropertyChanging(this, emptyChangingEventArgs);
    681       }
    682     }
    683    
    684     protected virtual void SendPropertyChanged(String propertyName)
    685     {
    686       if ((this.PropertyChanged != null))
    687       {
    688         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    689       }
    690     }
    691    
    692     private void attach_Slaves(Slave entity)
    693     {
    694       this.SendPropertyChanging();
    695       entity.SlaveConfig = this;
    696     }
    697    
    698     private void detach_Slaves(Slave entity)
    699     {
    700       this.SendPropertyChanging();
    701       entity.SlaveConfig = null;
    702     }
    703   }
    704  
    705   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SlaveGroup_Resource")]
    706   public partial class SlaveGroup_Resource : INotifyPropertyChanging, INotifyPropertyChanged
    707   {
    708    
    709     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    710    
    711     private System.Guid _SlaveGroup_RessourceId;
    712    
    713     private System.Guid _SlaveGroupId;
    714    
    715     private System.Guid _ResourceId;
    716    
    717     private EntityRef<SlaveGroup> _SlaveGroup;
    718    
    719     private EntityRef<Resource> _Resource;
    720    
    721     #region Extensibility Method Definitions
    722     partial void OnLoaded();
    723     partial void OnValidate(System.Data.Linq.ChangeAction action);
    724     partial void OnCreated();
    725     partial void OnSlaveGroup_RessourceIdChanging(System.Guid value);
    726     partial void OnSlaveGroup_RessourceIdChanged();
    727     partial void OnSlaveGroupIdChanging(System.Guid value);
    728     partial void OnSlaveGroupIdChanged();
    729     partial void OnResourceIdChanging(System.Guid value);
    730     partial void OnResourceIdChanged();
    731     #endregion
    732    
    733     public SlaveGroup_Resource()
    734     {
    735       this._SlaveGroup = default(EntityRef<SlaveGroup>);
    736       this._Resource = default(EntityRef<Resource>);
    737       OnCreated();
    738     }
    739    
    740     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveGroup_RessourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    741     public System.Guid SlaveGroup_RessourceId
    742     {
    743       get
    744       {
    745         return this._SlaveGroup_RessourceId;
    746       }
    747       set
    748       {
    749         if ((this._SlaveGroup_RessourceId != value))
    750         {
    751           this.OnSlaveGroup_RessourceIdChanging(value);
    752           this.SendPropertyChanging();
    753           this._SlaveGroup_RessourceId = value;
    754           this.SendPropertyChanged("SlaveGroup_RessourceId");
    755           this.OnSlaveGroup_RessourceIdChanged();
    756         }
    757       }
    758     }
    759    
    760     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveGroupId", DbType="UniqueIdentifier NOT NULL")]
    761     public System.Guid SlaveGroupId
    762     {
    763       get
    764       {
    765         return this._SlaveGroupId;
    766       }
    767       set
    768       {
    769         if ((this._SlaveGroupId != value))
    770         {
    771           if (this._SlaveGroup.HasLoadedOrAssignedValue)
    772           {
    773             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    774           }
    775           this.OnSlaveGroupIdChanging(value);
    776           this.SendPropertyChanging();
    777           this._SlaveGroupId = value;
    778           this.SendPropertyChanged("SlaveGroupId");
    779           this.OnSlaveGroupIdChanged();
    780         }
    781       }
    782     }
    783    
    784     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
    785     public System.Guid ResourceId
    786     {
    787       get
    788       {
    789         return this._ResourceId;
    790       }
    791       set
    792       {
    793         if ((this._ResourceId != value))
    794         {
    795           if (this._Resource.HasLoadedOrAssignedValue)
    796           {
    797             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    798           }
    799           this.OnResourceIdChanging(value);
    800           this.SendPropertyChanging();
    801           this._ResourceId = value;
    802           this.SendPropertyChanged("ResourceId");
    803           this.OnResourceIdChanged();
    804         }
    805       }
    806     }
    807    
    808     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="SlaveGroup_SlaveGroup_Resource", Storage="_SlaveGroup", ThisKey="SlaveGroupId", OtherKey="ResourceId", IsForeignKey=true)]
    809     public SlaveGroup SlaveGroup
    810     {
    811       get
    812       {
    813         return this._SlaveGroup.Entity;
    814       }
    815       set
    816       {
    817         SlaveGroup previousValue = this._SlaveGroup.Entity;
    818         if (((previousValue != value)
    819               || (this._SlaveGroup.HasLoadedOrAssignedValue == false)))
    820         {
    821           this.SendPropertyChanging();
    822           if ((previousValue != null))
    823           {
    824             this._SlaveGroup.Entity = null;
    825             previousValue.SlaveGroup_Resources_Children.Remove(this);
    826           }
    827           this._SlaveGroup.Entity = value;
    828           if ((value != null))
    829           {
    830             value.SlaveGroup_Resources_Children.Add(this);
    831             this._SlaveGroupId = value.ResourceId;
    832           }
    833           else
    834           {
    835             this._SlaveGroupId = default(System.Guid);
    836           }
    837           this.SendPropertyChanged("SlaveGroup");
    838         }
    839       }
    840     }
    841    
    842     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_SlaveGroup_Resource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
    843     public Resource Resource
    844     {
    845       get
    846       {
    847         return this._Resource.Entity;
    848       }
    849       set
    850       {
    851         Resource previousValue = this._Resource.Entity;
    852         if (((previousValue != value)
    853               || (this._Resource.HasLoadedOrAssignedValue == false)))
    854         {
    855           this.SendPropertyChanging();
    856           if ((previousValue != null))
    857           {
    858             this._Resource.Entity = null;
    859             previousValue.SlaveGroup_Resources_Parents.Remove(this);
    860           }
    861           this._Resource.Entity = value;
    862           if ((value != null))
    863           {
    864             value.SlaveGroup_Resources_Parents.Add(this);
    865             this._ResourceId = value.ResourceId;
    866           }
    867           else
    868           {
    869             this._ResourceId = default(System.Guid);
    870           }
    871           this.SendPropertyChanged("Resource");
    872         }
    873       }
    874     }
    875    
    876     public event PropertyChangingEventHandler PropertyChanging;
    877    
    878     public event PropertyChangedEventHandler PropertyChanged;
    879    
    880     protected virtual void SendPropertyChanging()
    881     {
    882       if ((this.PropertyChanging != null))
    883       {
    884         this.PropertyChanging(this, emptyChangingEventArgs);
    885       }
    886     }
    887    
    888     protected virtual void SendPropertyChanged(String propertyName)
    889     {
    890       if ((this.PropertyChanged != null))
    891       {
    892         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    893       }
    894     }
    895   }
    896  
    897348  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Plugin")]
    898349  public partial class Plugin : INotifyPropertyChanging, INotifyPropertyChanged
     
    1033484  }
    1034485 
    1035   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Project")]
    1036   public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged
    1037   {
    1038    
    1039     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    1040    
    1041     private System.Guid _ProjectId;
    1042    
    1043     private string _Name;
    1044    
    1045     private EntitySet<Job> _Jobs;
    1046    
    1047     #region Extensibility Method Definitions
    1048     partial void OnLoaded();
    1049     partial void OnValidate(System.Data.Linq.ChangeAction action);
    1050     partial void OnCreated();
    1051     partial void OnProjectIdChanging(System.Guid value);
    1052     partial void OnProjectIdChanged();
    1053     partial void OnNameChanging(string value);
    1054     partial void OnNameChanged();
    1055     #endregion
    1056    
    1057     public Project()
    1058     {
    1059       this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
    1060       OnCreated();
    1061     }
    1062    
    1063     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    1064     public System.Guid ProjectId
    1065     {
    1066       get
    1067       {
    1068         return this._ProjectId;
    1069       }
    1070       set
    1071       {
    1072         if ((this._ProjectId != value))
    1073         {
    1074           this.OnProjectIdChanging(value);
    1075           this.SendPropertyChanging();
    1076           this._ProjectId = value;
    1077           this.SendPropertyChanged("ProjectId");
    1078           this.OnProjectIdChanged();
    1079         }
    1080       }
    1081     }
    1082    
    1083     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
    1084     public string Name
    1085     {
    1086       get
    1087       {
    1088         return this._Name;
    1089       }
    1090       set
    1091       {
    1092         if ((this._Name != value))
    1093         {
    1094           this.OnNameChanging(value);
    1095           this.SendPropertyChanging();
    1096           this._Name = value;
    1097           this.SendPropertyChanged("Name");
    1098           this.OnNameChanged();
    1099         }
    1100       }
    1101     }
    1102    
    1103     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")]
    1104     public EntitySet<Job> Jobs
    1105     {
    1106       get
    1107       {
    1108         return this._Jobs;
    1109       }
    1110       set
    1111       {
    1112         this._Jobs.Assign(value);
    1113       }
    1114     }
    1115    
    1116     public event PropertyChangingEventHandler PropertyChanging;
    1117    
    1118     public event PropertyChangedEventHandler PropertyChanged;
    1119    
    1120     protected virtual void SendPropertyChanging()
    1121     {
    1122       if ((this.PropertyChanging != null))
    1123       {
    1124         this.PropertyChanging(this, emptyChangingEventArgs);
    1125       }
    1126     }
    1127    
    1128     protected virtual void SendPropertyChanged(String propertyName)
    1129     {
    1130       if ((this.PropertyChanged != null))
    1131       {
    1132         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    1133       }
    1134     }
    1135    
    1136     private void attach_Jobs(Job entity)
    1137     {
    1138       this.SendPropertyChanging();
    1139       entity.Project = this;
    1140     }
    1141    
    1142     private void detach_Jobs(Job entity)
    1143     {
    1144       this.SendPropertyChanging();
    1145       entity.Project = null;
    1146     }
    1147   }
    1148  
    1149486  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RequiredPlugins")]
    1150487  public partial class RequiredPlugin : INotifyPropertyChanging, INotifyPropertyChanged
     
    1354691    private string _ResourceType;
    1355692   
     693    private System.Nullable<System.Guid> _ParentResourceId;
     694   
    1356695    private EntitySet<AssignedResource> _AssignedResources;
    1357696   
    1358     private EntitySet<SlaveGroup_Resource> _SlaveGroup_Resources_Parents;
    1359    
    1360697    private EntitySet<UptimeCalendar> _UptimeCalendars;
     698   
     699    private EntitySet<Resource> _ChildResources;
     700   
     701    private EntityRef<Resource> _ParentResource;
    1361702   
    1362703    #region Extensibility Method Definitions
     
    1370711    partial void OnResourceTypeChanging(string value);
    1371712    partial void OnResourceTypeChanged();
     713    partial void OnParentResourceIdChanging(System.Nullable<System.Guid> value);
     714    partial void OnParentResourceIdChanged();
    1372715    #endregion
    1373716   
     
    1375718    {
    1376719      this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
    1377       this._SlaveGroup_Resources_Parents = new EntitySet<SlaveGroup_Resource>(new Action<SlaveGroup_Resource>(this.attach_SlaveGroup_Resources_Parents), new Action<SlaveGroup_Resource>(this.detach_SlaveGroup_Resources_Parents));
    1378720      this._UptimeCalendars = new EntitySet<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
     721      this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
     722      this._ParentResource = default(EntityRef<Resource>);
    1379723      OnCreated();
    1380724    }
    1381725   
    1382     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     726    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    1383727    public System.Guid ResourceId
    1384728    {
     
    1440784    }
    1441785   
     786    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentResourceId", DbType="UniqueIdentifier")]
     787    public System.Nullable<System.Guid> ParentResourceId
     788    {
     789      get
     790      {
     791        return this._ParentResourceId;
     792      }
     793      set
     794      {
     795        if ((this._ParentResourceId != value))
     796        {
     797          if (this._ParentResource.HasLoadedOrAssignedValue)
     798          {
     799            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     800          }
     801          this.OnParentResourceIdChanging(value);
     802          this.SendPropertyChanging();
     803          this._ParentResourceId = value;
     804          this.SendPropertyChanged("ParentResourceId");
     805          this.OnParentResourceIdChanged();
     806        }
     807      }
     808    }
     809   
    1442810    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
    1443811    public EntitySet<AssignedResource> AssignedResources
     
    1453821    }
    1454822   
    1455     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_SlaveGroup_Resource", Storage="_SlaveGroup_Resources_Parents", ThisKey="ResourceId", OtherKey="ResourceId")]
    1456     public EntitySet<SlaveGroup_Resource> SlaveGroup_Resources_Parents
    1457     {
    1458       get
    1459       {
    1460         return this._SlaveGroup_Resources_Parents;
    1461       }
    1462       set
    1463       {
    1464         this._SlaveGroup_Resources_Parents.Assign(value);
    1465       }
    1466     }
    1467    
    1468823    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
    1469824    public EntitySet<UptimeCalendar> UptimeCalendars
     
    1479834    }
    1480835   
     836    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ChildResources", ThisKey="ResourceId", OtherKey="ParentResourceId")]
     837    public EntitySet<Resource> ChildResources
     838    {
     839      get
     840      {
     841        return this._ChildResources;
     842      }
     843      set
     844      {
     845        this._ChildResources.Assign(value);
     846      }
     847    }
     848   
     849    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ParentResource", ThisKey="ParentResourceId", OtherKey="ResourceId", IsForeignKey=true)]
     850    public Resource ParentResource
     851    {
     852      get
     853      {
     854        return this._ParentResource.Entity;
     855      }
     856      set
     857      {
     858        Resource previousValue = this._ParentResource.Entity;
     859        if (((previousValue != value)
     860              || (this._ParentResource.HasLoadedOrAssignedValue == false)))
     861        {
     862          this.SendPropertyChanging();
     863          if ((previousValue != null))
     864          {
     865            this._ParentResource.Entity = null;
     866            previousValue.ChildResources.Remove(this);
     867          }
     868          this._ParentResource.Entity = value;
     869          if ((value != null))
     870          {
     871            value.ChildResources.Add(this);
     872            this._ParentResourceId = value.ResourceId;
     873          }
     874          else
     875          {
     876            this._ParentResourceId = default(Nullable<System.Guid>);
     877          }
     878          this.SendPropertyChanged("ParentResource");
     879        }
     880      }
     881    }
     882   
    1481883    public event PropertyChangingEventHandler PropertyChanging;
    1482884   
     
    1511913    }
    1512914   
    1513     private void attach_SlaveGroup_Resources_Parents(SlaveGroup_Resource entity)
     915    private void attach_UptimeCalendars(UptimeCalendar entity)
    1514916    {
    1515917      this.SendPropertyChanging();
     
    1517919    }
    1518920   
    1519     private void detach_SlaveGroup_Resources_Parents(SlaveGroup_Resource entity)
     921    private void detach_UptimeCalendars(UptimeCalendar entity)
    1520922    {
    1521923      this.SendPropertyChanging();
     
    1523925    }
    1524926   
    1525     private void attach_UptimeCalendars(UptimeCalendar entity)
     927    private void attach_ChildResources(Resource entity)
    1526928    {
    1527929      this.SendPropertyChanging();
    1528       entity.Resource = this;
    1529     }
    1530    
    1531     private void detach_UptimeCalendars(UptimeCalendar entity)
     930      entity.ParentResource = this;
     931    }
     932   
     933    private void detach_ChildResources(Resource entity)
    1532934    {
    1533935      this.SendPropertyChanging();
    1534       entity.Resource = null;
     936      entity.ParentResource = null;
    1535937    }
    1536938  }
     
    1547949    private global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState _Status;
    1548950   
    1549     private global::HeuristicLab.Services.Hive.Common.DataTransfer.CalendarState _CalendarSyncStatus;
    1550    
    1551     private System.Nullable<System.Guid> _UseCalendarFromResourceId;
    1552    
    1553     private System.Nullable<System.Guid> _SlaveConfigId;
    1554    
    1555951    private System.Nullable<int> _NumberOfCores;
    1556952   
     
    1561957    private bool _IsAllowedToCalculate;
    1562958   
    1563     private EntitySet<UptimeStatistic> _UptimeStatistics;
    1564    
    1565959    private EntitySet<Job> _Jobs;
    1566    
    1567     private EntityRef<SlaveConfig> _SlaveConfig;
    1568960   
    1569961    #region Extensibility Method Definitions
     
    1579971    partial void OnSlaveStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState value);
    1580972    partial void OnSlaveStateChanged();
    1581     partial void OnCalendarSyncStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.CalendarState value);
    1582     partial void OnCalendarSyncStateChanged();
    1583     partial void OnUseCalendarFromResourceIdChanging(System.Nullable<System.Guid> value);
    1584     partial void OnUseCalendarFromResourceIdChanged();
    1585     partial void OnSlaveConfigIdChanging(System.Nullable<System.Guid> value);
    1586     partial void OnSlaveConfigIdChanged();
    1587973    partial void OnCoresChanging(System.Nullable<int> value);
    1588974    partial void OnCoresChanged();
     
    1597983    public Slave()
    1598984    {
    1599       this._UptimeStatistics = new EntitySet<UptimeStatistic>(new Action<UptimeStatistic>(this.attach_UptimeStatistics), new Action<UptimeStatistic>(this.detach_UptimeStatistics));
    1600985      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
    1601       this._SlaveConfig = default(EntityRef<SlaveConfig>);
    1602986      OnCreated();
    1603987    }
     
    16831067    }
    16841068   
    1685     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalendarSyncStatus", DbType="VarChar(MAX)", CanBeNull=true)]
    1686     public global::HeuristicLab.Services.Hive.Common.DataTransfer.CalendarState CalendarSyncState
    1687     {
    1688       get
    1689       {
    1690         return this._CalendarSyncStatus;
    1691       }
    1692       set
    1693       {
    1694         if ((this._CalendarSyncStatus != value))
    1695         {
    1696           this.OnCalendarSyncStateChanging(value);
    1697           this.SendPropertyChanging();
    1698           this._CalendarSyncStatus = value;
    1699           this.SendPropertyChanged("CalendarSyncState");
    1700           this.OnCalendarSyncStateChanged();
    1701         }
    1702       }
    1703     }
    1704    
    1705     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UseCalendarFromResourceId", DbType="UniqueIdentifier")]
    1706     public System.Nullable<System.Guid> UseCalendarFromResourceId
    1707     {
    1708       get
    1709       {
    1710         return this._UseCalendarFromResourceId;
    1711       }
    1712       set
    1713       {
    1714         if ((this._UseCalendarFromResourceId != value))
    1715         {
    1716           this.OnUseCalendarFromResourceIdChanging(value);
    1717           this.SendPropertyChanging();
    1718           this._UseCalendarFromResourceId = value;
    1719           this.SendPropertyChanged("UseCalendarFromResourceId");
    1720           this.OnUseCalendarFromResourceIdChanged();
    1721         }
    1722       }
    1723     }
    1724    
    1725     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveConfigId", DbType="UniqueIdentifier")]
    1726     public System.Nullable<System.Guid> SlaveConfigId
    1727     {
    1728       get
    1729       {
    1730         return this._SlaveConfigId;
    1731       }
    1732       set
    1733       {
    1734         if ((this._SlaveConfigId != value))
    1735         {
    1736           if (this._SlaveConfig.HasLoadedOrAssignedValue)
    1737           {
    1738             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    1739           }
    1740           this.OnSlaveConfigIdChanging(value);
    1741           this.SendPropertyChanging();
    1742           this._SlaveConfigId = value;
    1743           this.SendPropertyChanged("SlaveConfigId");
    1744           this.OnSlaveConfigIdChanged();
    1745         }
    1746       }
    1747     }
    1748    
    17491069    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfCores", DbType="Int")]
    17501070    public System.Nullable<int> Cores
     
    18271147    }
    18281148   
    1829     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Slave_UptimeStatistic", Storage="_UptimeStatistics", ThisKey="ResourceId", OtherKey="ResourceId")]
    1830     public EntitySet<UptimeStatistic> UptimeStatistics
    1831     {
    1832       get
    1833       {
    1834         return this._UptimeStatistics;
    1835       }
    1836       set
    1837       {
    1838         this._UptimeStatistics.Assign(value);
    1839       }
    1840     }
    1841    
    18421149    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Slave_Job", Storage="_Jobs", ThisKey="ResourceId", OtherKey="SlaveId")]
    18431150    public EntitySet<Job> Jobs
     
    18511158        this._Jobs.Assign(value);
    18521159      }
    1853     }
    1854    
    1855     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="SlaveConfig_Slave", Storage="_SlaveConfig", ThisKey="SlaveConfigId", OtherKey="SlaveConfigId", IsForeignKey=true, DeleteRule="SET NULL")]
    1856     public SlaveConfig SlaveConfig
    1857     {
    1858       get
    1859       {
    1860         return this._SlaveConfig.Entity;
    1861       }
    1862       set
    1863       {
    1864         SlaveConfig previousValue = this._SlaveConfig.Entity;
    1865         if (((previousValue != value)
    1866               || (this._SlaveConfig.HasLoadedOrAssignedValue == false)))
    1867         {
    1868           this.SendPropertyChanging();
    1869           if ((previousValue != null))
    1870           {
    1871             this._SlaveConfig.Entity = null;
    1872             previousValue.Slaves.Remove(this);
    1873           }
    1874           this._SlaveConfig.Entity = value;
    1875           if ((value != null))
    1876           {
    1877             value.Slaves.Add(this);
    1878             this._SlaveConfigId = value.SlaveConfigId;
    1879           }
    1880           else
    1881           {
    1882             this._SlaveConfigId = default(Nullable<System.Guid>);
    1883           }
    1884           this.SendPropertyChanged("SlaveConfig");
    1885         }
    1886       }
    1887     }
    1888    
    1889     private void attach_UptimeStatistics(UptimeStatistic entity)
    1890     {
    1891       this.SendPropertyChanging();
    1892       entity.Slave = this;
    1893     }
    1894    
    1895     private void detach_UptimeStatistics(UptimeStatistic entity)
    1896     {
    1897       this.SendPropertyChanging();
    1898       entity.Slave = null;
    18991160    }
    19001161   
     
    19141175  public partial class SlaveGroup : Resource
    19151176  {
    1916    
    1917     private EntitySet<SlaveGroup_Resource> _SlaveGroup_Resources_Children;
    19181177   
    19191178    #region Extensibility Method Definitions
     
    19251184    public SlaveGroup()
    19261185    {
    1927       this._SlaveGroup_Resources_Children = new EntitySet<SlaveGroup_Resource>(new Action<SlaveGroup_Resource>(this.attach_SlaveGroup_Resources_Children), new Action<SlaveGroup_Resource>(this.detach_SlaveGroup_Resources_Children));
    19281186      OnCreated();
    1929     }
    1930    
    1931     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="SlaveGroup_SlaveGroup_Resource", Storage="_SlaveGroup_Resources_Children", ThisKey="ResourceId", OtherKey="SlaveGroupId")]
    1932     public EntitySet<SlaveGroup_Resource> SlaveGroup_Resources_Children
    1933     {
    1934       get
    1935       {
    1936         return this._SlaveGroup_Resources_Children;
    1937       }
    1938       set
    1939       {
    1940         this._SlaveGroup_Resources_Children.Assign(value);
    1941       }
    1942     }
    1943    
    1944     private void attach_SlaveGroup_Resources_Children(SlaveGroup_Resource entity)
    1945     {
    1946       this.SendPropertyChanging();
    1947       entity.SlaveGroup = this;
    1948     }
    1949    
    1950     private void detach_SlaveGroup_Resources_Children(SlaveGroup_Resource entity)
    1951     {
    1952       this.SendPropertyChanging();
    1953       entity.SlaveGroup = null;
    19541187    }
    19551188  }
     
    19731206    private string _Exception;
    19741207   
    1975     private System.Nullable<System.DateTime> _DateCreated;
     1208    private System.DateTime _DateCreated;
    19761209   
    19771210    private System.Nullable<System.DateTime> _DateCalculated;
     
    19981231   
    19991232    private EntityRef<Job> _Job1;
    2000    
    2001     private EntityRef<Project> _Project;
    20021233   
    20031234    private EntityRef<Slave> _Slave;
     
    20191250    partial void OnExceptionChanging(string value);
    20201251    partial void OnExceptionChanged();
    2021     partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
     1252    partial void OnDateCreatedChanging(System.DateTime value);
    20221253    partial void OnDateCreatedChanged();
    20231254    partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
     
    20441275      this._JobData = default(EntityRef<JobData>);
    20451276      this._Job1 = default(EntityRef<Job>);
    2046       this._Project = default(EntityRef<Project>);
    20471277      this._Slave = default(EntityRef<Slave>);
    20481278      OnCreated();
     
    21741404   
    21751405    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
    2176     public System.Nullable<System.DateTime> DateCreated
     1406    public System.DateTime DateCreated
    21771407    {
    21781408      get
     
    22641494        if ((this._ProjectId != value))
    22651495        {
    2266           if (this._Project.HasLoadedOrAssignedValue)
    2267           {
    2268             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    2269           }
    22701496          this.OnProjectIdChanging(value);
    22711497          this.SendPropertyChanging();
     
    23641590   
    23651591    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
    2366     public EntitySet<Job> Jobs
     1592    public EntitySet<Job> ChildJobs
    23671593    {
    23681594      get
     
    24061632   
    24071633    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
    2408     public Job Job1
     1634    public Job ParentJob
    24091635    {
    24101636      get
     
    24221648          {
    24231649            this._Job1.Entity = null;
    2424             previousValue.Jobs.Remove(this);
     1650            previousValue.ChildJobs.Remove(this);
    24251651          }
    24261652          this._Job1.Entity = value;
    24271653          if ((value != null))
    24281654          {
    2429             value.Jobs.Add(this);
     1655            value.ChildJobs.Add(this);
    24301656            this._ParentJobId = value.JobId;
    24311657          }
     
    24341660            this._ParentJobId = default(Nullable<System.Guid>);
    24351661          }
    2436           this.SendPropertyChanged("Job1");
    2437         }
    2438       }
    2439     }
    2440    
    2441     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
    2442     public Project Project
    2443     {
    2444       get
    2445       {
    2446         return this._Project.Entity;
    2447       }
    2448       set
    2449       {
    2450         Project previousValue = this._Project.Entity;
    2451         if (((previousValue != value)
    2452               || (this._Project.HasLoadedOrAssignedValue == false)))
    2453         {
    2454           this.SendPropertyChanging();
    2455           if ((previousValue != null))
    2456           {
    2457             this._Project.Entity = null;
    2458             previousValue.Jobs.Remove(this);
    2459           }
    2460           this._Project.Entity = value;
    2461           if ((value != null))
    2462           {
    2463             value.Jobs.Add(this);
    2464             this._ProjectId = value.ProjectId;
    2465           }
    2466           else
    2467           {
    2468             this._ProjectId = default(Nullable<System.Guid>);
    2469           }
    2470           this.SendPropertyChanged("Project");
     1662          this.SendPropertyChanged("ParentJob");
    24711663        }
    24721664      }
     
    25541746    {
    25551747      this.SendPropertyChanging();
    2556       entity.Job1 = this;
     1748      entity.ParentJob = this;
    25571749    }
    25581750   
     
    25601752    {
    25611753      this.SendPropertyChanging();
    2562       entity.Job1 = null;
     1754      entity.ParentJob = null;
    25631755    }
    25641756  }
     
    28272019    private System.Guid _UserId;
    28282020   
    2829     private System.Nullable<System.Guid> _RootJobId;
     2021    private System.Guid _RootJobId;
     2022   
     2023    private System.DateTime _DateCreated;
    28302024   
    28312025    private EntityRef<Job> _Job;
     
    28452039    partial void OnUserIdChanging(System.Guid value);
    28462040    partial void OnUserIdChanged();
    2847     partial void OnRootJobIdChanging(System.Nullable<System.Guid> value);
     2041    partial void OnRootJobIdChanging(System.Guid value);
    28482042    partial void OnRootJobIdChanged();
     2043    partial void OnDateCreatedChanging(System.DateTime value);
     2044    partial void OnDateCreatedChanged();
    28492045    #endregion
    28502046   
     
    29562152   
    29572153    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RootJobId", DbType="UniqueIdentifier")]
    2958     public System.Nullable<System.Guid> RootJobId
     2154    public System.Guid RootJobId
    29592155    {
    29602156      get
     
    29752171          this.SendPropertyChanged("RootJobId");
    29762172          this.OnRootJobIdChanged();
     2173        }
     2174      }
     2175    }
     2176   
     2177    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
     2178    public System.DateTime DateCreated
     2179    {
     2180      get
     2181      {
     2182        return this._DateCreated;
     2183      }
     2184      set
     2185      {
     2186        if ((this._DateCreated != value))
     2187        {
     2188          this.OnDateCreatedChanging(value);
     2189          this.SendPropertyChanging();
     2190          this._DateCreated = value;
     2191          this.SendPropertyChanged("DateCreated");
     2192          this.OnDateCreatedChanged();
    29772193        }
    29782194      }
     
    30272243   
    30282244    private System.Data.Linq.Binary _Data;
     2245   
     2246    private System.DateTime _LastUpdate;
    30292247   
    30302248    private EntityRef<Job> _Job;
     
    30382256    partial void OnDataChanging(System.Data.Linq.Binary value);
    30392257    partial void OnDataChanged();
     2258    partial void OnLastUpdateChanging(System.DateTime value);
     2259    partial void OnLastUpdateChanged();
    30402260    #endregion
    30412261   
     
    30862306          this.SendPropertyChanged("Data");
    30872307          this.OnDataChanged();
     2308        }
     2309      }
     2310    }
     2311   
     2312    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastUpdate", DbType="DateTime")]
     2313    public System.DateTime LastUpdate
     2314    {
     2315      get
     2316      {
     2317        return this._LastUpdate;
     2318      }
     2319      set
     2320      {
     2321        if ((this._LastUpdate != value))
     2322        {
     2323          this.OnLastUpdateChanging(value);
     2324          this.SendPropertyChanging();
     2325          this._LastUpdate = value;
     2326          this.SendPropertyChanged("LastUpdate");
     2327          this.OnLastUpdateChanged();
    30882328        }
    30892329      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Properties/Settings.Designer.cs

    r4593 r5106  
    2727        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    2828        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
    29         [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Initial Catalog=HeuristicLab.Hive;Integrated Security=True;" +
    30             "")]
     29        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=T" +
     30            "rue;")]
    3131        public string HeuristicLab_Hive_LinqConnectionString {
    3232            get {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Properties/Settings.settings

    r4593 r5106  
    11<?xml version='1.0' encoding='utf-8'?>
    2 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Hive.Server.LINQDataAccess.Properties" GeneratedClassName="Settings">
     2<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Services.Hive.DataAccess.Properties" GeneratedClassName="Settings">
    33  <Profiles />
    44  <Settings>
     
    66      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
    77&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    8   &lt;ConnectionString&gt;Data Source=localhost;Initial Catalog=HeuristicLab.Hive;Integrated Security=True;&lt;/ConnectionString&gt;
     8  &lt;ConnectionString&gt;Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;&lt;/ConnectionString&gt;
    99  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
    1010&lt;/SerializableConnectionString&gt;</DesignTimeValue>
    11       <Value Profile="(Default)">Data Source=localhost;Initial Catalog=HeuristicLab.Hive;Integrated Security=True;</Value>
     11      <Value Profile="(Default)">Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;</Value>
    1212    </Setting>
    1313  </Settings>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/CreateHiveDatabaseApplication.cs

    r5078 r5106  
    2121
    2222using HeuristicLab.PluginInfrastructure;
     23using System.IO;
     24using System.Windows.Forms;
    2325
    2426namespace HeuristicLab.Services.Hive.DataAccess {
    25   [Application("Create Hive-3.4 Database", "Creates new empty Hive Database.", true)]
     27  [Application("Create Hive-3.4 Database", "Creates new empty Hive Database.", false)]
    2628  class CreateHiveDatabaseApplication : ApplicationBase {
    2729
     
    3133          db.DeleteDatabase();
    3234        db.CreateDatabase();
     35        using (var sr = new StreamReader("../../../../HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql")) {
     36          var commands = sr.ReadToEnd().Split(new string[] {"GO\r"}, System.StringSplitOptions.RemoveEmptyEntries);
     37          foreach (var cmd in commands) {
     38            db.ExecuteCommand(cmd);
     39          }
     40        }
    3341      }
     42      MessageBox.Show("Successfully created HeuristicLab.Hive-3.4 database.");
    3443    }
    3544  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/cleanHiveDatabase.sql

    r4629 r5106  
    1 DELETE FROM [HeuristicLab.Hive].[dbo].AssignedResources
    2 DELETE FROM [HeuristicLab.Hive].[dbo].RequiredPlugins
    3 DELETE FROM [HeuristicLab.Hive].[dbo].PluginInfo
    4 DELETE FROM [HeuristicLab.Hive].[dbo].UptimeStatistics
    5 DELETE FROM [HeuristicLab.Hive].[dbo].UptimeCalendar
    6 DELETE FROM [HeuristicLab.Hive].[dbo].SlaveConfig
    7 DELETE FROM [HeuristicLab.Hive].[dbo].SlaveGroup_Resource
    8 DELETE FROM [HeuristicLab.Hive].[dbo].[Resource]
    9 DELETE FROM [HeuristicLab.Hive].[dbo].HiveExperiment
    10 DELETE FROM [HeuristicLab.Hive].[dbo].Job
     1DELETE FROM [HeuristicLab.Hive-3.4].[dbo].AssignedResources
     2DELETE FROM [HeuristicLab.Hive-3.4].[dbo].RequiredPlugins
     3DELETE FROM [HeuristicLab.Hive-3.4].[dbo].PluginData
     4DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Plugin
     5DELETE FROM [HeuristicLab.Hive-3.4].[dbo].UptimeCalendar
     6DELETE FROM [HeuristicLab.Hive-3.4].[dbo].SlaveGroup_Resource
     7DELETE FROM [HeuristicLab.Hive-3.4].[dbo].[Resource]
     8DELETE FROM [HeuristicLab.Hive-3.4].[dbo].HiveExperiment
     9DELETE FROM [HeuristicLab.Hive-3.4].[dbo].JobData
     10DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Job
    1111
    1212/** only jobs & experiments **/
    13 DELETE FROM [HeuristicLab.Hive].[dbo].AssignedResources
    14 DELETE FROM [HeuristicLab.Hive].[dbo].RequiredPlugins
    15 DELETE FROM [HeuristicLab.Hive].[dbo].PluginInfo
    16 DELETE FROM [HeuristicLab.Hive].[dbo].HiveExperiment
    17 DELETE FROM [HeuristicLab.Hive].[dbo].Job
     13DELETE FROM [HeuristicLab.Hive-3.4].[dbo].AssignedResources
     14DELETE FROM [HeuristicLab.Hive-3.4].[dbo].RequiredPlugins
     15DELETE FROM [HeuristicLab.Hive-3.4].[dbo].PluginData
     16DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Plugin
     17DELETE FROM [HeuristicLab.Hive-3.4].[dbo].HiveExperiment
     18DELETE FROM [HeuristicLab.Hive-3.4].[dbo].JobData
     19DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Job
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql

    r4905 r5106  
    11/* this script is supposed to be executed after the plain DB is generated by the linq-to-sql schema */
    22
    3 /*
    4 use these DROP commands if you want to run this query a second time on the same db */
     3/* use these DROP commands if you want to run this query a second time on the same db */
     4
    55/*
    66ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId DROP ROWGUIDCOL;
    77ALTER TABLE dbo.Job ALTER COLUMN JobId DROP ROWGUIDCOL;
    8 ALTER TABLE dbo.SlaveConfig ALTER COLUMN SlaveConfigId DROP ROWGUIDCOL;
    98ALTER TABLE dbo.SlaveGroup_Resource ALTER COLUMN SlaveGroup_RessourceId DROP ROWGUIDCOL;
    109ALTER TABLE dbo.Plugin ALTER COLUMN PluginId DROP ROWGUIDCOL;
    11 ALTER TABLE dbo.Project ALTER COLUMN ProjectId DROP ROWGUIDCOL;
    1210ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId DROP ROWGUIDCOL;
    1311ALTER TABLE dbo.Resource ALTER COLUMN ResourceId DROP ROWGUIDCOL;
    1412ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId DROP ROWGUIDCOL;
    15 ALTER TABLE dbo.UptimeStatistics ALTER COLUMN UptimeStatisticsId DROP ROWGUIDCOL;
    1613ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId DROP ROWGUIDCOL;
    1714
    1815ALTER TABLE dbo.AssignedResources DROP CONSTRAINT [DF_AssignedResources_AssignedRessourcesId];
    1916ALTER TABLE dbo.Job DROP CONSTRAINT [DF_Job_JobId];
    20 ALTER TABLE dbo.SlaveConfig DROP CONSTRAINT [DF_SlaveConfig_SlaveConfigId];
    2117ALTER TABLE dbo.SlaveGroup_Resource DROP CONSTRAINT [DF_SlaveGroup_ResourceSlaveGroup_RessourceId];
    2218ALTER TABLE dbo.Plugin DROP CONSTRAINT [DF_Plugin_PluginId];
    23 ALTER TABLE dbo.Project DROP CONSTRAINT [DF_Project_ProjectId];
    2419ALTER TABLE dbo.RequiredPlugins DROP CONSTRAINT [DF_RequiredPlugins_RequiredPluginId];
    2520ALTER TABLE dbo.Resource DROP CONSTRAINT [DF_Resource_ResourceId];
    2621ALTER TABLE dbo.UptimeCalendar DROP CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId];
    27 ALTER TABLE dbo.UptimeStatistics DROP CONSTRAINT [DF_UptimeStatistics_UptimeStatisticsId];
    2822ALTER TABLE dbo.HiveExperiment DROP CONSTRAINT [DF_HiveExperiment_HiveExperimentId];
    2923*/
     
    4741ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (newid()) FOR JobId;
    4842
    49 ALTER TABLE dbo.SlaveConfig ALTER COLUMN SlaveConfigId ADD ROWGUIDCOL;
    50 ALTER TABLE dbo.SlaveConfig WITH NOCHECK ADD CONSTRAINT [DF_SlaveConfig_SlaveConfigId] DEFAULT (newid()) FOR SlaveConfigId;
    51 
    52 ALTER TABLE dbo.SlaveGroup_Resource ALTER COLUMN SlaveGroup_RessourceId ADD ROWGUIDCOL;
    53 ALTER TABLE dbo.SlaveGroup_Resource WITH NOCHECK ADD CONSTRAINT [DF_SlaveGroup_Resource_SlaveGroup_RessourceId] DEFAULT (newid()) FOR SlaveGroup_RessourceId;
    54 
    5543ALTER TABLE dbo.Plugin ALTER COLUMN PluginId ADD ROWGUIDCOL;
    5644ALTER TABLE dbo.Plugin WITH NOCHECK ADD CONSTRAINT [DF_Plugin_PluginId] DEFAULT (newid()) FOR PluginId;
    57 
    58 ALTER TABLE dbo.Project ALTER COLUMN ProjectId ADD ROWGUIDCOL;
    59 ALTER TABLE dbo.Project WITH NOCHECK ADD CONSTRAINT [DF_Project_ProjectId] DEFAULT (newid()) FOR ProjectId;
    6045
    6146ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId ADD ROWGUIDCOL;
     
    8166ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId ADD ROWGUIDCOL;
    8267ALTER TABLE dbo.UptimeCalendar WITH NOCHECK ADD CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId] DEFAULT (newid()) FOR UptimeCalendarId;
    83 
    84 ALTER TABLE dbo.UptimeStatistics ALTER COLUMN UptimeStatisticsId ADD ROWGUIDCOL;
    85 ALTER TABLE dbo.UptimeStatistics WITH NOCHECK ADD CONSTRAINT [DF_UptimeStatistics_UptimeStatisticsId] DEFAULT (newid()) FOR UptimeStatisticsId;
    8668
    8769ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId ADD ROWGUIDCOL;
     
    137119  END
    138120 
     121  DELETE JobData FROM JobData INNER JOIN #Table ON JobData.JobId = #Table.JobId
    139122  DELETE Job FROM Job INNER JOIN #Table ON Job.JobId = #Table.JobId
    140123END
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/app.config

    r5078 r5106  
    55  <connectionStrings>
    66    <add name="HeuristicLab.Services.Hive.DataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString"
    7         connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;"
    8         providerName="System.Data.SqlClient" />
     7      connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;"
     8      providerName="System.Data.SqlClient" />
    99  </connectionStrings>
    1010</configuration>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/HeuristicLab.Services.Hive.Tests-3.4.csproj

    r5095 r5106  
    297297      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    298298    </Reference>
     299    <Reference Include="System.Data" />
     300    <Reference Include="System.Data.DataSetExtensions" />
     301    <Reference Include="System.Drawing" />
     302    <Reference Include="System.Runtime.Serialization" />
     303    <Reference Include="System.ServiceModel" />
     304    <Reference Include="System.ServiceProcess" />
     305    <Reference Include="System.Windows.Forms" />
     306    <Reference Include="System.Xml" />
     307    <Reference Include="System.Xml.Linq" />
    299308    <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1">
    300309      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\WeifenLuo.WinFormsUI.Docking-2.3.1.dll</HintPath>
     
    307316  </ItemGroup>
    308317  <ItemGroup>
     318    <Compile Include="PluginLoader.cs" />
     319    <Compile Include="ServiceTests.cs" />
    309320    <Compile Include="Mocks\MockAuthorizationManager.cs" />
    310321    <Compile Include="Mocks\MockLifecycleManager.cs" />
    311322    <Compile Include="Mocks\MockServiceLocator.cs" />
    312     <Compile Include="PluginLoader.cs" />
    313323    <Compile Include="Properties\AssemblyInfo.cs" />
    314     <Compile Include="ServerTest.cs" />
     324    <Compile Include="DaoTests.cs" />
    315325  </ItemGroup>
    316326  <ItemGroup>
     
    319329      <Name>HeuristicLab.Clients.Hive.Slave.Tests-3.4</Name>
    320330    </ProjectReference>
     331    <ProjectReference Include="..\HeuristicLab.Clients.Hive.Slave.Views\3.4\HeuristicLab.Clients.Hive.Slave.Views-3.4.csproj">
     332      <Project>{8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}</Project>
     333      <Name>HeuristicLab.Clients.Hive.Slave.Views-3.4</Name>
     334    </ProjectReference>
     335    <ProjectReference Include="..\HeuristicLab.Clients.Hive.Slave\3.4\HeuristicLab.Clients.Hive.Slave-3.4.csproj">
     336      <Project>{989FE92B-484E-41EE-87E2-6A24AF0381D8}</Project>
     337      <Name>HeuristicLab.Clients.Hive.Slave-3.4</Name>
     338    </ProjectReference>
     339    <ProjectReference Include="..\HeuristicLab.Clients.Hive.Views\3.4\HeuristicLab.Clients.Hive.Views-3.4.csproj">
     340      <Project>{E1D6C801-892A-406A-B606-F158E36DD3C3}</Project>
     341      <Name>HeuristicLab.Clients.Hive.Views-3.4</Name>
     342    </ProjectReference>
    321343    <ProjectReference Include="..\HeuristicLab.Clients.Hive\3.4\HeuristicLab.Clients.Hive-3.4.csproj">
    322344      <Project>{B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}</Project>
     
    344366      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    345367    </None>
     368    <Shadow Include="Test References\HeuristicLab.Clients.Hive.Views-3.4.accessor" />
     369    <Shadow Include="Test References\HeuristicLab.Clients.Hive-3.4.accessor" />
    346370  </ItemGroup>
    347371  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs

    r5095 r5106  
    2525    public ILifecycleManager LifecycleManager {
    2626      get {
    27         return new MockLifecycleManager();
     27        return defaultServiceLocator.LifecycleManager;
    2828      }
    2929    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs

    r5102 r5106  
    1717  /// Implementation of the Hive service (interface <see cref="IHiveService"/>).
    1818  /// </summary>
    19   [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)]
     19  [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    2020  public class HiveService : IHiveService {
    2121    private DataAccess.IHiveDao dao {
     
    3737    public Guid AddJob(Job job, JobData jobData) {
    3838      using (trans.OpenTransaction()) {
     39        job.UserId = auth.UserId;
     40        job.DateCreated = DateTime.Now;
     41        job.JobState = JobState.Waiting;
    3942        jobData.JobId = dao.AddJob(job);
     43        jobData.LastUpdate = DateTime.Now;
    4044        dao.AddJobData(jobData);
    4145        return jobData.JobId;
     
    4650      using (trans.OpenTransaction()) {
    4751        job.ParentJobId = parentJobId;
     52        jobData.LastUpdate = DateTime.Now;
    4853        return AddJob(job, jobData);
    4954      }
     
    6671    }
    6772
    68     // formerly GetLastSerializedResult
    6973    public JobData GetJobData(Guid jobId) {
    7074      return dao.GetJobData(jobId);
    7175    }
    7276
    73     public Stream GetJobDataStreamed(Guid jobId) {
    74       throw new NotImplementedException();
    75     }
    76 
    77     public void UpdateJob(Job jobDto, JobData jobDataDto) {
    78       using (trans.OpenTransaction()) {
    79         dao.UpdateJob(jobDto);
    80         dao.UpdateJobData(jobDataDto);
    81       }
    82     }
    83 
    84     public void UpdateJobDataStreamed(Stream stream) {
    85       using (trans.OpenTransaction()) {
    86         throw new NotImplementedException();
    87       }
    88     }
    89 
    90     public void DeleteChildJobs(Guid jobId) {
    91       using (trans.OpenTransaction()) {
    92         var jobs = GetChildJobs(jobId, true, false);
     77    public void UpdateJob(Job job, JobData jobData) {
     78      using (trans.OpenTransaction()) {
     79        jobData.LastUpdate = DateTime.Now;
     80        dao.UpdateJob(job);
     81        dao.UpdateJobData(jobData);
     82      }
     83    }
     84
     85    public void DeleteJob(Guid jobId) {
     86      using (trans.OpenTransaction()) {
     87        dao.DeleteJob(jobId);
     88      }
     89    }
     90
     91    public void DeleteChildJobs(Guid parentJobId) {
     92      using (trans.OpenTransaction()) {
     93        var jobs = GetChildJobs(parentJobId, true, false);
    9394        foreach (var job in jobs) {
    9495          dao.DeleteJob(job.Id);
     
    144145      using (trans.OpenTransaction()) {
    145146        hiveExperimentDto.UserId = auth.UserId;
     147        hiveExperimentDto.DateCreated = DateTime.Now;
    146148        return dao.AddHiveExperiment(hiveExperimentDto);
    147149      }
     
    157159      using (trans.OpenTransaction()) {
    158160        HiveExperiment he = dao.GetHiveExperiment(hiveExperimentId);
    159         if (he.RootJobId.HasValue) {
    160           var jobs = GetChildJobs(he.RootJobId.Value, true, true);
    161           foreach (var j in jobs) {
    162             dao.DeleteJobData(j.Id);
    163             dao.DeleteJob(j.Id);
    164           }
    165         }
    166         dao.DeleteHiveExperiment(hiveExperimentId);
    167       }
    168     }
    169     #endregion
    170    
     161        dao.DeleteHiveExperiment(hiveExperimentId); // child jobs will be deleted by db-trigger
     162      }
     163    }
     164    #endregion
     165
    171166    #region Login Methods
    172167    public void Hello(Guid slaveId, string name, int cores, int memory) {
     
    208203    }
    209204    #endregion
    210    
     205
    211206    #region Slave Methods
    212207    public Guid AddSlave(Slave slave) {
     
    222217    }
    223218
     219    public Slave GetSlave(Guid slaveId) {
     220      return dao.GetSlave(slaveId);
     221    }
     222
     223    public SlaveGroup GetSlaveGroup(Guid slaveGroupId) {
     224      return dao.GetSlaveGroup(slaveGroupId);
     225    }
     226
    224227    public IEnumerable<Slave> GetSlaves() {
    225228      return dao.GetSlaves(x => true);
     
    230233    }
    231234
     235    public void UpdateSlave(Slave slave) {
     236      using (trans.OpenTransaction()) {
     237        dao.UpdateSlave(slave);
     238      }
     239    }
     240
     241    public void UpdateSlaveGroup(SlaveGroup slaveGroup) {
     242      using (trans.OpenTransaction()) {
     243        dao.UpdateSlaveGroup(slaveGroup);
     244      }
     245    }
     246
     247    public void DeleteSlave(Guid slaveId) {
     248      using (trans.OpenTransaction()) {
     249        dao.DeleteSlave(slaveId);
     250      }
     251    }
     252
    232253    public void DeleteSlaveGroup(Guid slaveGroupId) {
    233254      using (trans.OpenTransaction()) {
     
    236257    }
    237258
    238     public void AddResourceToGroup(Guid slaveGroupId, Resource resource) {
    239       using (trans.OpenTransaction()) {
    240         throw new NotImplementedException();
    241       }
    242     }
    243 
    244     public void RemoveResourceFromGroup(Guid clientGroupId, Guid resourceId) {
    245       using (trans.OpenTransaction()) {
    246         throw new NotImplementedException();
    247       }
    248     }
    249 
    250     public void UpdateSlave(Slave slave) {
    251       using (trans.OpenTransaction()) {
    252         dao.UpdateSlave(slave);
    253       }
    254     }
     259    public void AddResourceToGroup(Guid slaveGroupId, Guid resourceId) {
     260      using (trans.OpenTransaction()) {
     261        var resource = dao.GetResource(resourceId);
     262        resource.ParentResourceId = slaveGroupId;
     263        dao.UpdateResource(resource);
     264      }
     265    }
     266
     267    public void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId) {
     268      using (trans.OpenTransaction()) {
     269        var resource = dao.GetResource(resourceId);
     270        resource.ParentResourceId = null;
     271        dao.UpdateResource(resource);
     272      }
     273    }
     274
    255275    #endregion
    256276
Note: See TracChangeset for help on using the changeset viewer.