using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace HeuristicLab.Services.Hive.DataAccess {
using HeuristicLab.Services.Hive.Common.DataTransfer;
using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
public interface IHiveDao {
#region Job Methods
DT.Job GetJob(Guid id);
IEnumerable
GetJobs(Expression> predicate);
Guid AddJob(DT.Job dto);
void UpdateJob(DT.Job dto);
void DeleteJob(Guid id);
IEnumerable GetWaitingJobs(DT.Slave slave, int count);
IEnumerable GetParentJobs(IEnumerable resourceIds, int count, bool finished);
DT.Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception);
#endregion
#region JobData Methods
DT.JobData GetJobData(Guid id);
IEnumerable GetJobDatas(Expression> predicate);
Guid AddJobData(DT.JobData dto);
void UpdateJobData(DT.JobData dto);
void DeleteJobData(Guid id);
#endregion
#region StateLog Methods
DT.StateLog GetStateLog(Guid id);
IEnumerable GetStateLogs(Expression> predicate);
Guid AddStateLog(DT.StateLog dto);
void UpdateStateLog(DT.StateLog dto);
void DeleteStateLog(Guid id);
#endregion
#region HiveExperiment Methods
DT.HiveExperiment GetHiveExperiment(Guid id);
IEnumerable GetHiveExperiments(Expression> predicate);
Guid AddHiveExperiment(DT.HiveExperiment dto);
void UpdateHiveExperiment(DT.HiveExperiment dto);
void DeleteHiveExperiment(Guid id);
#endregion
#region HiveExperimentPermission Methods
DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
IEnumerable GetHiveExperimentPermissions(Expression> predicate);
void AddHiveExperimentPermission(DT.HiveExperimentPermission dto);
void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto);
void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
#endregion
#region Plugin Methods
DT.Plugin GetPlugin(Guid id);
IEnumerable GetPlugins(Expression> predicate);
Guid AddPlugin(DT.Plugin dto);
void UpdatePlugin(DT.Plugin dto);
void DeletePlugin(Guid id);
#endregion
#region PluginData Methods
DT.PluginData GetPluginData(Guid id);
IEnumerable GetPluginDatas(Expression> predicate);
Guid AddPluginData(DT.PluginData dto);
void UpdatePluginData(DT.PluginData dto);
void DeletePluginData(Guid id);
#endregion
#region Calendar Methods
#endregion
#region Slave Methods
DT.Slave GetSlave(Guid id);
IEnumerable GetSlaves(Expression> predicate);
Guid AddSlave(DT.Slave dto);
void UpdateSlave(DT.Slave dto);
void DeleteSlave(Guid id);
#endregion
#region SlaveGroup Methods
DT.SlaveGroup GetSlaveGroup(Guid id);
IEnumerable GetSlaveGroups(Expression> predicate);
Guid AddSlaveGroup(DT.SlaveGroup dto);
void UpdateSlaveGroup(DT.SlaveGroup dto);
void DeleteSlaveGroup(Guid id);
#endregion
#region Resource Methods
DT.Resource GetResource(Guid id);
IEnumerable GetResources(Expression> predicate);
Guid AddResource(DT.Resource dto);
void UpdateResource(DT.Resource dto);
void DeleteResource(Guid id);
void AssignJobToResource(Guid jobId, Guid resourceId);
IEnumerable GetAssignedResources(Guid jobId);
#endregion
#region Authorization Methods
Permission GetPermissionForJob(Guid jobId, Guid userId);
Permission GetPermissionForExperiment(Guid experimentId, Guid userId);
Guid GetExperimentForJob(Guid jobId);
#endregion
#region Lifecycle Methods
DateTime GetLastCleanup();
void SetLastCleanup(DateTime datetime);
#endregion
#region Appointment Methods
DT.Appointment GetAppointment(Guid id);
IEnumerable GetAppointments(Expression> predicate);
Guid AddAppointment(DT.Appointment dto);
void UpdateAppointment(DT.Appointment dto);
void DeleteAppointment(Guid id);
#endregion
}
}