Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/11/13 10:15:52 (12 years ago)
Author:
fschoepp
Message:

#1888:

  • Janitor is now working as expected in Windows Azure
  • Added basic support for experiments (draggable experiments)
  • Added methods to save/read experiments from TableStorage
  • The job status can now be retrieved by using the GetTasks/GetTaskData methods
  • Added a class to convert JSON-objects to Algorithm instances
  • Web page: Added experiment button to navigation
Location:
branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/DAL.cs

    r9166 r9215  
    33using System.Linq;
    44using System.Text;
     5using HeuristicLab.Services.Optimization.ControllerService.Model;
    56
    67namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces {
     
    1718  }
    1819
     20  public interface IExperimentDao {
     21    bool Add(string username, Experiment experiment);
     22    bool DeleteByName(string username, string experiment);
     23    Experiment FindByName(string username, string experiment);
     24    IEnumerable<Experiment> GetExperiments(string user);
     25  }
     26
    1927  public interface IBlobDao {
    2028    bool Add(StringEntry entry);
     
    2432
    2533  public interface IDataAccessLayer {
    26     IScenarioDao CreateScenarioDao();
    27     IBlobDao CreateBlobDao();
     34    IScenarioDao ScenarioDao { get; }
     35    IBlobDao BlobDao { get; }
     36    IExperimentDao ExperimentDao { get; }   
    2837  }
    2938
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/IControllerService.cs

    r9166 r9215  
    2020
    2121    [OperationContract]
    22     void ScheduleOptimizationScenario(User user, OptimizationScenario scenario, JobExecutionDetails details);
     22    bool ScheduleOptimizationScenario(User user, OptimizationScenario scenario, JobExecutionDetails details);
    2323
    2424    [OperationContract]
     
    2929
    3030    [OperationContract]
    31     void DeleteJob(User user, string id);
     31    bool DeleteJob(User user, string id);
    3232
    3333    [OperationContract]
     
    3939    [OperationContract]
    4040    bool DeleteHiveScenario(User user, string scenarioName);
     41
     42    [OperationContract]
     43    bool SaveExperiment(User user, Experiment experiment);
     44
     45    [OperationContract]
     46    IEnumerable<string> GetExperiments(User user);
     47
     48    [OperationContract]
     49    bool DeleteExperiment(User user, string experiment);
     50
     51    [OperationContract]
     52    Job GetTasks(User u, string jobId);
     53
     54    [OperationContract]
     55    Task GetTaskData(User u, string jobId, string taskId);
    4156  }
    4257}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/IScenarioManager.cs

    r9166 r9215  
    77namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces {
    88  public interface IScenarioManager {
    9     void DispatchScenario(User user, OptimizationScenario scenario, JobExecutionDetails details);
     9    string DispatchScenario(User user, OptimizationScenario scenario, JobExecutionDetails details);
    1010    IList<Job> GetJobs(User user);
    1111    Job GetJob(User user, string id);
    12     void DeleteJob(User user, string id);
     12    bool DeleteJob(User user, string id);
    1313    IList<Model.Run> GetJobResults(User user, string id);
    1414    bool AddScenario(User user, string scenarioName, string scenarioXml, string scenarioMapper);
    1515    bool DeleteScenario(User user, string scenarioName);
     16
     17    bool SaveExperiment(User user, Experiment experiment);
     18    IEnumerable<string> GetExperiments(User user);
     19    bool DeleteExperiment(User user, string experiment);
     20
     21    Task GetTaskData(User u, string jobId, string taskId);
     22    Job GetTasks(User u, string jobId);
    1623  }
    1724}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/Model/ControllerModel.cs

    r9166 r9215  
    306306  public class Experiment {
    307307    [DataMember]
     308    public string Name { get; set; }
     309
     310    [DataMember]
    308311    public IList<OptimizationScenario> Scenarios { get; set; }
    309312
     
    340343
    341344  [DataContract]
     345  public class Property {
     346    [DataMember]
     347    public string Key { get; set; }
     348    [DataMember]
     349    public string Value { get; set; }
     350  }
     351 
     352  [DataContract]
     353  public class General {
     354    [DataMember]
     355    public string Name { get { return GetValue("Name"); } set { SetValue("Name", value); } }
     356    [DataMember]
     357    public string Id { get { return GetValue("Id"); } set { SetValue("Id", value); } }
     358    [DataMember]
     359    public string Priority { get { return GetValue("Priority"); } set { SetValue("Priority", value); } }
     360    [DataMember]
     361    public string LastChanged { get { return GetValue("LastChanged"); } set { SetValue("LastChanged", value); } }
     362
     363   
     364    private IList<Property> properties = new List<Property>();
     365    [DataMember]
     366    public IList<Property> Properties
     367    {
     368      get {
     369        if (properties == null)
     370          properties = new List<Property>();
     371        return properties;
     372      }
     373      set { properties = value;}
     374    }
     375
     376    private string GetValue(string key) {     
     377      return (from p in Properties where p.Key == key select p.Value).FirstOrDefault();
     378    }
     379
     380    private void SetValue(string key, string value) {
     381      var prop = (from p in Properties where p.Key == key select p).FirstOrDefault();
     382      if (prop == null) {
     383        prop = new Property();
     384        Properties.Add(prop);
     385      }
     386      prop.Key = key;
     387      prop.Value = value;
     388    }
     389  }
     390
     391  [DataContract]
     392  public class TaskState {
     393    [DataMember]
     394    public string State { get; set; }
     395    [DataMember]
     396    public string ExecutionTime { get; set; }
     397    [DataMember]
     398    public string DateCreated { get; set; }
     399    [DataMember]
     400    public string DateFinished { get; set; }
     401  }
     402
     403  [DataContract]
     404  public class Task {
     405    private General general = new General();
     406    [DataMember]
     407    public General General {
     408      get { return general; }
     409      set { general = value; }
     410    }
     411
     412    private IList<Task> tasks = new List<Task>();
     413    [DataMember]
     414    public IList<Task> Children {
     415      get { return tasks; }
     416      set { tasks = value; }
     417    }
     418   
     419    private TaskState state = new TaskState();
     420
     421    [DataMember]
     422    public TaskState State {
     423      get { return state; }
     424      set { state = value; }
     425    }
     426  }
     427
     428  [DataContract]
    342429  public class Job {
    343430    [DataMember]
     
    355442    [DataMember]
    356443    public DateTime DateCreated { get; set; }
     444
     445    private IList<Task> tasks = new List<Task>();
     446
     447    [DataMember]
     448    public IList<Task> Tasks {
     449      get { return tasks; }
     450      set { tasks = value; }
     451    }
     452
    357453  }
    358454
Note: See TracChangeset for help on using the changeset viewer.