Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs @ 12846

Last change on this file since 12846 was 12009, checked in by ascheibe, 10 years ago

#2212 updated copyright year

File size: 5.9 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Linq.Expressions;
25using HeuristicLab.Services.Hive.Common.DataTransfer;
26using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
27
28namespace HeuristicLab.Services.Hive.DataAccess {
29  public interface IHiveDao {
30    #region Job Methods
31    DT.Job GetJob(Guid id);
32    IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate);
33    Guid AddJob(DT.Job dto);
34    void UpdateJob(DT.Job dto);
35    void DeleteJob(Guid id);
36    IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave, int count);
37    IEnumerable<DT.Job> GetParentJobs(IEnumerable<Guid> resourceIds, int count, bool finished);
38    DT.Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception);
39    #endregion
40
41    #region JobData Methods
42    DT.JobData GetJobData(Guid id);
43    IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate);
44    Guid AddJobData(DT.JobData dto);
45    void UpdateJobData(DT.JobData dto);
46    void DeleteJobData(Guid id);
47    #endregion
48
49    #region StateLog Methods
50    DT.StateLog GetStateLog(Guid id);
51    IEnumerable<DT.StateLog> GetStateLogs(Expression<Func<StateLog, bool>> predicate);
52    Guid AddStateLog(DT.StateLog dto);
53    void UpdateStateLog(DT.StateLog dto);
54    void DeleteStateLog(Guid id);
55    #endregion
56
57    #region HiveExperiment Methods
58    DT.HiveExperiment GetHiveExperiment(Guid id);
59    IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate);
60    Guid AddHiveExperiment(DT.HiveExperiment dto);
61    void UpdateHiveExperiment(DT.HiveExperiment dto);
62    void DeleteHiveExperiment(Guid id);
63    #endregion
64
65    #region HiveExperimentPermission Methods
66    DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
67    IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate);
68    void AddHiveExperimentPermission(DT.HiveExperimentPermission dto);
69    void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto);
70    void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
71    void SetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedByUserId, Guid grantedUserId, Permission permission);
72    #endregion
73
74    #region Plugin Methods
75    DT.Plugin GetPlugin(Guid id);
76    IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate);
77    Guid AddPlugin(DT.Plugin dto);
78    void UpdatePlugin(DT.Plugin dto);
79    void DeletePlugin(Guid id);
80    #endregion
81
82    #region PluginData Methods
83    DT.PluginData GetPluginData(Guid id);
84    IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate);
85    Guid AddPluginData(DT.PluginData dto);
86    void UpdatePluginData(DT.PluginData dto);
87    void DeletePluginData(Guid id);
88    #endregion
89
90    #region Calendar Methods
91    #endregion
92
93    #region Slave Methods
94    DT.Slave GetSlave(Guid id);
95    IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate);
96    Guid AddSlave(DT.Slave dto);
97    void UpdateSlave(DT.Slave dto);
98    void DeleteSlave(Guid id);
99    #endregion
100
101    #region SlaveGroup Methods
102    DT.SlaveGroup GetSlaveGroup(Guid id);
103    IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate);
104    Guid AddSlaveGroup(DT.SlaveGroup dto);
105    void UpdateSlaveGroup(DT.SlaveGroup dto);
106    void DeleteSlaveGroup(Guid id);
107    #endregion
108
109    #region Resource Methods
110    DT.Resource GetResource(Guid id);
111    IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate);
112    Guid AddResource(DT.Resource dto);
113    void UpdateResource(DT.Resource dto);
114    void DeleteResource(Guid id);
115    void AssignJobToResource(Guid jobId, Guid resourceId);
116    IEnumerable<DT.Resource> GetAssignedResources(Guid jobId);
117    IEnumerable<DT.Resource> GetParentResources(Guid resourceId);
118    IEnumerable<DT.Resource> GetChildResources(Guid resourceId);
119    IEnumerable<DT.Job> GetJobsByResourceId(Guid resourceId);
120    #endregion
121
122    #region Authorization Methods
123    Permission GetPermissionForJob(Guid jobId, Guid userId);
124    Permission GetPermissionForExperiment(Guid experimentId, Guid userId);
125    Guid GetExperimentForJob(Guid jobId);
126    #endregion
127
128    #region Lifecycle Methods
129    DateTime GetLastCleanup();
130    void SetLastCleanup(DateTime datetime);
131    #endregion
132
133    #region Downtime Methods
134    DT.Downtime GetDowntime(Guid id);
135    IEnumerable<DT.Downtime> GetDowntimes(Expression<Func<Downtime, bool>> predicate);
136    Guid AddDowntime(DT.Downtime dto);
137    void UpdateDowntime(DT.Downtime dto);
138    void DeleteDowntime(Guid id);
139    #endregion
140
141    #region Statistics Methods
142    DT.Statistics GetStatistic(Guid id);
143    IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate);
144    Guid AddStatistics(DT.Statistics dto);
145    void DeleteStatistics(Guid id);
146    List<DT.UserStatistics> GetUserStatistics();
147    #endregion
148  }
149}
Note: See TracBrowser for help on using the repository browser.