Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/11 14:47:56 (14 years ago)
Author:
cneumuel
Message:

#1233

  • added StateLog to log state transitions of hive jobs
  • added permissions to hive experiments (in data access layer, no UI for that yet)
  • extended unit tests
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs

    r5458 r5511  
    3333        Id = source.JobId,
    3434        CoresNeeded = source.CoresNeeded,
    35         DateCalculated = source.DateCalculated,
    36         DateCreated = source.DateCreated,
    37         DateFinished = source.DateFinished,
    38         Exception = source.Exception,
    39         ExecutionTime = source.ExecutionTime,
     35        ExecutionTime = string.IsNullOrEmpty(source.ExecutionTime) ? TimeSpan.Zero : TimeSpan.Parse(source.ExecutionTime),
    4036        MemoryNeeded = source.MemoryNeeded,
    4137        ParentJobId = source.ParentJobId,
    4238        Priority = source.Priority,
    43         SlaveId = source.SlaveId,
    44         JobState = source.JobState,
    45         UserId = source.UserId,
    4639        PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList(),
    47         LastHeartbeat = source.LastHeartbeat       
     40        LastHeartbeat = source.LastHeartbeat,
     41        State = source.State,
     42        StateLog = source.StateLogs.Select(x => Convert.ToDto(x)).OrderBy(x => x.DateTime).ToList()
    4843      };
    4944    }
     
    5752        target.JobId = source.Id;
    5853        target.CoresNeeded = source.CoresNeeded;
    59         target.DateCalculated = source.DateCalculated;
    60         target.DateCreated = source.DateCreated;
    61         target.DateFinished = source.DateFinished;
    62         target.Exception = source.Exception;
    63         target.ExecutionTime = source.ExecutionTime;
     54        target.ExecutionTime = source.ExecutionTime.ToString();
    6455        target.MemoryNeeded = source.MemoryNeeded;
    6556        target.ParentJobId = source.ParentJobId;
    6657        target.Priority = source.Priority;
    67         target.SlaveId = source.SlaveId;
    68         target.JobState = source.JobState;
    69         target.UserId = source.UserId;
    7058        target.LastHeartbeat = source.LastHeartbeat;
     59        target.State = source.State;
     60        if (target.StateLogs == null) target.StateLogs = new EntitySet<StateLog>();
     61        target.StateLogs.AddRange(source.StateLog.Select(x => Convert.ToEntity(x)).OrderBy(x => x.DateTime));
    7162        // RequiredPlugins are added by Dao
    7263      }
     
    9182    #endregion
    9283
     84    #region StateLog
     85    public static DT.StateLog ToDto(StateLog source) {
     86      if (source == null) return null;
     87      return new DT.StateLog { Id = source.StateLogId, DateTime = source.DateTime, Exception = source.Exception, JobId = source.JobId, SlaveId = source.SlaveId, State = source.State, UserId = source.UserId };
     88    }
     89    public static StateLog ToEntity(DT.StateLog source) {
     90      if (source == null) return null;
     91      var entity = new StateLog(); ToEntity(source, entity);
     92      return entity;
     93    }
     94    public static void ToEntity(DT.StateLog source, StateLog target) {
     95      if ((source != null) && (target != null)) {
     96        target.StateLogId = source.Id; target.DateTime = source.DateTime; target.Exception = source.Exception; target.JobId = source.JobId; target.SlaveId = source.SlaveId; target.State = source.State; target.UserId = source.UserId;
     97      }
     98    }
     99    #endregion
     100
    93101    #region HiveExperiment
    94102    public static DT.HiveExperiment ToDto(HiveExperiment source) {
    95103      if (source == null) return null;
    96       return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, RootJobId = source.RootJobId, UserId = source.UserId, DateCreated = source.DateCreated, ResourceNames = source.ResourceIds };
     104      return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, RootJobId = source.RootJobId, OwnerUserId = source.OwnerUserId, DateCreated = source.DateCreated, ResourceNames = source.ResourceIds, LastAccessed = source.LastAccessed };
    97105    }
    98106    public static HiveExperiment ToEntity(DT.HiveExperiment source) {
     
    103111    public static void ToEntity(DT.HiveExperiment source, HiveExperiment target) {
    104112      if ((source != null) && (target != null)) {
    105         target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.RootJobId = source.RootJobId; target.UserId = source.UserId; target.DateCreated = source.DateCreated; target.ResourceIds = source.ResourceNames;
     113        target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.RootJobId = source.RootJobId; target.OwnerUserId = source.OwnerUserId; target.DateCreated = source.DateCreated; target.ResourceIds = source.ResourceNames; target.LastAccessed = source.LastAccessed;
     114      }
     115    }
     116    #endregion
     117
     118    #region HiveExperimentPermission
     119    public static DT.HiveExperimentPermission ToDto(HiveExperimentPermission source) {
     120      if (source == null) return null;
     121      return new DT.HiveExperimentPermission { HiveExperimentId = source.HiveExperimentId, GrantedUserId = source.GrantedUserId, GrantedByUserId = source.GrantedByUserId, Permission = source.Permission };
     122    }
     123    public static HiveExperimentPermission ToEntity(DT.HiveExperimentPermission source) {
     124      if (source == null) return null;
     125      var entity = new HiveExperimentPermission(); ToEntity(source, entity);
     126      return entity;
     127    }
     128    public static void ToEntity(DT.HiveExperimentPermission source, HiveExperimentPermission target) {
     129      if ((source != null) && (target != null)) {
     130        target.HiveExperimentId = source.HiveExperimentId; target.GrantedUserId = source.GrantedUserId; target.GrantedByUserId = source.GrantedByUserId; target.Permission = source.Permission;
    106131      }
    107132    }
     
    145170    public static DT.Slave ToDto(Slave source) {
    146171      if (source == null) return null;
    147       return new DT.Slave { 
    148         Id = source.ResourceId, 
    149         ParentResourceId = source.ParentResourceId, 
     172      return new DT.Slave {
     173        Id = source.ResourceId,
     174        ParentResourceId = source.ParentResourceId,
    150175        Cores = source.Cores,
    151         CpuSpeed = source.CpuSpeed, 
    152         FreeCores = source.FreeCores, 
    153         FreeMemory = source.FreeMemory, 
    154         IsAllowedToCalculate = source.IsAllowedToCalculate, 
    155         Memory = source.Memory, 
    156         Name = source.Name, 
    157         SlaveState = source.SlaveState, 
    158         CpuArchitecture = source.CpuArchitecture, 
     176        CpuSpeed = source.CpuSpeed,
     177        FreeCores = source.FreeCores,
     178        FreeMemory = source.FreeMemory,
     179        IsAllowedToCalculate = source.IsAllowedToCalculate,
     180        Memory = source.Memory,
     181        Name = source.Name,
     182        SlaveState = source.SlaveState,
     183        CpuArchitecture = source.CpuArchitecture,
    159184        OperatingSystem = source.OperatingSystem,
    160185        LastHeartbeat = source.LastHeartbeat
     
    170195        target.ResourceId = source.Id;
    171196        target.ParentResourceId = source.ParentResourceId;
    172         target.Cores = source.Cores; 
     197        target.Cores = source.Cores;
    173198        target.CpuSpeed = source.CpuSpeed;
    174199        target.FreeCores = source.FreeCores;
    175         target.FreeMemory = source.FreeMemory; 
     200        target.FreeMemory = source.FreeMemory;
    176201        target.IsAllowedToCalculate = source.IsAllowedToCalculate;
    177202        target.Memory = source.Memory;
    178         target.Name = source.Name; 
    179         target.SlaveState = source.SlaveState; 
    180         target.CpuArchitecture = source.CpuArchitecture; 
     203        target.Name = source.Name;
     204        target.SlaveState = source.SlaveState;
     205        target.CpuArchitecture = source.CpuArchitecture;
    181206        target.OperatingSystem = source.OperatingSystem;
    182207        target.LastHeartbeat = source.LastHeartbeat;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs

    r5404 r5511  
    8585      using (var db = CreateContext()) {
    8686        var query = from ar in db.AssignedResources
     87                    join sl in db.StateLogs on ar.JobId equals sl.JobId
    8788                    where resourceIds.Contains(ar.ResourceId)
    88                        && ar.Job.JobState == JobState.WaitingForChildJobs
     89                       && ar.Job.State == JobState.FinishOnChildJobsFinished
    8990                       && (from child in db.Jobs
    9091                           where child.ParentJobId == ar.Job.JobId
    91                            select child.JobState == JobState.Finished).All(x => x)
     92                           select child.State == JobState.Finished).All(x => x)
    9293                       && (from child in db.Jobs // avoid returning WaitForChildJobs jobs where no child-jobs exist (yet)
    9394                           where child.ParentJobId == ar.Job.JobId
     
    107108        var query = from ar in db.AssignedResources
    108109                    where resourceIds.Contains(ar.ResourceId)
    109                        && ar.Job.JobState == JobState.Waiting
     110                       && ar.Job.State == JobState.Waiting
    110111                       && ar.Job.CoresNeeded <= slave.FreeCores
    111112                       && ar.Job.MemoryNeeded <= slave.FreeMemory
     
    197198      }
    198199    }
     200    #endregion
     201
     202    #region HiveExperimentPermission Methods
     203
     204    public DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId) {
     205      using (var db = CreateContext()) {
     206        return Convert.ToDto(db.HiveExperimentPermissions.SingleOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId));
     207      }
     208    }
     209
     210    public IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate) {
     211      using (var db = CreateContext()) {
     212        return db.HiveExperimentPermissions.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
     213      }
     214    }
     215
     216    public void AddHiveExperimentPermission(DT.HiveExperimentPermission dto) {
     217      using (var db = CreateContext()) {
     218        var entity = Convert.ToEntity(dto);
     219        db.HiveExperimentPermissions.InsertOnSubmit(entity);
     220        db.SubmitChanges();
     221      }
     222    }
     223
     224    public void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto) {
     225      using (var db = CreateContext()) {
     226        var entity = db.HiveExperimentPermissions.FirstOrDefault(x => x.HiveExperimentId == dto.HiveExperimentId && x.GrantedUserId == dto.GrantedUserId);
     227        if (entity == null) db.HiveExperimentPermissions.InsertOnSubmit(Convert.ToEntity(dto));
     228        else Convert.ToEntity(dto, entity);
     229        db.SubmitChanges();
     230      }
     231    }
     232
     233    public void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId) {
     234      using (var db = CreateContext()) {
     235        var entity = db.HiveExperimentPermissions.FirstOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId);
     236        if (entity != null) db.HiveExperimentPermissions.DeleteOnSubmit(entity);
     237        db.SubmitChanges();
     238      }
     239    }
     240
    199241    #endregion
    200242
     
    440482
    441483    #region Authorization Methods
    442     public bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds) {
    443       using (var db = CreateContext()) {
    444         var userIds = from job in db.Jobs // this needs to be fast!
    445                       where jobIds.Contains(job.JobId)
    446                       select job.UserId;
    447         return userIds.All(x => x == userId);
    448       }
    449     }
     484    public Permission GetPermissionForJob(Guid jobId, Guid userId) {
     485      using (var db = CreateContext()) {
     486        return GetPermissionForExperiment(GetExperimentForJob(jobId), userId);
     487      }
     488    }
     489
     490    public Permission GetPermissionForExperiment(Guid experimentId, Guid userId) {
     491      using (var db = CreateContext()) {
     492        HiveExperimentPermission permission = db.HiveExperimentPermissions.SingleOrDefault(p => p.HiveExperimentId == experimentId && p.GrantedUserId == userId);
     493        return permission != null ? permission.Permission : Permission.NotAllowed;
     494      }
     495    }
     496
     497    public Guid GetExperimentForJob(Guid jobId) {
     498      using (var db = CreateContext()) {
     499        var job = db.Jobs.SingleOrDefault(j => j.JobId == jobId);
     500        if (job.ParentJobId.HasValue) {
     501          return GetExperimentForJob(job.ParentJobId.Value);
     502        } else {
     503          return db.HiveExperiments.SingleOrDefault(he => he.RootJobId == jobId).HiveExperimentId;
     504        }
     505      }
     506    }
     507
    450508    #endregion
    451509  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml

    r5405 r5511  
    3939      <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
    4040      <Association Name="Resource_UptimeCalendar" Member="UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeCalendar" />
     41      <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
    4142      <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
    4243      <Type Name="Slave" InheritanceCode="Slave" IsInheritanceDefault="true">
     
    5253        <Column Name="OperatingSystem" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" UpdateCheck="Never" />
    5354        <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    54         <Association Name="Slave_Job" Member="Jobs" ThisKey="ResourceId" OtherKey="SlaveId" Type="Job" />
    5555      </Type>
    5656      <Type Name="SlaveGroup" InheritanceCode="GROUP" />
     
    6161      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    6262      <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    63       <Column Name="JobState" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(15)" CanBeNull="false" />
    64       <Column Name="ResourceId" Member="SlaveId" Storage="_ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    65       <Column Name="ExecutionTime" Type="System.TimeSpan" DbType="Time" CanBeNull="true" />
    66       <Column Name="Exception" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    67       <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
    68       <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    69       <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     63      <Column Name="ExecutionTime" Type="System.String" DbType="VarChar(30)" CanBeNull="true" />
    7064      <Column Name="Priority" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    71       <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    72       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    7365      <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    7466      <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    7567      <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     68      <Column Name="JobState" Member="State" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(30)" CanBeNull="false" />
    7669      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
    7770      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
    7871      <Association Name="Job_Job" Member="ChildJobs" Storage="_Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
    7972      <Association Name="Job_JobData" Member="JobData" ThisKey="JobId" OtherKey="JobId" Type="JobData" Cardinality="One" />
     73      <Association Name="Job_StateLog" Member="StateLogs" ThisKey="JobId" OtherKey="JobId" Type="StateLog" />
    8074      <Association Name="Job_Job" Member="ParentJob" Storage="_Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
    81       <Association Name="Slave_Job" Member="Slave" ThisKey="SlaveId" OtherKey="ResourceId" Type="Slave" IsForeignKey="true" DeleteRule="SET NULL" />
    8275    </Type>
    8376  </Table>
     
    10093      <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    10194      <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    102       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
     95      <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    10396      <Column Name="RootJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    10497      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
     98      <Column Name="LastAccessed" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     99      <Column Name="IsHiveEngine" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
     100      <Association Name="HiveExperiment_HiveExperimentPermission" Member="HiveExperimentPermissions" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperimentPermission" />
    105101      <Association Name="Job_HiveExperiment" Member="RootJob" Storage="_Job" ThisKey="RootJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" />
    106102    </Type>
    107103  </Table>
    108   <Table Name="" Member="JobDatas">
     104  <Table Name="dbo.JobData" Member="JobDatas">
    109105    <Type Name="JobData">
    110106      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     
    114110    </Type>
    115111  </Table>
    116   <Table Name="" Member="PluginDatas">
     112  <Table Name="dbo.PluginData" Member="PluginDatas">
    117113    <Type Name="PluginData">
    118114      <Column Name="PluginDataId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     
    123119    </Type>
    124120  </Table>
     121  <Table Name="dbo.StateLog" Member="StateLogs">
     122    <Type Name="StateLog">
     123      <Column Name="StateLogId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     124      <Column Name="State" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(30) NOT NULL" CanBeNull="false" />
     125      <Column Name="DateTime" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     126      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     127      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     128      <Column Name="SlaveId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     129      <Column Name="Exception" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
     130      <Association Name="Job_StateLog" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
     131      <Association Name="Resource_StateLog" Member="Resource" ThisKey="SlaveId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
     132    </Type>
     133  </Table>
     134  <Table Name="dbo.HiveExperimentPermission" Member="HiveExperimentPermissions">
     135    <Type Name="HiveExperimentPermission">
     136      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     137      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     138      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     139      <Column Name="Permission" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission" DbType="VarChar(15) NOT NULL" CanBeNull="false" />
     140      <Association Name="HiveExperiment_HiveExperimentPermission" Member="HiveExperiment" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperiment" IsForeignKey="true" />
     141    </Type>
     142  </Table>
    125143</Database>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout

    r5405 r5511  
    33  <DataContextMoniker Name="/HiveDataContext" />
    44  <nestedChildShapes>
    5     <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 3.75, 2, 1.3862939453124987">
     5    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 3.875, 2, 1.3862939453124987">
    66      <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
    77      <nestedChildShapes>
    8         <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.2100000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     8        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.3350000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    99      </nestedChildShapes>
    1010    </classShape>
    11     <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 5.5, 2, 1.9631982421874996">
     11    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 1.9631982421874996">
    1212      <DataClassMoniker Name="/HiveDataContext/Plugin" />
    1313      <nestedChildShapes>
    14         <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 5.9600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     14        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    1515      </nestedChildShapes>
    1616    </classShape>
     
    2727      </nestedChildShapes>
    2828    </classShape>
    29     <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.6939111328124996">
     29    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 2.3478011067708335">
    3030      <DataClassMoniker Name="/HiveDataContext/Job" />
    3131      <nestedChildShapes>
    32         <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 3.1339111328125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     32        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    3333      </nestedChildShapes>
    3434    </classShape>
     
    3939      </nestedChildShapes>
    4040    </classShape>
    41     <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666">
     41    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.5401025390624996">
    4242      <DataClassMoniker Name="/HiveDataContext/HiveExperiment" />
    4343      <nestedChildShapes>
    44         <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     44        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.9801025390625" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    4545      </nestedChildShapes>
    4646    </classShape>
     
    6969      </nodes>
    7070    </inheritanceConnector>
    71     <associationConnector edgePoints="[(11.9843735 : 2.57859537760417); (11.9843735 : 4.44314697265625); (10.875 : 4.44314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     71    <associationConnector edgePoints="[(11.9843735 : 2.57859537760417); (11.9843735 : 4.56814697265625); (10.875 : 4.56814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    7272      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
    7373      <nodes>
     
    7676      </nodes>
    7777    </associationConnector>
    78     <associationConnector edgePoints="[(8.5 : 4.22195556640625); (8.875 : 4.22195556640625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     78    <associationConnector edgePoints="[(8.5 : 3.34780110677083); (8.875 : 3.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    7979      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
    8080      <nodes>
     
    8383      </nodes>
    8484    </associationConnector>
    85     <associationConnector edgePoints="[(7.0898076923077 : 4.6939111328125); (7.0898076923077 : 5.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     85    <associationConnector edgePoints="[(7.4687475 : 3.34780110677083); (7.4687475 : 5.5)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    8686      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
    8787      <nodes>
     
    9797      </nodes>
    9898    </associationConnector>
    99     <associationConnector edgePoints="[(8.875 : 2.33735270182292); (8.5 : 2.33735270182292)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    100       <AssociationMoniker Name="/HiveDataContext/Slave/Slave_Job" />
    101       <nodes>
    102         <classShapeMoniker Id="26f4edfa-91dd-4941-a058-359f89e567a8" />
    103         <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
    104       </nodes>
    105     </associationConnector>
    10699    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.54212367513021); (13.5 : 3.54212367513021)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    107100      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" />
     
    111104      </nodes>
    112105    </associationConnector>
    113     <associationConnector edgePoints="[(6.5 : 3.65945556640625); (6.125 : 3.65945556640625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     106    <associationConnector edgePoints="[(6.5 : 2.98640055338542); (6.125 : 2.98640055338542)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    114107      <AssociationMoniker Name="/HiveDataContext/Job/Job_HiveExperiment" />
    115108      <nodes>
     
    124117      </nestedChildShapes>
    125118    </classShape>
    126     <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.625, 5.5, 2, 1.5785953776041666">
     119    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.25, 5.5, 2, 1.5785953776041666">
    127120      <DataClassMoniker Name="/HiveDataContext/PluginData" />
    128121      <nestedChildShapes>
    129         <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.64, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     122        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.265, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    130123      </nestedChildShapes>
    131124    </classShape>
    132     <associationConnector edgePoints="[(11 : 6.28929768880208); (11.625 : 6.28929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     125    <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    133126      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
    134127      <nodes>
     
    137130      </nodes>
    138131    </associationConnector>
    139     <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     132    <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    140133      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
    141134      <nodes>
     
    144137      </nodes>
    145138    </associationConnector>
    146     <associationConnector edgePoints="[(9 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     139    <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    147140      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
    148141      <nodes>
     
    158151      </nodes>
    159152    </associationConnector>
     153    <classShape Id="00352397-340e-449a-8e23-6ddd216e8617" absoluteBounds="1.75, 1, 2, 2.1554996744791666">
     154      <DataClassMoniker Name="/HiveDataContext/StateLog" />
     155      <nestedChildShapes>
     156        <elementListCompartment Id="9a003897-deef-4bb5-b180-4c4bcdb7fadc" absoluteBounds="1.765, 1.46, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     157      </nestedChildShapes>
     158    </classShape>
     159    <classShape Id="4d800dc9-1b18-469f-b02c-d4554757c5e1" absoluteBounds="1.75, 3.625, 2, 1.5785953776041666">
     160      <DataClassMoniker Name="/HiveDataContext/HiveExperimentPermission" />
     161      <nestedChildShapes>
     162        <elementListCompartment Id="dedd97d3-a9a2-45a2-9b95-d7366fb65a7f" absoluteBounds="1.765, 4.085, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     163      </nestedChildShapes>
     164    </classShape>
     165    <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     166      <AssociationMoniker Name="/HiveDataContext/Job/Job_StateLog" />
     167      <nodes>
     168        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
     169        <classShapeMoniker Id="00352397-340e-449a-8e23-6ddd216e8617" />
     170      </nodes>
     171    </associationConnector>
     172    <associationConnector edgePoints="[(11.25 : 1.78929768880208); (10.9375 : 1.78929768880208); (10.9375 : 0.6875); (2.75 : 0.6875); (2.75 : 1)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     173      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_StateLog" />
     174      <nodes>
     175        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     176        <classShapeMoniker Id="00352397-340e-449a-8e23-6ddd216e8617" />
     177      </nodes>
     178    </associationConnector>
     179    <associationConnector edgePoints="[(4.125 : 4.39505126953125); (3.75 : 4.39505126953125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     180      <AssociationMoniker Name="/HiveDataContext/HiveExperiment/HiveExperiment_HiveExperimentPermission" />
     181      <nodes>
     182        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
     183        <classShapeMoniker Id="4d800dc9-1b18-469f-b02c-d4554757c5e1" />
     184      </nodes>
     185    </associationConnector>
    160186  </nestedChildShapes>
    161187</ordesignerObjectsDiagram>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs

    r5405 r5511  
    5858    partial void UpdatePluginData(PluginData instance);
    5959    partial void DeletePluginData(PluginData instance);
     60    partial void InsertStateLog(StateLog instance);
     61    partial void UpdateStateLog(StateLog instance);
     62    partial void DeleteStateLog(StateLog instance);
     63    partial void InsertHiveExperimentPermission(HiveExperimentPermission instance);
     64    partial void UpdateHiveExperimentPermission(HiveExperimentPermission instance);
     65    partial void DeleteHiveExperimentPermission(HiveExperimentPermission instance);
    6066    #endregion
    6167   
     
    153159      {
    154160        return this.GetTable<PluginData>();
     161      }
     162    }
     163   
     164    public System.Data.Linq.Table<StateLog> StateLogs
     165    {
     166      get
     167      {
     168        return this.GetTable<StateLog>();
     169      }
     170    }
     171   
     172    public System.Data.Linq.Table<HiveExperimentPermission> HiveExperimentPermissions
     173    {
     174      get
     175      {
     176        return this.GetTable<HiveExperimentPermission>();
    155177      }
    156178    }
     
    788810    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    789811   
    790     protected System.Guid _ResourceId;
     812    private System.Guid _ResourceId;
    791813   
    792814    private string _Name;
     
    801823   
    802824    private EntitySet<UptimeCalendar> _UptimeCalendars;
     825   
     826    private EntitySet<StateLog> _StateLogs;
    803827   
    804828    private EntityRef<Resource> _ParentResource;
     
    823847      this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
    824848      this._UptimeCalendars = new EntitySet<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
     849      this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
    825850      this._ParentResource = default(EntityRef<Resource>);
    826851      OnCreated();
     
    950975    }
    951976   
     977    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_StateLog", Storage="_StateLogs", ThisKey="ResourceId", OtherKey="SlaveId")]
     978    public EntitySet<StateLog> StateLogs
     979    {
     980      get
     981      {
     982        return this._StateLogs;
     983      }
     984      set
     985      {
     986        this._StateLogs.Assign(value);
     987      }
     988    }
     989   
    952990    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ParentResource", ThisKey="ParentResourceId", OtherKey="ResourceId", IsForeignKey=true)]
    953991    public Resource ParentResource
     
    10351073   
    10361074    private void detach_UptimeCalendars(UptimeCalendar entity)
     1075    {
     1076      this.SendPropertyChanging();
     1077      entity.Resource = null;
     1078    }
     1079   
     1080    private void attach_StateLogs(StateLog entity)
     1081    {
     1082      this.SendPropertyChanging();
     1083      entity.Resource = this;
     1084    }
     1085   
     1086    private void detach_StateLogs(StateLog entity)
    10371087    {
    10381088      this.SendPropertyChanging();
     
    10651115   
    10661116    private System.Nullable<System.DateTime> _LastHeartbeat;
    1067    
    1068     private EntitySet<Job> _Jobs;
    10691117   
    10701118    #region Extensibility Method Definitions
     
    10981146    public Slave()
    10991147    {
    1100       this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
    11011148      OnCreated();
    11021149    }
     
    13201367        }
    13211368      }
    1322     }
    1323    
    1324     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Slave_Job", Storage="_Jobs", ThisKey="ResourceId", OtherKey="SlaveId")]
    1325     public EntitySet<Job> Jobs
    1326     {
    1327       get
    1328       {
    1329         return this._Jobs;
    1330       }
    1331       set
    1332       {
    1333         this._Jobs.Assign(value);
    1334       }
    1335     }
    1336    
    1337     private void attach_Jobs(Job entity)
    1338     {
    1339       this.SendPropertyChanging();
    1340       entity.Slave = this;
    1341     }
    1342    
    1343     private void detach_Jobs(Job entity)
    1344     {
    1345       this.SendPropertyChanging();
    1346       entity.Slave = null;
    13471369    }
    13481370  }
     
    13731395    private System.Nullable<System.Guid> _ParentJobId;
    13741396   
    1375     private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _JobState;
    1376    
    1377     private System.Nullable<System.Guid> _ResourceId;
    1378    
    1379     private System.Nullable<System.TimeSpan> _ExecutionTime;
    1380    
    1381     private string _Exception;
    1382    
    1383     private System.DateTime _DateCreated;
    1384    
    1385     private System.Nullable<System.DateTime> _DateCalculated;
    1386    
    1387     private System.Nullable<System.DateTime> _DateFinished;
     1397    private string _ExecutionTime;
    13881398   
    13891399    private int _Priority;
    13901400   
    1391     private System.Nullable<System.Guid> _ProjectId;
    1392    
    1393     private System.Guid _UserId;
    1394    
    13951401    private int _CoresNeeded;
    13961402   
     
    13991405    private System.Nullable<System.DateTime> _LastHeartbeat;
    14001406   
     1407    private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _State;
     1408   
    14011409    private EntitySet<AssignedResource> _AssignedResources;
    14021410   
     
    14071415    private EntityRef<JobData> _JobData;
    14081416   
     1417    private EntitySet<StateLog> _StateLogs;
     1418   
    14091419    private EntityRef<Job> _Job1;
    1410    
    1411     private EntityRef<Slave> _Slave;
    14121420   
    14131421    #region Extensibility Method Definitions
     
    14191427    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
    14201428    partial void OnParentJobIdChanged();
    1421     partial void OnJobStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
    1422     partial void OnJobStateChanged();
    1423     partial void OnSlaveIdChanging(System.Nullable<System.Guid> value);
    1424     partial void OnSlaveIdChanged();
    1425     partial void OnExecutionTimeChanging(System.Nullable<System.TimeSpan> value);
     1429    partial void OnExecutionTimeChanging(string value);
    14261430    partial void OnExecutionTimeChanged();
    1427     partial void OnExceptionChanging(string value);
    1428     partial void OnExceptionChanged();
    1429     partial void OnDateCreatedChanging(System.DateTime value);
    1430     partial void OnDateCreatedChanged();
    1431     partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
    1432     partial void OnDateCalculatedChanged();
    1433     partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
    1434     partial void OnDateFinishedChanged();
    14351431    partial void OnPriorityChanging(int value);
    14361432    partial void OnPriorityChanged();
    1437     partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
    1438     partial void OnProjectIdChanged();
    1439     partial void OnUserIdChanging(System.Guid value);
    1440     partial void OnUserIdChanged();
    14411433    partial void OnCoresNeededChanging(int value);
    14421434    partial void OnCoresNeededChanged();
     
    14451437    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
    14461438    partial void OnLastHeartbeatChanged();
     1439    partial void OnStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
     1440    partial void OnStateChanged();
    14471441    #endregion
    14481442   
     
    14531447      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
    14541448      this._JobData = default(EntityRef<JobData>);
     1449      this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
    14551450      this._Job1 = default(EntityRef<Job>);
    1456       this._Slave = default(EntityRef<Slave>);
    14571451      OnCreated();
    14581452    }
     
    15021496    }
    15031497   
    1504     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobState", DbType="VarChar(15)", CanBeNull=false)]
    1505     public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState JobState
    1506     {
    1507       get
    1508       {
    1509         return this._JobState;
    1510       }
    1511       set
    1512       {
    1513         if ((this._JobState != value))
    1514         {
    1515           this.OnJobStateChanging(value);
    1516           this.SendPropertyChanging();
    1517           this._JobState = value;
    1518           this.SendPropertyChanged("JobState");
    1519           this.OnJobStateChanged();
    1520         }
    1521       }
    1522     }
    1523    
    1524     [global::System.Data.Linq.Mapping.ColumnAttribute(Name="ResourceId", Storage="_ResourceId", DbType="UniqueIdentifier")]
    1525     public System.Nullable<System.Guid> SlaveId
    1526     {
    1527       get
    1528       {
    1529         return this._ResourceId;
    1530       }
    1531       set
    1532       {
    1533         if ((this._ResourceId != value))
    1534         {
    1535           this.OnSlaveIdChanging(value);
    1536           this.SendPropertyChanging();
    1537           this._ResourceId = value;
    1538           this.SendPropertyChanged("SlaveId");
    1539           this.OnSlaveIdChanged();
    1540         }
    1541       }
    1542     }
    1543    
    1544     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="Time")]
    1545     public System.Nullable<System.TimeSpan> ExecutionTime
     1498    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="VarChar(30)")]
     1499    public string ExecutionTime
    15461500    {
    15471501      get
     
    15621516    }
    15631517   
    1564     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="VarChar(MAX)")]
    1565     public string Exception
    1566     {
    1567       get
    1568       {
    1569         return this._Exception;
    1570       }
    1571       set
    1572       {
    1573         if ((this._Exception != value))
    1574         {
    1575           this.OnExceptionChanging(value);
    1576           this.SendPropertyChanging();
    1577           this._Exception = value;
    1578           this.SendPropertyChanged("Exception");
    1579           this.OnExceptionChanged();
    1580         }
    1581       }
    1582     }
    1583    
    1584     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
    1585     public System.DateTime DateCreated
    1586     {
    1587       get
    1588       {
    1589         return this._DateCreated;
    1590       }
    1591       set
    1592       {
    1593         if ((this._DateCreated != value))
    1594         {
    1595           this.OnDateCreatedChanging(value);
    1596           this.SendPropertyChanging();
    1597           this._DateCreated = value;
    1598           this.SendPropertyChanged("DateCreated");
    1599           this.OnDateCreatedChanged();
    1600         }
    1601       }
    1602     }
    1603    
    1604     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCalculated", DbType="DateTime")]
    1605     public System.Nullable<System.DateTime> DateCalculated
    1606     {
    1607       get
    1608       {
    1609         return this._DateCalculated;
    1610       }
    1611       set
    1612       {
    1613         if ((this._DateCalculated != value))
    1614         {
    1615           this.OnDateCalculatedChanging(value);
    1616           this.SendPropertyChanging();
    1617           this._DateCalculated = value;
    1618           this.SendPropertyChanged("DateCalculated");
    1619           this.OnDateCalculatedChanged();
    1620         }
    1621       }
    1622     }
    1623    
    1624     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateFinished", DbType="DateTime")]
    1625     public System.Nullable<System.DateTime> DateFinished
    1626     {
    1627       get
    1628       {
    1629         return this._DateFinished;
    1630       }
    1631       set
    1632       {
    1633         if ((this._DateFinished != value))
    1634         {
    1635           this.OnDateFinishedChanging(value);
    1636           this.SendPropertyChanging();
    1637           this._DateFinished = value;
    1638           this.SendPropertyChanged("DateFinished");
    1639           this.OnDateFinishedChanged();
    1640         }
    1641       }
    1642     }
    1643    
    16441518    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Priority", DbType="Int NOT NULL")]
    16451519    public int Priority
     
    16621536    }
    16631537   
    1664     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier")]
    1665     public System.Nullable<System.Guid> ProjectId
    1666     {
    1667       get
    1668       {
    1669         return this._ProjectId;
    1670       }
    1671       set
    1672       {
    1673         if ((this._ProjectId != value))
    1674         {
    1675           this.OnProjectIdChanging(value);
    1676           this.SendPropertyChanging();
    1677           this._ProjectId = value;
    1678           this.SendPropertyChanged("ProjectId");
    1679           this.OnProjectIdChanged();
    1680         }
    1681       }
    1682     }
    1683    
    1684     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
    1685     public System.Guid UserId
    1686     {
    1687       get
    1688       {
    1689         return this._UserId;
    1690       }
    1691       set
    1692       {
    1693         if ((this._UserId != value))
    1694         {
    1695           this.OnUserIdChanging(value);
    1696           this.SendPropertyChanging();
    1697           this._UserId = value;
    1698           this.SendPropertyChanged("UserId");
    1699           this.OnUserIdChanged();
    1700         }
    1701       }
    1702     }
    1703    
    17041538    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresNeeded", DbType="Int NOT NULL")]
    17051539    public int CoresNeeded
     
    17621596    }
    17631597   
     1598    [global::System.Data.Linq.Mapping.ColumnAttribute(Name="JobState", Storage="_State", DbType="VarChar(30)", CanBeNull=false)]
     1599    public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState State
     1600    {
     1601      get
     1602      {
     1603        return this._State;
     1604      }
     1605      set
     1606      {
     1607        if ((this._State != value))
     1608        {
     1609          this.OnStateChanging(value);
     1610          this.SendPropertyChanging();
     1611          this._State = value;
     1612          this.SendPropertyChanged("State");
     1613          this.OnStateChanged();
     1614        }
     1615      }
     1616    }
     1617   
    17641618    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
    17651619    public EntitySet<AssignedResource> AssignedResources
     
    18301684    }
    18311685   
     1686    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_StateLog", Storage="_StateLogs", ThisKey="JobId", OtherKey="JobId")]
     1687    public EntitySet<StateLog> StateLogs
     1688    {
     1689      get
     1690      {
     1691        return this._StateLogs;
     1692      }
     1693      set
     1694      {
     1695        this._StateLogs.Assign(value);
     1696      }
     1697    }
     1698   
    18321699    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
    18331700    public Job ParentJob
     
    18641731    }
    18651732   
    1866     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Slave_Job", Storage="_Slave", ThisKey="SlaveId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
    1867     public Slave Slave
    1868     {
    1869       get
    1870       {
    1871         return this._Slave.Entity;
    1872       }
    1873       set
    1874       {
    1875         Slave previousValue = this._Slave.Entity;
    1876         if (((previousValue != value)
    1877               || (this._Slave.HasLoadedOrAssignedValue == false)))
    1878         {
    1879           this.SendPropertyChanging();
    1880           if ((previousValue != null))
    1881           {
    1882             this._Slave.Entity = null;
    1883             previousValue.Jobs.Remove(this);
    1884           }
    1885           this._Slave.Entity = value;
    1886           if ((value != null))
    1887           {
    1888             value.Jobs.Add(this);
    1889             this._ResourceId = value.ResourceId;
    1890           }
    1891           else
    1892           {
    1893             this._ResourceId = default(Nullable<System.Guid>);
    1894           }
    1895           this.SendPropertyChanged("Slave");
    1896         }
    1897       }
    1898     }
    1899    
    19001733    public event PropertyChangingEventHandler PropertyChanging;
    19011734   
     
    19521785      this.SendPropertyChanging();
    19531786      entity.ParentJob = null;
     1787    }
     1788   
     1789    private void attach_StateLogs(StateLog entity)
     1790    {
     1791      this.SendPropertyChanging();
     1792      entity.Job = this;
     1793    }
     1794   
     1795    private void detach_StateLogs(StateLog entity)
     1796    {
     1797      this.SendPropertyChanging();
     1798      entity.Job = null;
    19541799    }
    19551800  }
     
    22222067    private System.DateTime _DateCreated;
    22232068   
     2069    private System.Nullable<System.DateTime> _LastAccessed;
     2070   
     2071    private bool _IsHiveEngine;
     2072   
     2073    private EntitySet<HiveExperimentPermission> _HiveExperimentPermissions;
     2074   
    22242075    private EntityRef<Job> _Job;
    22252076   
     
    22362087    partial void OnResourceIdsChanging(string value);
    22372088    partial void OnResourceIdsChanged();
    2238     partial void OnUserIdChanging(System.Guid value);
    2239     partial void OnUserIdChanged();
     2089    partial void OnOwnerUserIdChanging(System.Guid value);
     2090    partial void OnOwnerUserIdChanged();
    22402091    partial void OnRootJobIdChanging(System.Guid value);
    22412092    partial void OnRootJobIdChanged();
    22422093    partial void OnDateCreatedChanging(System.DateTime value);
    22432094    partial void OnDateCreatedChanged();
     2095    partial void OnLastAccessedChanging(System.Nullable<System.DateTime> value);
     2096    partial void OnLastAccessedChanged();
     2097    partial void OnIsHiveEngineChanging(bool value);
     2098    partial void OnIsHiveEngineChanged();
    22442099    #endregion
    22452100   
    22462101    public HiveExperiment()
    22472102    {
     2103      this._HiveExperimentPermissions = new EntitySet<HiveExperimentPermission>(new Action<HiveExperimentPermission>(this.attach_HiveExperimentPermissions), new Action<HiveExperimentPermission>(this.detach_HiveExperimentPermissions));
    22482104      this._Job = default(EntityRef<Job>);
    22492105      OnCreated();
     
    23312187   
    23322188    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
    2333     public System.Guid UserId
     2189    public System.Guid OwnerUserId
    23342190    {
    23352191      get
     
    23412197        if ((this._UserId != value))
    23422198        {
    2343           this.OnUserIdChanging(value);
     2199          this.OnOwnerUserIdChanging(value);
    23442200          this.SendPropertyChanging();
    23452201          this._UserId = value;
    2346           this.SendPropertyChanged("UserId");
    2347           this.OnUserIdChanged();
     2202          this.SendPropertyChanged("OwnerUserId");
     2203          this.OnOwnerUserIdChanged();
    23482204        }
    23492205      }
     
    23942250    }
    23952251   
     2252    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastAccessed", DbType="DateTime")]
     2253    public System.Nullable<System.DateTime> LastAccessed
     2254    {
     2255      get
     2256      {
     2257        return this._LastAccessed;
     2258      }
     2259      set
     2260      {
     2261        if ((this._LastAccessed != value))
     2262        {
     2263          this.OnLastAccessedChanging(value);
     2264          this.SendPropertyChanging();
     2265          this._LastAccessed = value;
     2266          this.SendPropertyChanged("LastAccessed");
     2267          this.OnLastAccessedChanged();
     2268        }
     2269      }
     2270    }
     2271   
     2272    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsHiveEngine", DbType="Bit")]
     2273    public bool IsHiveEngine
     2274    {
     2275      get
     2276      {
     2277        return this._IsHiveEngine;
     2278      }
     2279      set
     2280      {
     2281        if ((this._IsHiveEngine != value))
     2282        {
     2283          this.OnIsHiveEngineChanging(value);
     2284          this.SendPropertyChanging();
     2285          this._IsHiveEngine = value;
     2286          this.SendPropertyChanged("IsHiveEngine");
     2287          this.OnIsHiveEngineChanged();
     2288        }
     2289      }
     2290    }
     2291   
     2292    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_HiveExperimentPermission", Storage="_HiveExperimentPermissions", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId")]
     2293    public EntitySet<HiveExperimentPermission> HiveExperimentPermissions
     2294    {
     2295      get
     2296      {
     2297        return this._HiveExperimentPermissions;
     2298      }
     2299      set
     2300      {
     2301        this._HiveExperimentPermissions.Assign(value);
     2302      }
     2303    }
     2304   
    23962305    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_HiveExperiment", Storage="_Job", ThisKey="RootJobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")]
    23972306    public Job RootJob
     
    24312340      }
    24322341    }
     2342   
     2343    private void attach_HiveExperimentPermissions(HiveExperimentPermission entity)
     2344    {
     2345      this.SendPropertyChanging();
     2346      entity.HiveExperiment = this;
     2347    }
     2348   
     2349    private void detach_HiveExperimentPermissions(HiveExperimentPermission entity)
     2350    {
     2351      this.SendPropertyChanging();
     2352      entity.HiveExperiment = null;
     2353    }
    24332354  }
    24342355 
    2435   [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
     2356  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.JobData")]
    24362357  public partial class JobData : INotifyPropertyChanging, INotifyPropertyChanged
    24372358  {
     
    25842505  }
    25852506 
    2586   [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
     2507  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PluginData")]
    25872508  public partial class PluginData : INotifyPropertyChanging, INotifyPropertyChanged
    25882509  {
     
    27582679    }
    27592680  }
     2681 
     2682  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.StateLog")]
     2683  public partial class StateLog : INotifyPropertyChanging, INotifyPropertyChanged
     2684  {
     2685   
     2686    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     2687   
     2688    private System.Guid _StateLogId;
     2689   
     2690    private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _State;
     2691   
     2692    private System.DateTime _DateTime;
     2693   
     2694    private System.Guid _JobId;
     2695   
     2696    private System.Nullable<System.Guid> _UserId;
     2697   
     2698    private System.Nullable<System.Guid> _SlaveId;
     2699   
     2700    private string _Exception;
     2701   
     2702    private EntityRef<Job> _Job;
     2703   
     2704    private EntityRef<Resource> _Resource;
     2705   
     2706    #region Extensibility Method Definitions
     2707    partial void OnLoaded();
     2708    partial void OnValidate(System.Data.Linq.ChangeAction action);
     2709    partial void OnCreated();
     2710    partial void OnStateLogIdChanging(System.Guid value);
     2711    partial void OnStateLogIdChanged();
     2712    partial void OnStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
     2713    partial void OnStateChanged();
     2714    partial void OnDateTimeChanging(System.DateTime value);
     2715    partial void OnDateTimeChanged();
     2716    partial void OnJobIdChanging(System.Guid value);
     2717    partial void OnJobIdChanged();
     2718    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
     2719    partial void OnUserIdChanged();
     2720    partial void OnSlaveIdChanging(System.Nullable<System.Guid> value);
     2721    partial void OnSlaveIdChanged();
     2722    partial void OnExceptionChanging(string value);
     2723    partial void OnExceptionChanged();
     2724    #endregion
     2725   
     2726    public StateLog()
     2727    {
     2728      this._Job = default(EntityRef<Job>);
     2729      this._Resource = default(EntityRef<Resource>);
     2730      OnCreated();
     2731    }
     2732   
     2733    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StateLogId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
     2734    public System.Guid StateLogId
     2735    {
     2736      get
     2737      {
     2738        return this._StateLogId;
     2739      }
     2740      set
     2741      {
     2742        if ((this._StateLogId != value))
     2743        {
     2744          this.OnStateLogIdChanging(value);
     2745          this.SendPropertyChanging();
     2746          this._StateLogId = value;
     2747          this.SendPropertyChanged("StateLogId");
     2748          this.OnStateLogIdChanged();
     2749        }
     2750      }
     2751    }
     2752   
     2753    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="VarChar(30) NOT NULL", CanBeNull=false)]
     2754    public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState State
     2755    {
     2756      get
     2757      {
     2758        return this._State;
     2759      }
     2760      set
     2761      {
     2762        if ((this._State != value))
     2763        {
     2764          this.OnStateChanging(value);
     2765          this.SendPropertyChanging();
     2766          this._State = value;
     2767          this.SendPropertyChanged("State");
     2768          this.OnStateChanged();
     2769        }
     2770      }
     2771    }
     2772   
     2773    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateTime", DbType="DateTime NOT NULL")]
     2774    public System.DateTime DateTime
     2775    {
     2776      get
     2777      {
     2778        return this._DateTime;
     2779      }
     2780      set
     2781      {
     2782        if ((this._DateTime != value))
     2783        {
     2784          this.OnDateTimeChanging(value);
     2785          this.SendPropertyChanging();
     2786          this._DateTime = value;
     2787          this.SendPropertyChanged("DateTime");
     2788          this.OnDateTimeChanged();
     2789        }
     2790      }
     2791    }
     2792   
     2793    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
     2794    public System.Guid JobId
     2795    {
     2796      get
     2797      {
     2798        return this._JobId;
     2799      }
     2800      set
     2801      {
     2802        if ((this._JobId != value))
     2803        {
     2804          if (this._Job.HasLoadedOrAssignedValue)
     2805          {
     2806            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2807          }
     2808          this.OnJobIdChanging(value);
     2809          this.SendPropertyChanging();
     2810          this._JobId = value;
     2811          this.SendPropertyChanged("JobId");
     2812          this.OnJobIdChanged();
     2813        }
     2814      }
     2815    }
     2816   
     2817    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
     2818    public System.Nullable<System.Guid> UserId
     2819    {
     2820      get
     2821      {
     2822        return this._UserId;
     2823      }
     2824      set
     2825      {
     2826        if ((this._UserId != value))
     2827        {
     2828          this.OnUserIdChanging(value);
     2829          this.SendPropertyChanging();
     2830          this._UserId = value;
     2831          this.SendPropertyChanged("UserId");
     2832          this.OnUserIdChanged();
     2833        }
     2834      }
     2835    }
     2836   
     2837    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveId", DbType="UniqueIdentifier")]
     2838    public System.Nullable<System.Guid> SlaveId
     2839    {
     2840      get
     2841      {
     2842        return this._SlaveId;
     2843      }
     2844      set
     2845      {
     2846        if ((this._SlaveId != value))
     2847        {
     2848          if (this._Resource.HasLoadedOrAssignedValue)
     2849          {
     2850            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2851          }
     2852          this.OnSlaveIdChanging(value);
     2853          this.SendPropertyChanging();
     2854          this._SlaveId = value;
     2855          this.SendPropertyChanged("SlaveId");
     2856          this.OnSlaveIdChanged();
     2857        }
     2858      }
     2859    }
     2860   
     2861    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="VarChar(MAX)", CanBeNull=false)]
     2862    public string Exception
     2863    {
     2864      get
     2865      {
     2866        return this._Exception;
     2867      }
     2868      set
     2869      {
     2870        if ((this._Exception != value))
     2871        {
     2872          this.OnExceptionChanging(value);
     2873          this.SendPropertyChanging();
     2874          this._Exception = value;
     2875          this.SendPropertyChanged("Exception");
     2876          this.OnExceptionChanged();
     2877        }
     2878      }
     2879    }
     2880   
     2881    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_StateLog", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
     2882    public Job Job
     2883    {
     2884      get
     2885      {
     2886        return this._Job.Entity;
     2887      }
     2888      set
     2889      {
     2890        Job previousValue = this._Job.Entity;
     2891        if (((previousValue != value)
     2892              || (this._Job.HasLoadedOrAssignedValue == false)))
     2893        {
     2894          this.SendPropertyChanging();
     2895          if ((previousValue != null))
     2896          {
     2897            this._Job.Entity = null;
     2898            previousValue.StateLogs.Remove(this);
     2899          }
     2900          this._Job.Entity = value;
     2901          if ((value != null))
     2902          {
     2903            value.StateLogs.Add(this);
     2904            this._JobId = value.JobId;
     2905          }
     2906          else
     2907          {
     2908            this._JobId = default(System.Guid);
     2909          }
     2910          this.SendPropertyChanged("Job");
     2911        }
     2912      }
     2913    }
     2914   
     2915    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_StateLog", Storage="_Resource", ThisKey="SlaveId", OtherKey="ResourceId", IsForeignKey=true)]
     2916    public Resource Resource
     2917    {
     2918      get
     2919      {
     2920        return this._Resource.Entity;
     2921      }
     2922      set
     2923      {
     2924        Resource previousValue = this._Resource.Entity;
     2925        if (((previousValue != value)
     2926              || (this._Resource.HasLoadedOrAssignedValue == false)))
     2927        {
     2928          this.SendPropertyChanging();
     2929          if ((previousValue != null))
     2930          {
     2931            this._Resource.Entity = null;
     2932            previousValue.StateLogs.Remove(this);
     2933          }
     2934          this._Resource.Entity = value;
     2935          if ((value != null))
     2936          {
     2937            value.StateLogs.Add(this);
     2938            this._SlaveId = value.ResourceId;
     2939          }
     2940          else
     2941          {
     2942            this._SlaveId = default(Nullable<System.Guid>);
     2943          }
     2944          this.SendPropertyChanged("Resource");
     2945        }
     2946      }
     2947    }
     2948   
     2949    public event PropertyChangingEventHandler PropertyChanging;
     2950   
     2951    public event PropertyChangedEventHandler PropertyChanged;
     2952   
     2953    protected virtual void SendPropertyChanging()
     2954    {
     2955      if ((this.PropertyChanging != null))
     2956      {
     2957        this.PropertyChanging(this, emptyChangingEventArgs);
     2958      }
     2959    }
     2960   
     2961    protected virtual void SendPropertyChanged(String propertyName)
     2962    {
     2963      if ((this.PropertyChanged != null))
     2964      {
     2965        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     2966      }
     2967    }
     2968  }
     2969 
     2970  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HiveExperimentPermission")]
     2971  public partial class HiveExperimentPermission : INotifyPropertyChanging, INotifyPropertyChanged
     2972  {
     2973   
     2974    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     2975   
     2976    private System.Guid _HiveExperimentId;
     2977   
     2978    private System.Guid _GrantedUserId;
     2979   
     2980    private System.Guid _GrantedByUserId;
     2981   
     2982    private global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission _Permission;
     2983   
     2984    private EntityRef<HiveExperiment> _HiveExperiment;
     2985   
     2986    #region Extensibility Method Definitions
     2987    partial void OnLoaded();
     2988    partial void OnValidate(System.Data.Linq.ChangeAction action);
     2989    partial void OnCreated();
     2990    partial void OnHiveExperimentIdChanging(System.Guid value);
     2991    partial void OnHiveExperimentIdChanged();
     2992    partial void OnGrantedUserIdChanging(System.Guid value);
     2993    partial void OnGrantedUserIdChanged();
     2994    partial void OnGrantedByUserIdChanging(System.Guid value);
     2995    partial void OnGrantedByUserIdChanged();
     2996    partial void OnPermissionChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission value);
     2997    partial void OnPermissionChanged();
     2998    #endregion
     2999   
     3000    public HiveExperimentPermission()
     3001    {
     3002      this._HiveExperiment = default(EntityRef<HiveExperiment>);
     3003      OnCreated();
     3004    }
     3005   
     3006    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     3007    public System.Guid HiveExperimentId
     3008    {
     3009      get
     3010      {
     3011        return this._HiveExperimentId;
     3012      }
     3013      set
     3014      {
     3015        if ((this._HiveExperimentId != value))
     3016        {
     3017          if (this._HiveExperiment.HasLoadedOrAssignedValue)
     3018          {
     3019            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     3020          }
     3021          this.OnHiveExperimentIdChanging(value);
     3022          this.SendPropertyChanging();
     3023          this._HiveExperimentId = value;
     3024          this.SendPropertyChanged("HiveExperimentId");
     3025          this.OnHiveExperimentIdChanged();
     3026        }
     3027      }
     3028    }
     3029   
     3030    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     3031    public System.Guid GrantedUserId
     3032    {
     3033      get
     3034      {
     3035        return this._GrantedUserId;
     3036      }
     3037      set
     3038      {
     3039        if ((this._GrantedUserId != value))
     3040        {
     3041          this.OnGrantedUserIdChanging(value);
     3042          this.SendPropertyChanging();
     3043          this._GrantedUserId = value;
     3044          this.SendPropertyChanged("GrantedUserId");
     3045          this.OnGrantedUserIdChanged();
     3046        }
     3047      }
     3048    }
     3049   
     3050    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
     3051    public System.Guid GrantedByUserId
     3052    {
     3053      get
     3054      {
     3055        return this._GrantedByUserId;
     3056      }
     3057      set
     3058      {
     3059        if ((this._GrantedByUserId != value))
     3060        {
     3061          this.OnGrantedByUserIdChanging(value);
     3062          this.SendPropertyChanging();
     3063          this._GrantedByUserId = value;
     3064          this.SendPropertyChanged("GrantedByUserId");
     3065          this.OnGrantedByUserIdChanged();
     3066        }
     3067      }
     3068    }
     3069   
     3070    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Permission", DbType="VarChar(15) NOT NULL", CanBeNull=false)]
     3071    public global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission Permission
     3072    {
     3073      get
     3074      {
     3075        return this._Permission;
     3076      }
     3077      set
     3078      {
     3079        if ((this._Permission != value))
     3080        {
     3081          this.OnPermissionChanging(value);
     3082          this.SendPropertyChanging();
     3083          this._Permission = value;
     3084          this.SendPropertyChanged("Permission");
     3085          this.OnPermissionChanged();
     3086        }
     3087      }
     3088    }
     3089   
     3090    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_HiveExperimentPermission", Storage="_HiveExperiment", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId", IsForeignKey=true)]
     3091    public HiveExperiment HiveExperiment
     3092    {
     3093      get
     3094      {
     3095        return this._HiveExperiment.Entity;
     3096      }
     3097      set
     3098      {
     3099        HiveExperiment previousValue = this._HiveExperiment.Entity;
     3100        if (((previousValue != value)
     3101              || (this._HiveExperiment.HasLoadedOrAssignedValue == false)))
     3102        {
     3103          this.SendPropertyChanging();
     3104          if ((previousValue != null))
     3105          {
     3106            this._HiveExperiment.Entity = null;
     3107            previousValue.HiveExperimentPermissions.Remove(this);
     3108          }
     3109          this._HiveExperiment.Entity = value;
     3110          if ((value != null))
     3111          {
     3112            value.HiveExperimentPermissions.Add(this);
     3113            this._HiveExperimentId = value.HiveExperimentId;
     3114          }
     3115          else
     3116          {
     3117            this._HiveExperimentId = default(System.Guid);
     3118          }
     3119          this.SendPropertyChanged("HiveExperiment");
     3120        }
     3121      }
     3122    }
     3123   
     3124    public event PropertyChangingEventHandler PropertyChanging;
     3125   
     3126    public event PropertyChangedEventHandler PropertyChanged;
     3127   
     3128    protected virtual void SendPropertyChanging()
     3129    {
     3130      if ((this.PropertyChanging != null))
     3131      {
     3132        this.PropertyChanging(this, emptyChangingEventArgs);
     3133      }
     3134    }
     3135   
     3136    protected virtual void SendPropertyChanged(String propertyName)
     3137    {
     3138      if ((this.PropertyChanged != null))
     3139      {
     3140        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     3141      }
     3142    }
     3143  }
    27603144}
    27613145#pragma warning restore 1591
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs

    r5404 r5511  
    11using System;
    22using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    53using System.Linq.Expressions;
    64
    75namespace HeuristicLab.Services.Hive.DataAccess {
     6  using HeuristicLab.Services.Hive.Common.DataTransfer;
    87  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    98
     
    3231    void UpdateHiveExperiment(DT.HiveExperiment dto);
    3332    void DeleteHiveExperiment(Guid id);
     33    #endregion
     34
     35    #region HiveExperimentPermission Methods
     36    DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
     37    IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate);
     38    void AddHiveExperimentPermission(DT.HiveExperimentPermission dto);
     39    void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto);
     40    void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
    3441    #endregion
    3542
     
    8087
    8188    #region Authorization Methods
    82     bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds);
     89    Permission GetPermissionForJob(Guid jobId, Guid userId);
     90    Permission GetPermissionForExperiment(Guid experimentId, Guid userId);
     91    Guid GetExperimentForJob(Guid jobId);
    8392    #endregion
    8493  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/CreateHiveDatabaseApplication.cs

    r5106 r5511  
    2828  class CreateHiveDatabaseApplication : ApplicationBase {
    2929
    30     public override void Run() {
     30    public override void Run() { 
    3131      using (var db = HiveDao.CreateContext()) {
    3232        if (db.DatabaseExists())
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql

    r5404 r5511  
    4040ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
    4141ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (newid()) FOR JobId;
     42GO
    4243
    43 --ALTER TABLE [dbo].[Job]  DROP  CONSTRAINT [Slave_Job]
    44 --ALTER TABLE [dbo].[Job]  WITH CHECK ADD  CONSTRAINT [Slave_Job] FOREIGN KEY([ResourceId])
    45 --REFERENCES [dbo].[Resource] ([ResourceId])
    46 --ON UPDATE CASCADE
    47 --ON DELETE SET NULL
    48 --GO
     44ALTER TABLE [dbo].[StateLog]  DROP  CONSTRAINT [Job_StateLog]
     45ALTER TABLE [dbo].[StateLog]  WITH CHECK ADD CONSTRAINT [Job_StateLog] FOREIGN KEY([JobId])
     46REFERENCES [dbo].[Job] ([JobId])
     47ON UPDATE CASCADE
     48ON DELETE CASCADE
     49GO
    4950
    5051ALTER TABLE dbo.Plugin ALTER COLUMN PluginId ADD ROWGUIDCOL;
     
    7980ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId ADD ROWGUIDCOL;
    8081ALTER TABLE dbo.HiveExperiment WITH NOCHECK ADD CONSTRAINT [DF_HiveExperiment_HiveExperimentId] DEFAULT (newid()) FOR HiveExperimentId;
     82
     83ALTER TABLE dbo.StateLog ALTER COLUMN StateLogId ADD ROWGUIDCOL;
     84ALTER TABLE dbo.StateLog WITH NOCHECK ADD CONSTRAINT [DF_StateLog_StateLogId] DEFAULT (newid()) FOR StateLogId;
     85
     86ALTER TABLE [dbo].[HiveExperimentPermission]  DROP  CONSTRAINT [HiveExperiment_HiveExperimentPermission]
     87ALTER TABLE [dbo].[HiveExperimentPermission]  WITH CHECK ADD CONSTRAINT [HiveExperiment_HiveExperimentPermission] FOREIGN KEY([HiveExperimentId])
     88REFERENCES [dbo].[HiveExperiment] ([HiveExperimentId])
     89ON UPDATE CASCADE
     90ON DELETE CASCADE
     91GO
    8192
    8293/* create indices */
Note: See TracChangeset for help on using the changeset viewer.