Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2005 for trunk/sources


Ignore:
Timestamp:
06/04/09 17:13:05 (15 years ago)
Author:
svonolfe
Message:

Updated jobManager (#431)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs

    r1948 r2005  
    8383
    8484    public static string RESPONSE_JOB_ALL_JOBS = "Job.AllJobs";
     85    public static string RESPONSE_JOB_GET_JOB_BY_ID = "Job.GetJobById";
    8586    public static string RESPONSE_JOB_ID_MUST_NOT_BE_SET = "Job.IdMustNotBeSet";
    8687    public static string RESPONSE_JOB_JOB_ADDED = "Job.JobAdded";
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/Interfaces/IJobManager.cs

    r1932 r2005  
    3636    ResponseList<Job> GetAllJobs();
    3737    [OperationContract]
     38    ResponseObject<Job> GetJobById(Guid jobId);
     39    [OperationContract]
    3840    ResponseObject<Job> AddNewJob(Job job);
    3941    [OperationContract]
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs

    r1948 r2005  
    151151
    152152    /// <summary>
     153    /// returns the job with the specified id
     154    /// </summary>
     155    /// <returns></returns>
     156    public ResponseObject<Job> GetJobById(Guid jobId) {
     157      ISession session = factory.GetSessionForCurrentThread();
     158
     159      try {
     160        IJobAdapter jobAdapter =
     161            session.GetDataAdapter<Job, IJobAdapter>();
     162
     163        ResponseObject<Job> response = new ResponseObject<Job>();
     164
     165        response.Obj = jobAdapter.GetById(jobId);
     166        if (response.Obj != null) {
     167          response.Success = true;
     168          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_GET_JOB_BY_ID;
     169        } else {
     170          response.Success = false;
     171          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
     172        }
     173
     174        return response;
     175      }
     176      finally {
     177        if (session != null)
     178          session.EndSession();
     179      }
     180    }
     181
     182    /// <summary>
    153183    /// Adds a new job into the database
    154184    /// </summary>
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs

    r1932 r2005  
    113113    }
    114114
     115    public ResponseObject<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetJobById(Guid jobId) {
     116      return jobManager.GetJobById(jobId);
     117    }
     118
    115119    public ResponseObject<Job> AddNewJob(Job job) {
    116120      if (HasPermission(PermissiveSecurityAction.Add_Job))
Note: See TracChangeset for help on using the changeset viewer.