using System; using System.Collections.Generic; using System.Linq; using System.Text; using HeuristicLab.Services.Optimization.ControllerService.Model; namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces { public class StringEntry { public string Key { get; set; } public string Text { get; set; } }; public interface IScenarioDao { bool Add(ScenarioEntity entity); bool DeleteByName(string scenarioName); ScenarioEntity FindByName(string scenarioName); IEnumerable GetAllEntities(); } public interface IExperimentDao { bool Add(string username, Experiment experiment); bool Update(string username, Experiment experiment); bool DeleteByName(string username, string experiment); bool Delete(string username, string experimentId); Experiment FindByName(string username, string experiment); IEnumerable GetExperiments(string user, bool namesOnly = false); Experiment GetExperimentByName(string username, string scenario); Experiment GetExperimentById(User user, string nodeId); } public interface IJobDao { bool Add(string username, Experiment experiment, string jobId); bool Delete(string username, string jobId); Experiment FindByJobId(string username, string jobId); } public interface IBlobDao { bool Add(StringEntry entry); bool DeleteByKey(string entryKey); StringEntry FindByKey(string entryKey); } public interface IVisualExtensionDao { bool Add(string algorithmId, string script); bool DeleteById(string algorithmId); string FindById(string algorithmId); bool Exists(string algorithmId); } public interface IDataAccessLayer { IScenarioDao ScenarioDao { get; } IBlobDao BlobDao { get; } IExperimentDao ExperimentDao { get; } IVisualExtensionDao VisualExtensionDao { get; } IJobDao JobDao { get; } } public static class DataAccessLayerProvider { private static IDataAccessLayer layer = new Azure.AzureDataAccessLayer(); //private static IDataAccessLayer layer = new Mockup.MockupDataAccessLayer(); public static IDataAccessLayer GetLayer() { return layer; } } }