Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/10 12:41:05 (14 years ago)
Author:
cneumuel
Message:

consolidated Response objects to use only StatusMessage with enums instead of strings.
removed Success property from Response. success is now represented by StatusMessage alone. (#1159)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ExecutionEngineFacade.cs

    r4170 r4263  
    2828using HeuristicLab.Hive.Contracts.BusinessObjects;
    2929using HeuristicLab.Hive.Server.DataAccess;
     30using HeuristicLab.Hive.Contracts.ResponseObjects;
    3031
    3132namespace HeuristicLab.Hive.Server.Core {
     
    6061    public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
    6162      using (contextFactory.GetContext(false)) {
    62         return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
     63        return jobManager.GetLastSerializedResult(jobId, requested, snapshot);
    6364      }
    6465    }
     
    7778
    7879
    79     public ResponseObject<JobResultList> GetAllJobResults(IEnumerable<Guid> jobIds) {
     80    public ResponseObject<JobResultList> GetJobResults(IEnumerable<Guid> jobIds) {
    8081      using (contextFactory.GetContext(false)) {
    81         return jobManager.GetAllJobResults(jobIds);
     82        return jobManager.GetJobResults(jobIds);
    8283      }
    8384    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs

    r4253 r4263  
    3131using System.ServiceModel;
    3232using HeuristicLab.Hive.Server.DataAccess;
     33using HeuristicLab.Hive.Contracts.ResponseObjects;
    3334
    3435
     
    5354      sessionID = secMan.Login(username, password);
    5455      if (sessionID == Guid.Empty) {
    55         resp.Success = false;
    56         resp.StatusMessage = ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_FAILED;
    57       } else {
    58         resp.Success = true;
    59         resp.StatusMessage =
    60           ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
     56        resp.StatusMessage = ResponseStatus.Login_LoginFaild;
    6157      }
    6258      return resp;
     
    6460
    6561
    66     public ResponseList<ClientDto> GetAllClients() {
     62    public ResponseList<ClientDto> GetAllSlaves() {
    6763      using (contextFactory.GetContext(false)) {
    6864        secMan.Authorize("AccessClients", sessionID, Guid.Empty);
    69         return slaveManager.GetAllClients();
     65        return slaveManager.GetAllSlaves();
    7066      }
    7167    }
     
    140136    }
    141137
    142     public ResponseObject<JobDto> GetLastJobResultOf(Guid jobId) {
     138    //public ResponseObject<JobDto> GetLastJobResultOf(Guid jobId) {
     139    //  using (contextFactory.GetContext(false)) {
     140    //    secMan.Authorize("AccessJobResults", sessionID, jobId);
     141    //    return jobManager.GetLastJobResultOf(jobId);
     142    //  }
     143    //}
     144
     145    public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
    143146      using (contextFactory.GetContext(false)) {
    144147        secMan.Authorize("AccessJobResults", sessionID, jobId);
    145         return jobManager.GetLastJobResultOf(jobId);
    146       }
    147     }
    148 
    149     public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) {
    150       using (contextFactory.GetContext(false)) {
    151         secMan.Authorize("AccessJobResults", sessionID, jobId);
    152         return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
    153       }
    154     }
    155 
    156     public ResponseObject<JobResultList> GetAllJobResults(IEnumerable<Guid> jobIds) {
     148        return jobManager.GetLastSerializedResult(jobId, requested, snapshot);
     149      }
     150    }
     151
     152    public ResponseObject<JobResultList> GetJobResults(IEnumerable<Guid> jobIds) {
    157153      using (contextFactory.GetContext(false)) {
    158154        //secMan.Authorize("AccessJobResults", sessionID, jobId); skip authorization
    159         return jobManager.GetAllJobResults(jobIds);
    160       }
    161     }
    162 
    163     public Response RemoveJob(Guid jobId) {
    164       using (contextFactory.GetContext()) {
    165         secMan.Authorize("RemoveJob", sessionID, jobId);
    166         return jobManager.RemoveJob(jobId);
    167       }
    168     }
     155        return jobManager.GetJobResults(jobIds);
     156      }
     157    }
     158
     159    //public Response RemoveJob(Guid jobId) {
     160    //  using (contextFactory.GetContext()) {
     161    //    secMan.Authorize("RemoveJob", sessionID, jobId);
     162    //    return jobManager.RemoveJob(jobId);
     163    //  }
     164    //}
    169165
    170166    public Response RequestSnapshot(Guid jobId) {
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/SlaveFacade.cs

    r4254 r4263  
    3535using HeuristicLab.Hive.Server.LINQDataAccess;
    3636using HeuristicLab.Hive.Server.DataAccess;
     37using HeuristicLab.Hive.Contracts.ResponseObjects;
    3738
    3839namespace HeuristicLab.Hive.Server.Core {
     
    8586    }
    8687
    87     public ResponseList<CachedHivePluginInfoDto> SendPlugins(List<HivePluginInfoDto> pluginList) {
    88       return slaveCommunicator.SendPlugins(pluginList);     
     88    public ResponseList<CachedHivePluginInfoDto> GetPlugins(List<HivePluginInfoDto> pluginList) {
     89      return slaveCommunicator.GetPlugins(pluginList);     
    8990    }
    9091
     
    9495      }
    9596    }
    96 
    9797
    9898    public ResponseCalendar GetCalendar(Guid clientId) {
     
    114114    /// Do not use automatic transactions here
    115115    /// </summary>
    116     public Stream SendStreamedJob(Guid clientId) {
     116    public Stream GetStreamedJob(Guid clientId) {
    117117      using (contextFactory.GetContext(false)) {
    118118        MultiStream stream = new MultiStream();
     
    125125        stream.AddStream(new StreamedObject<ResponseObject<JobDto>>(job));
    126126
    127         IJobManager jobManager = ServiceLocator.GetJobManager();
    128         IInternalJobManager internalJobManager = (IInternalJobManager)jobManager;
     127        IInternalJobManager internalJobManager = (IInternalJobManager)ServiceLocator.GetJobManager();
    129128
    130129        //second stream the job binary data
    131130        MemoryStream memoryStream = new MemoryStream();
    132         if (job.Obj != null)
     131        if (job.Obj != null) {
    133132          stream.AddStream(new MemoryStream(internalJobManager.GetSerializedJobDataById(job.Obj.Id)));
     133        }
    134134
    135135        OperationContext clientContext = OperationContext.Current;
     
    144144    }
    145145
    146     public Stream SendStreamedPlugins(List<HivePluginInfoDto> pluginList) {
    147       return new StreamedObject<ResponseList<CachedHivePluginInfoDto>>(this.SendPlugins(pluginList));
     146    public Stream GetStreamedPlugins(List<HivePluginInfoDto> pluginList) {
     147      return new StreamedObject<ResponseList<CachedHivePluginInfoDto>>(this.GetPlugins(pluginList));
    148148    }
    149149
Note: See TracChangeset for help on using the changeset viewer.