- Timestamp:
- 02/11/13 10:15:52 (12 years ago)
- 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 3 3 using System.Linq; 4 4 using System.Text; 5 using HeuristicLab.Services.Optimization.ControllerService.Model; 5 6 6 7 namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces { … … 17 18 } 18 19 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 19 27 public interface IBlobDao { 20 28 bool Add(StringEntry entry); … … 24 32 25 33 public interface IDataAccessLayer { 26 IScenarioDao CreateScenarioDao(); 27 IBlobDao CreateBlobDao(); 34 IScenarioDao ScenarioDao { get; } 35 IBlobDao BlobDao { get; } 36 IExperimentDao ExperimentDao { get; } 28 37 } 29 38 -
branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/IControllerService.cs
r9166 r9215 20 20 21 21 [OperationContract] 22 voidScheduleOptimizationScenario(User user, OptimizationScenario scenario, JobExecutionDetails details);22 bool ScheduleOptimizationScenario(User user, OptimizationScenario scenario, JobExecutionDetails details); 23 23 24 24 [OperationContract] … … 29 29 30 30 [OperationContract] 31 voidDeleteJob(User user, string id);31 bool DeleteJob(User user, string id); 32 32 33 33 [OperationContract] … … 39 39 [OperationContract] 40 40 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); 41 56 } 42 57 } -
branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/IScenarioManager.cs
r9166 r9215 7 7 namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces { 8 8 public interface IScenarioManager { 9 voidDispatchScenario(User user, OptimizationScenario scenario, JobExecutionDetails details);9 string DispatchScenario(User user, OptimizationScenario scenario, JobExecutionDetails details); 10 10 IList<Job> GetJobs(User user); 11 11 Job GetJob(User user, string id); 12 voidDeleteJob(User user, string id);12 bool DeleteJob(User user, string id); 13 13 IList<Model.Run> GetJobResults(User user, string id); 14 14 bool AddScenario(User user, string scenarioName, string scenarioXml, string scenarioMapper); 15 15 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); 16 23 } 17 24 } -
branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/Model/ControllerModel.cs
r9166 r9215 306 306 public class Experiment { 307 307 [DataMember] 308 public string Name { get; set; } 309 310 [DataMember] 308 311 public IList<OptimizationScenario> Scenarios { get; set; } 309 312 … … 340 343 341 344 [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] 342 429 public class Job { 343 430 [DataMember] … … 355 442 [DataMember] 356 443 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 357 453 } 358 454
Note: See TracChangeset
for help on using the changeset viewer.