Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/14/10 16:52:55 (13 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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      }
Note: See TracChangeset for help on using the changeset viewer.