[8958] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
[9215] | 5 | using HeuristicLab.Services.Optimization.ControllerService.Model;
|
---|
[8958] | 6 |
|
---|
| 7 | namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces {
|
---|
| 8 | public class StringEntry {
|
---|
| 9 | public string Key { get; set; }
|
---|
| 10 | public string Text { get; set; }
|
---|
| 11 | };
|
---|
| 12 |
|
---|
| 13 | public interface IScenarioDao {
|
---|
| 14 | bool Add(ScenarioEntity entity);
|
---|
| 15 | bool DeleteByName(string scenarioName);
|
---|
| 16 | ScenarioEntity FindByName(string scenarioName);
|
---|
| 17 | IEnumerable<ScenarioEntity> GetAllEntities();
|
---|
| 18 | }
|
---|
| 19 |
|
---|
[9215] | 20 | public interface IExperimentDao {
|
---|
| 21 | bool Add(string username, Experiment experiment);
|
---|
[9305] | 22 | bool Update(string username, Experiment experiment);
|
---|
[9215] | 23 | bool DeleteByName(string username, string experiment);
|
---|
[9324] | 24 | bool Delete(string username, string experimentId);
|
---|
[9215] | 25 | Experiment FindByName(string username, string experiment);
|
---|
[9324] | 26 | IEnumerable<Experiment> GetExperiments(string user, bool namesOnly = false);
|
---|
[9227] | 27 | Experiment GetExperimentByName(string username, string scenario);
|
---|
[9305] | 28 |
|
---|
| 29 | Experiment GetExperimentById(User user, string nodeId);
|
---|
[9215] | 30 | }
|
---|
| 31 |
|
---|
[9395] | 32 | public interface IJobDao {
|
---|
| 33 | bool Add(string username, Experiment experiment, string jobId);
|
---|
| 34 | bool Delete(string username, string jobId);
|
---|
| 35 | Experiment FindByJobId(string username, string jobId);
|
---|
| 36 | }
|
---|
| 37 |
|
---|
[8958] | 38 | public interface IBlobDao {
|
---|
| 39 | bool Add(StringEntry entry);
|
---|
| 40 | bool DeleteByKey(string entryKey);
|
---|
| 41 | StringEntry FindByKey(string entryKey);
|
---|
| 42 | }
|
---|
| 43 |
|
---|
[9362] | 44 |
|
---|
| 45 | public interface IVisualExtensionDao {
|
---|
| 46 | bool Add(string algorithmId, string script);
|
---|
| 47 | bool DeleteById(string algorithmId);
|
---|
| 48 | string FindById(string algorithmId);
|
---|
[9395] | 49 | bool Exists(string algorithmId);
|
---|
[9362] | 50 | }
|
---|
| 51 |
|
---|
[8958] | 52 | public interface IDataAccessLayer {
|
---|
[9215] | 53 | IScenarioDao ScenarioDao { get; }
|
---|
| 54 | IBlobDao BlobDao { get; }
|
---|
[9350] | 55 | IExperimentDao ExperimentDao { get; }
|
---|
[9362] | 56 | IVisualExtensionDao VisualExtensionDao { get; }
|
---|
[9395] | 57 | IJobDao JobDao { get; }
|
---|
[8958] | 58 | }
|
---|
[9166] | 59 |
|
---|
[9362] | 60 |
|
---|
[9166] | 61 | public static class DataAccessLayerProvider {
|
---|
| 62 | private static IDataAccessLayer layer = new Azure.AzureDataAccessLayer();
|
---|
| 63 | //private static IDataAccessLayer layer = new Mockup.MockupDataAccessLayer();
|
---|
| 64 |
|
---|
| 65 | public static IDataAccessLayer GetLayer() {
|
---|
| 66 | return layer;
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
[8958] | 69 | }
|
---|
| 70 |
|
---|